Skip to content

Make UpdateActorSnapshot follow substrate API guidelines - #758

Merged
Julian Gutierrez Oschmann (juli4n) merged 1 commit into
agent-substrate:mainfrom
laoj2:update-methods-snapshot
Aug 6, 2026
Merged

Make UpdateActorSnapshot follow substrate API guidelines#758
Julian Gutierrez Oschmann (juli4n) merged 1 commit into
agent-substrate:mainfrom
laoj2:update-methods-snapshot

Conversation

@laoj2

Copy link
Copy Markdown
Collaborator

Fixes #732

  • UpdateActorSnapshot now carries the resource itself + update_mask
  • scope is now applied via the update mask
  • Moved update_mask to a separate file, so it can be reused by other update RPCs.
  • Added uid and version as optional guards.
  • Tests pass
  • Appropriate changes to documentation are included in the PR

@laoj2
Luiz Oliveira (laoj2) force-pushed the update-methods-snapshot branch 2 times, most recently from 1ad053d to 83b3c59 Compare August 5, 2026 16:20
applyActorUpdateMask(actor, in, req.GetUpdateMask())
applyUpdateMask(actor, in, req.GetUpdateMask(), actorMutableFields)

updated, err := s.persistence.UpdateActor(ctx, actor, expectedVersion)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As discussed, this has the same TOCTOU issues we talked in #742 but that will get fixed by #763 so I don't think we should block here.

@juli4n
Julian Gutierrez Oschmann (juli4n) merged commit aa9b7b8 into agent-substrate:main Aug 6, 2026
13 of 15 checks passed
@laoj2
Luiz Oliveira (laoj2) deleted the update-methods-snapshot branch August 7, 2026 13:53
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.

Make Update<ResourceType> methods to follow API guidelines

2 participants