Repository navigation
fix: apply thread reloads and queries to the registered thread - #1929
Conversation
Review: regressions, edge cases, side effectsThe Main concerns
Edge cases
Cleanup
Items marked SOLVED in
|
## [10.0.0-rc.24](v10.0.0-rc.23...v10.0.0-rc.24) (2026-10-22) ### ⚠ BREAKING CHANGES * remove messageSetToAddToIfDoesNotExist and let the message paginator place every page (#1926) * open api hot fixes (#1927) ### Bug Fixes * apply thread reloads and queries to the registered thread ([#1929](#1929)) ([acb33c4](acb33c4)), closes [#1913](#1913) * open api hot fixes ([#1927](#1927)) ([4fb4b52](4fb4b52)) ### Features * remove messageSetToAddToIfDoesNotExist and let the message paginator place every page ([#1926](#1926)) ([2b7960d](2b7960d))
|
🎉 This PR is included in version 10.0.0-rc.24 🎉 The release is available on: Your semantic-release bot 📦🚀 |
CLA
Description of the changes, What, Why and How?
Since #1913,
getThreadAndHydratereturns the thread registered inclient.threadsinstead of the copy it builds, and skips hydrating it when the thread is open.thread.reload()went throughgetThreadAndHydrate, so an open thread got itself back andhydrateState(this)returned early. Connection recovery reloads every open thread, and none of them caught up: replies sent while the user was offline never appeared, even after closing and reopening the thread.Reload
thread.reload()callsclient.getThreadand hydrates itself with the answer, merged into the loaded window as before. It no longer depends on the thread being registered.Hydrating from a response
thread.hydrateStatetakes the server response (ThreadStateResponse) instead of anotherThread, likeclient.hydrateChannelsandclient.reminders.hydrateStatetake data. The mapping from response to state is shared with the constructor (formatThreadState).skipRepliesupdates the state and leaves the replies andisStateStalealone.Queried threads
ThreadManager.resolveQueriedtakes the response instead of a copy. It returns a newThreadwhen none is registered, otherwise the registered one with its state updated:reload()Queries no longer build a copy for threads that are already registered. Each copy used to keep its replies held in the shared message store, so every thread list reload pinned the listed threads' newest replies for good.
ThreadPaginator.toStoredInstanceis removed, sincequeryThreadsAndHydratealready returns the stored instance.Behaviour changes
customdata and members for threads that are already registered. That only happened as a side effect of building the discarded copy.ThreadManager, or aThreadPaginatorwith a private store, no longer dedupes queried threads against its own store.Tests
The reload and thread list tests stubbed
getThreadAndHydrate/queryThreadsAndHydratewith ready-madeThreadcopies, which is why none of them caught the regression. They now stub the rawgetThread/queryThreads, so the registry lookup runs. New tests cover reloading a registered open thread and the threeresolveQueriedcases.Changelog
thread.reload()not applying the fetched replies to an open thread, so open threads catch up after reconnectingthread.hydrateStatenow takes a thread response (ThreadStateResponse) instead of anotherThread(breaking)