Skip to content

fix:Add update function registration for createStream for node sdk#1405

Open
fanlia wants to merge 1 commit intoiii-hq:mainfrom
fanlia:patch-1
Open

fix:Add update function registration for createStream for node sdk#1405
fanlia wants to merge 1 commit intoiii-hq:mainfrom
fanlia:patch-1

Conversation

@fanlia
Copy link
Copy Markdown

@fanlia fanlia commented Apr 6, 2026

add missing update binding

Summary by CodeRabbit

  • New Features
    • Stream update operations are now supported in the SDK, enabling developers to modify and manage stream data and configurations directly. This enhancement provides greater control and flexibility over stream management in applications.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 6, 2026

@fanlia is attempting to deploy a commit to the motia Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

📝 Walkthrough

Walkthrough

The Sdk.createStream method now registers the previously missing stream::update function mapping, enabling update operations for streams alongside existing get, set, delete, list, and list_groups operations.

Changes

Cohort / File(s) Summary
Stream Update Registration
sdk/packages/node/iii/src/iii.ts
Added stream::update(${streamName}) function mapping to engine stream registrations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A whisker-twitch and a hop so grand,
Update streams now work as planned!
One line added, missing no more,
Opens up the update door. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix:Add update function registration for createStream for node sdk' clearly describes the main change: adding the missing update function registration for the createStream method in the Node SDK.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
sdk/packages/node/iii/src/iii.ts (2)

573-575: ⚠️ Potential issue | 🟡 Minor

createStream JSDoc is now stale and contradicts runtime behavior.

Line 598 registers stream::update(...), but this doc block still says update is not registered. Please update the method description to avoid misleading implementers.

Suggested doc fix
-   * Registers 5 of the 6 `IStream` methods (`get`, `set`, `delete`, `list`,
-   * `listGroups`). The `update` method is not registered -- atomic updates are
-   * handled by the engine's built-in stream update logic.
+   * Registers all `IStream` methods (`get`, `set`, `delete`, `list`,
+   * `listGroups`, `update`) for the provided stream name.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk/packages/node/iii/src/iii.ts` around lines 573 - 575, Update the stale
JSDoc for createStream to reflect the actual runtime behavior: note that all 6
IStream methods including stream::update are registered (instead of claiming
update is not registered); locate the createStream JSDoc block near the
createStream function and replace the sentence that says "The `update` method is
not registered -- atomic updates are handled by the engine's built-in stream
update logic." with a statement that `update` is registered (e.g., "Registers
all 6 IStream methods (`get`, `set`, `delete`, `list`, `listGroups`, and
`update`)") and optionally add a brief note about how stream::update is handled
at runtime if needed for clarity.

592-599: ⚠️ Potential issue | 🟠 Major

Add the same stream::update registration in iii-browser to preserve SDK parity.

This Node SDK update is correct, but sdk/packages/node/iii-browser/src/iii.ts still registers only get/set/delete/list/list_groups. That creates a cross-SDK capability mismatch for IStream.update.

Suggested parity patch (iii-browser)
 createStream = <TData>(streamName: string, stream: IStream<TData>): void => {
   this.registerFunction(`stream::get(${streamName})`, stream.get.bind(stream))
   this.registerFunction(`stream::set(${streamName})`, stream.set.bind(stream))
   this.registerFunction(`stream::delete(${streamName})`, stream.delete.bind(stream))
   this.registerFunction(`stream::list(${streamName})`, stream.list.bind(stream))
   this.registerFunction(`stream::list_groups(${streamName})`, stream.listGroups.bind(stream))
+  this.registerFunction(`stream::update(${streamName})`, stream.update.bind(stream))
 }
As per coding guidelines: "Ensure the sdks are ergonomic and idiomatic within each language sdk while balancing being symmetric and consistent between language sdks." and "Check for related inconsistencies with the other language sdks in sdk/".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sdk/packages/node/iii/src/iii.ts` around lines 592 - 599, The browser SDK's
createStream implementation is missing the registration for the update
operation, causing a capability mismatch for IStream.update; add the same
registration as in the Node SDK by calling
this.registerFunction(`stream::update(${streamName})`,
stream.update.bind(stream)) inside the createStream<TData>(streamName: string,
stream: IStream<TData>) function so get/set/delete/list/list_groups/update are
all registered and the APIs remain symmetric.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@sdk/packages/node/iii/src/iii.ts`:
- Around line 573-575: Update the stale JSDoc for createStream to reflect the
actual runtime behavior: note that all 6 IStream methods including
stream::update are registered (instead of claiming update is not registered);
locate the createStream JSDoc block near the createStream function and replace
the sentence that says "The `update` method is not registered -- atomic updates
are handled by the engine's built-in stream update logic." with a statement that
`update` is registered (e.g., "Registers all 6 IStream methods (`get`, `set`,
`delete`, `list`, `listGroups`, and `update`)") and optionally add a brief note
about how stream::update is handled at runtime if needed for clarity.
- Around line 592-599: The browser SDK's createStream implementation is missing
the registration for the update operation, causing a capability mismatch for
IStream.update; add the same registration as in the Node SDK by calling
this.registerFunction(`stream::update(${streamName})`,
stream.update.bind(stream)) inside the createStream<TData>(streamName: string,
stream: IStream<TData>) function so get/set/delete/list/list_groups/update are
all registered and the APIs remain symmetric.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2dc4c07b-bccf-4cde-b667-cd50afde0fe3

📥 Commits

Reviewing files that changed from the base of the PR and between 7677350 and dbaeec8.

📒 Files selected for processing (1)
  • sdk/packages/node/iii/src/iii.ts

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