Skip to content

fix(hooks): bump @stream-io/state-store to 1.3.1 and use its useStateStore binding - #4035

Merged
oliverlaz merged 3 commits into
developfrom
chore/bump-state-store-1.3.0
Dec 2, 2026
Merged

oliverlaz merged 3 commits into
developfrom
chore/bump-state-store-1.3.0

Conversation

@oliverlaz

@oliverlaz oliverlaz commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Bump @stream-io/state-store to ^1.3.1 in React Native core and SampleApp, and replace the SDK's own useStateStore with the one from @stream-io/state-store/react-bindings.

  • 1.3.1 makes subscribeWithSelector notify when a selection shrinks: an array selection that gets shorter, or an object selection that loses a key (js-toolkit#67).
  • The SDK's own hook had the opposite gap. Its snapshot 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 even though the store had notified.
  • package/src/hooks/useStateStore.ts is deleted. All internal imports now use @stream-io/state-store/react-bindings, as the AI components already did. hooks/index.ts re-exports the binding's hook, so useStateStore is still exported for integrators with the same signature.
  • No built-in selector changes shape, so only integrators' own selectors behave differently.

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 lint passes, including the entry-isolation check.
  • cd package && yarn test:typecheck and yarn build pass.
  • yarn test:unit: 3339 tests pass.

@getstream-metis

Copy link
Copy Markdown

πŸ‘‹ 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.

  • Review this PR

Or comment /jeffery review. I'll stay quiet unless you ask.

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.
@oliverlaz oliverlaz changed the title fix(deps): bump @stream-io/state-store to 1.3.0 fix(hooks): bump @stream-io/state-store to 1.3.1 and use its useStateStore binding Dec 2, 2026
…tore-1.3.0

# Conflicts:
#	package/src/components/MessageInput/MessageComposerLeadingView.tsx
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

SDK Size

title develop branch diff status
js_bundle_size 2082 KB 2085 KB +3711 B 🟑
ai_components_size 353 KB 353 KB 0 B 🟒
a2ui_size 103 KB 103 KB 0 B 🟒

@oliverlaz
oliverlaz merged commit ad0344c into develop Dec 2, 2026
13 of 21 checks passed
@oliverlaz
oliverlaz deleted the chore/bump-state-store-1.3.0 branch December 2, 2026 09:50
@github-actions github-actions Bot mentioned this pull request Dec 2, 2026
6 tasks
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

πŸŽ‰ This PR is included in version 10.4.0 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants