Repository navigation
ateapi: rename store.DeletePreconditions to OptionalPrecondition - #3989
Merged
Luiz Oliveira (laoj2) merged 1 commit intoNov 19, 2026
Merged
Luiz Oliveira (laoj2) merged 1 commit into
Luiz Oliveira (laoj2) merged 1 commit into
Conversation
haiyanmeng
force-pushed
the
rename-delete-preconditions
branch
from
November 19, 2026 02:06
59f4112 to
512c49c
Compare
haiyanmeng
force-pushed
the
rename-delete-preconditions
branch
from
November 19, 2026 02:20
512c49c to
eb50a1b
Compare
haiyanmeng
marked this pull request as ready for review
November 19, 2026 02:21
haiyanmeng
requested review from
Jeff Luo (JeffLuoo),
Luiz Oliveira (laoj2) and
Scott Funkenhauser (sfunkenhauser)
and removed request for
Jeff Luo (JeffLuoo)
November 19, 2026 02:21
Custom methods such as SuspendActor will take the same optional uid and version guards as deletes. Rename the type so the name fits both uses. Signed-off-by: Haiyan Meng <[email protected]>
haiyanmeng
force-pushed
the
rename-delete-preconditions
branch
from
November 19, 2026 13:15
eb50a1b to
2e47dbd
Compare
Luiz Oliveira (laoj2)
approved these changes
Nov 19, 2026
2 tasks done
Yufan Su (yufan-su)
pushed a commit
to yufan-su/substrate
that referenced
this pull request
Nov 20, 2026
…nt-substrate#4004) `store.OptionalPrecondition` and `store.Precondition` have the same uid and version fields. They differ only in whether an unset guard is an error or a skipped check. This keeps one `Precondition`. `Check` skips unset guards. Update methods call `ValidateRequired` first, so they still require both guards. Deletes and marks for deletion call only `Check`. Store behavior is unchanged. This reverses the separate optional type, which agent-substrate#3989 renamed from `DeletePreconditions`. Custom methods such as `SuspendActor` (agent-substrate#1773) can call `Check` without `ValidateRequired`. The trade-off is that the compiler no longer catches optional guards passed to an update method. That mistake now fails at runtime with `ErrPreconditionRequired`. Addresses agent-substrate#1773 AI use: I used Claude Code to review the diff and draft the commit message and this description. I reviewed both. - [x] Tests pass - [x] Docs updated --------- Signed-off-by: Haiyan Meng <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pure rename:
store.DeletePreconditionsbecomesstore.OptionalPrecondition, and its doc comment drops the delete-only wording. No behavior change.Custom methods such as SuspendActor will take the same optional uid and version guards as deletes. Rename the type so the name fits both uses.
Addresses #1773
AI use: I used Claude Code to make the rename and run the tests. I reviewed the diff.