Skip to content

Optimize DataSync updateRecord to not return full record#2502

Open
mpscholten wants to merge 1 commit intomasterfrom
optimize/datasync-update-no-returning
Open

Optimize DataSync updateRecord to not return full record#2502
mpscholten wants to merge 1 commit intomasterfrom
optimize/datasync-update-no-returning

Conversation

@mpscholten
Copy link
Copy Markdown
Member

Summary

  • Server no longer fetches/encodes the full record after UPDATE — only returns id to confirm the row was found and RLS allowed it
  • Removes the record/records fields from DidUpdateRecord/DidUpdateRecords response types
  • JS updateRecord() now returns { id, ...patch } locally instead of the server response
  • This is safe because the client already applies patches optimistically and receives server-side changes (triggers, defaults) via DidUpdate subscription notifications

Test plan

  • All existing DataSync tests pass (73 examples, 0 failures)
  • Verify with a DataSync app that updateRecord still works end-to-end
  • Verify subscription DidUpdate notifications still deliver server-side trigger changes

Breaking change: Code that uses the return value of updateRecord() expecting the full server record will now only get { id, ...patch }. Callers that need the full record should merge the patch into their local copy instead.

🤖 Generated with Claude Code

The server no longer fetches and sends the full record back after an
UPDATE. Instead it returns only the id (to confirm the row was found
and RLS allowed it). The JS client returns { id, ...patch } locally.

This is safe because the client already applies the patch optimistically
and receives any server-side changes (e.g. triggers) via the existing
DidUpdate subscription notifications.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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.

1 participant