Skip to content

Handle stale version in delete()#989

Open
greschd wants to merge 1 commit into
mainfrom
fix/modeling_plies_clear
Open

Handle stale version in delete()#989
greschd wants to merge 1 commit into
mainfrom
fix/modeling_plies_clear

Conversation

@greschd

@greschd greschd commented Jun 29, 2026

Copy link
Copy Markdown
Member

Add a fallback to delete() which fetches the latest object info if
the first request fails with FAILED_PRECONDITION.

The version may become out-of-date in PyACP if a change to
a different object bumps the version in the backend (e.g., one
modeling ply affecting another's version).

Fixes #950.

@greschd greschd requested review from SRaimondi and roosre as code owners June 29, 2026 22:15
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.94%. Comparing base (ce6851d) to head (86d2be1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #989      +/-   ##
==========================================
+ Coverage   93.90%   93.94%   +0.04%     
==========================================
  Files         110      110              
  Lines        5902     5908       +6     
  Branches      332      333       +1     
==========================================
+ Hits         5542     5550       +8     
+ Misses        354      352       -2     
  Partials        6        6              
Flag Coverage Δ
direct-launch 91.01% <85.71%> (+0.02%) ⬆️
minimum-deps 92.04% <100.00%> (+0.04%) ⬆️
python-3.11 93.11% <100.00%> (+0.04%) ⬆️
python-3.12 93.11% <100.00%> (+0.04%) ⬆️
python-3.13 93.11% <100.00%> (+0.04%) ⬆️
python-3.14 93.34% <100.00%> (+0.04%) ⬆️
server-2024R2SP5 89.51% <42.85%> (-0.03%) ⬇️
server-2025R1SP4 93.07% <42.85%> (-0.03%) ⬇️
server-2025R2SP3 93.10% <100.00%> (+0.04%) ⬆️
server-2026R1 93.10% <100.00%> (+0.04%) ⬆️
server-latest 93.70% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

except grpc.RpcError as e:
# Handle version changes which have not yet
# propagated to PyACP.
if e.code() == grpc.StatusCode.FAILED_PRECONDITION:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good to handle this scenario but should we allow to delete an object which is out-of-date?
For me, it's similar to put modifications where the request is blocked, isn't it?

@greschd greschd Jun 30, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version tracking is - for the purposes of PyACP - hidden from the user; we expose an interface that acts as if it's always up-to-date. We also run Get + Put requests when editing an object, to ensure the edit is consistent.

When one client modifies an object and then another client deletes it, the logical combined operation would still be to delete it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ModelingGroup.modeling_plies.clear() fails

2 participants