GetStream / stream-chat-js

JS / Browser Client - Build Chat with GetStream.io
https://getstream.io/chat/
Other
178 stars 77 forks source link

fix: hydrate channel instance from thread response #1354

Closed myandrienko closed 1 week ago

myandrienko commented 1 week ago

Previously, Thread instance created an unitized Channel instance for the parent channel. The idea was that when the thread is rendered, it will be rendered inside the Channel component which will take care of initializing the instance.

However, it makes sense to expect at least some data in this channel instance: its name and members. This data is available in the thread response which is used to construct a Thread instance.

So now we try to hydrate the channel instance with whatever data we have. This fixes at least one known bug: channel names were not rendered in thread list view unless channel was previously queried.

Before:

Screenshot 2024-09-10 at 16 39 13

After:

Screenshot 2024-09-10 at 17 02 10

github-actions[bot] commented 1 week ago

Size Change: +478 B (+0.11%)

Total Size: 426 kB

Filename Size Change
dist/browser.es.js 92.5 kB +102 B (+0.11%)
dist/browser.full-bundle.min.js 54.1 kB +49 B (+0.09%)
dist/browser.js 93.6 kB +113 B (+0.12%)
dist/index.es.js 92.5 kB +103 B (+0.11%)
dist/index.js 93.7 kB +111 B (+0.12%)

compressed-size-action