Repository navigation
fix: select the pinned flag instead of the membership object - #3910
Merged
Merged
Conversation
1 of 6 tasks
isekovanic
force-pushed
the
fix/channel-list-recovery-rerenders
branch
from
October 30, 2026 12:34
d51b65f to
bc235b0
Compare
oliverlaz
approved these changes
Oct 30, 2026
Contributor
SDK Size
|
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.
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.membershipwith an equal copy. The channel preview selected the wholemembershipobject only to readpinned_at, so every hydrated row re-rendered for it.π Implementation details
useChannelPreviewDatanow selectspinned(membership?.pinned_at != null) instead ofmembership, 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
latestMessageis 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
useChannelPreviewDatatest: replacingmembershipwith an equal copy does not re-render the hook, and pinning still updates it. The first test fails with the old selector.ChannelPreviewtests andyarn test:typecheckpass.βοΈ Checklist
developbranch