Repository navigation
fix: stability and perf fixes - #3854
Merged
Merged
Conversation
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.
🎯 Goal
Linear ticket: https://linear.app/stream/issue/REACT-1226/stability-and-performance-fixes
LLC PR: GetStream/stream-chat-js#1910
Fixes stability and render-performance issues in the channel list, channel previews, message rows and the SampleApp's offline start. Pairs with the
stream-chat-jsPR that fixes the client-side half of the channel list and pagination issues.🛠 Implementation details
f076efe12: Fixes an issue where a presence change re-rendered every channel preview containing that user (avatars and names included), although previews do not render presence.useChannelMembersState(channel, pick?)takes an optionalpickthat selects the member fields a consumer renders; the members object is only replaced when a picked field changes. The default preview hooks (useChannelPreviewDisplayName,ChannelAvatar,useIsDirectChat) pass their own picks. Withoutpickthe hook behaves as before.72b8fd705: Fixes an issue where opening the new-message screen and picking a user created the channel on the server before anything was sent. A draft channel has no id and is marked initialized, and<Channel>queried it on mount, which creates it.<Channel>now skips the mount query for a draft.111785981: Fixes an issue in the SampleApp where a cold start while offline with a token provider failed to fetch a token, disconnected the user and never recovered. The SampleApp now setspersistUserOnConnectionFailure, and its token provider falls back to the last token it fetched for that user on a network error (the token is cleared on logout; HTTP errors still throw).399be160a: Fixes an issue where opening or closing a thread re-rendered every message row in the channel. The message input context was rebuilt whenever the thread changed, and every row reads it. Nothing in that context depends on the thread any more, so the dependency is gone.cde3f4dc5: Fixes an issue where the channel list asked for a next page before its first page had loaded (an empty list reaches its end as soon as it renders).loadNextPagenow does nothing until the list has been queried once.Public API notes:
useChannelMembersStategains an optional second parameter. Additive.useCreateMessageInputContextno longer takesthreadInstance. Passing it in an object literal is now a TypeScript error.🎨 UI Changes
🧪 Testing
☑️ Checklist
developbranch