Skip to content

fix: select the pinned flag instead of the membership object - #3910

Merged
isekovanic merged 1 commit into
V10from
fix/channel-list-recovery-rerenders
Oct 30, 2026
Merged

isekovanic merged 1 commit into
V10from
fix/channel-list-recovery-rerenders

Conversation

@isekovanic

Copy link
Copy Markdown
Contributor

Ticket: https://linear.app/stream/issue/REACT-1476/fix-odd-edge-cases-for-channel-list-recovery

🎯 Goal

A reconnect recovery re-hydrates every channel it gets back, and re-hydration replaces channel.state.membership with an equal copy. The channel preview selected the whole membership object only to read pinned_at, so every hydrated row re-rendered for it.

πŸ›  Implementation details

useChannelPreviewData now selects pinned (membership?.pinned_at != null) instead of membership, so a row re-renders for pinning only when the pinned state changes. The hook returns the same values as before.

Rows still re-render on a recovery, because latestMessage is also replaced with an equal copy on every re-hydration. That stays as it is, since our preview and integrators' custom previews can read any field of the message. On device, preview row renders per recovery stay at 86 with 120 channels loaded, so this change has no measurable effect on its own.

🎨 UI Changes

None.

πŸ§ͺ Testing

  • New useChannelPreviewData test: replacing membership with an equal copy does not re-render the hook, and pinning still updates it. The first test fails with the old selector.
  • ChannelPreview tests and yarn test:typecheck pass.
  • Checked on an Android emulator with a release build, together with the stream-chat-js recovery fixes.

β˜‘οΈ Checklist

  • I have signed the Stream CLA (required)
  • PR targets the develop branch
  • Documentation is updated
  • New code is tested in main example apps, including all possible scenarios
    • SampleApp iOS and Android
    • Expo iOS and Android

@isekovanic
isekovanic force-pushed the fix/channel-list-recovery-rerenders branch from d51b65f to bc235b0 Compare October 30, 2026 12:34
@Stream-SDK-Bot

Copy link
Copy Markdown
Contributor

SDK Size

title develop branch diff status
js_bundle_size 2037 KB 2020 KB -17821 B πŸš€
ai_components_size 163 KB 163 KB -16 B πŸš€

@isekovanic
isekovanic merged commit 194d01c into V10 Oct 30, 2026
2 checks passed
@isekovanic
isekovanic deleted the fix/channel-list-recovery-rerenders branch October 30, 2026 12:47
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.

3 participants