feat(node-sdk): surface app data change callbacks and the update guard - #4017
Conversation
|
Claude finished @tylerhawkes's task —— View job PR Review - App Data Change CallbacksProgress
Review Date: August 19, 2026, 8:48 PM UTC This PR cleanly surfaces the app data change callback mechanism from the Node bindings to the SDK layer. The implementation is well-structured and follows established patterns. I have a few observations: ✅ Strengths
🔍 Observations
|
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR introduces new user-facing behavior: a callback mechanism for app data changes and a compare-and-swap parameter for No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
a87b535 to
a188e1c
Compare
a188e1c to
15dc738
Compare
15dc738 to
5ba3c44
Compare
5ba3c44 to
1e34c2a
Compare
Dismissing prior approval to re-evaluate 1e34c2a
1e34c2a to
36f53bc
Compare
36f53bc to
9e03a38
Compare
9e03a38 to
a1e75f4
Compare
| */ | ||
| async updateAppData(appData: string) { | ||
| return this.#conversation.updateAppData({ value: appData }); | ||
| async updateAppData(appData: string, expectedAppData?: string) { |
There was a problem hiding this comment.
🟠 High src/Group.ts:104
updateAppData cannot detect a conflict when the caller expects appData to be unset: passing undefined omits expectedValue, so a concurrent value can be silently overwritten. Accept a distinct unset sentinel such as null and forward it to the binding as expectedValue.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @sdks/js/node-sdk/src/Group.ts around line 104:
`updateAppData` cannot detect a conflict when the caller expects `appData` to be unset: passing `undefined` omits `expectedValue`, so a concurrent value can be silently overwritten. Accept a distinct unset sentinel such as `null` and forward it to the binding as `expectedValue`.
a1e75f4 to
db23929
Compare
Stack
Merge bottom-up — each PR is based on its parent below.
Android is the priority path: #4019 → #4011 → #4012 → #4016.
IntentState::Superseded(base:main)Already merged: #4018 (proto regen). Related follow-up, independent of this stack: #4020.
Surfaces the unstable app-data change callback on the node SDK.
Public surface
The registry is an optional object rather than a bare callback, so handlers for the other mutable fields land as further optional properties.
The binding-level
UnstableChangeCallbacksis only constructed when a handler is actually supplied — an empty registry would make the core snapshotapp_dataon every processed message for no benefit.AppDataChangeis re-exported from the SDK root so callers can type their handler.Not included
browser-sdk. It runs the client in a Web Worker and passes options across a structured clone, which cannot carry a function; wiring it needs a worker→main reverse-RPC that does not exist yet, plus a decision on whether awaiting the main thread from inside the worker's processing loop is an acceptable stall risk. See #4014.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AdY7WKkNbJmdzpmUWvW1my
Note
Surface app data change callbacks and compare-and-swap update guard in the Node SDK
UnstableChangeCallbacksto the Node bindings, letting JS callers register an asyncappDatachange callback at client creation time viaOtherOptions.unstableChangeCallbacks.appData.AppDataChange(carryinggroup_id,old_value,new_value) as a JS-visible type exported from the SDK.ThreadsafeFunction; callback failures are logged and do not abort message processing.Group.updateAppDataandUpdateAppDataOptionsto accept an optionalexpectedValue/expectedAppDatafor compare-and-swap semantics on opaque app data.📊 Macroscope summarized db23929. 4 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.