Repository navigation
fix(hooks): bump @stream-io/state-store to 1.3.1 and use its useStateStore binding - #4035
Merged
Merged
Conversation
π Hi Oliver, want a second pair of eyes on this?I'm Jeffery, Stream's review agent. I look for bugs, regressions, missing tests and slow paths, and I only post findings I've checked against the code.
Or comment |
Bump @stream-io/state-store to 1.3.1, which notifies selector subscribers when a selection shrinks, and replace the SDK's own useStateStore with the one from @stream-io/state-store/react-bindings. The old hook compared only the cached selection's keys, so a selection that grew (an added key, or an array growing with the same prefix) kept returning the stale value. useStateStore stays exported from the SDK as a re-export of the binding.
β¦tore-1.3.0 # Conflicts: # package/src/components/MessageInput/MessageComposerLeadingView.tsx
SDK Size
|
isekovanic
approved these changes
Dec 2, 2026
|
π This PR is included in version 10.4.0 π The release is available on:
Your semantic-release bot π¦π |
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.
Summary
Bump
@stream-io/state-storeto^1.3.1in React Native core and SampleApp, and replace the SDK's ownuseStateStorewith the one from@stream-io/state-store/react-bindings.subscribeWithSelectornotify when a selection shrinks: an array selection that gets shorter, or an object selection that loses a key (js-toolkit#67).package/src/hooks/useStateStore.tsis deleted. All internal imports now use@stream-io/state-store/react-bindings, as the AI components already did.hooks/index.tsre-exports the binding's hook, souseStateStoreis still exported for integrators with the same signature.Tests
New
package/src/hooks/__tests__/useStateStore.test.tsx(9 tests): the SDK export is the binding's hook, a selection that gains or loses a key, an array that grows or shrinks, references kept when nothing changed, and no store. The two shrink tests fail with 1.3.0 and pass with 1.3.1.Verification
yarn lintpasses, including the entry-isolation check.cd package && yarn test:typecheckandyarn buildpass.yarn test:unit: 3339 tests pass.