Repository navigation
fix(poll): keep translations from poll.updated in the poll state - #1937
Merged
Merged
Conversation
handlePollUpdated copied the event through extractPollData, which builds an UpdatePollRequest and lists its fields one by one. It leaves out the server-owned name_i18n and description_i18n, so a poll.updated stored the new question but dropped its translations. Readers in other languages kept the stale translation after a question was edited, and a language added on demand with translateMessage never reached the cached poll. Option translations were not affected, because options are copied whole. Copy both fields from the event, also when they are absent. The event carries the whole poll, and a change made under channel-only translation removes the old translations, so an absent field clears the stale ones. extractPollData is public and keeps its request shape.
NikolaGoranNaumovski
requested review from
MartinCupela,
isekovanic,
oliverlaz and
szuperaz
as code owners
October 21, 2026 14:45
isekovanic
approved these changes
Oct 22, 2026
MartinCupela
approved these changes
Oct 22, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 26, 2026
## [10.0.0-rc.25](v10.0.0-rc.24...v10.0.0-rc.25) (2026-10-26) ### ⚠ BREAKING CHANGES * Channel.watch() resolves with the channel instance to use (the channel, or the instance that superseded it) instead of the server response. - watch() sends no query for a channel that is already watched and loaded (watchStatus Watching, initialized, and messagePaginator.hasResults) when it passes no options or the same options as the last successful watch() during the current watch; other options send a query. It no longer refreshes a watched channel: use channel.reload(), and load other messages through channel.messagePaginator (jumpToMessage(), toTail(), toHead()). - A watch() while another with the same options is in flight joins it instead of sending a request. - Aborting requestOptions.signal ends only that caller's wait; the request is cancelled once every caller waiting for it has aborted. - Channel.ensureWatched() is removed (v10 release candidates only); call watch(). ``` ## Changelog - `Channel.watch()` resolves with the channel and sends no query for a channel already watched and loaded, unless it asks for options the current watch was not sent with. `Channel.ensureWatched()` is removed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ### Bug Fixes * channel list reconciliation ([#1942](#1942)) ([f7f9ec8](f7f9ec8)) * count hidden messages on each side of a jump page ([#1940](#1940)) ([487ac3d](487ac3d)) * **poll:** keep translations from poll.updated in the poll state ([#1937](#1937)) ([e47b75a](e47b75a)), closes [#1878](#1878) ### Refactors * call the paginator intervals intervals, not windows ([#1939](#1939)) ([69aa18a](69aa18a)) * **channel:** remove no-op overrides, dead branch and redundant id guards ([#1936](#1936)) ([050953e](050953e)), closes [#1870](#1870) * make Channel.watch() watch a channel only when it is not watched and loaded ([#1943](#1943)) ([3c363cb](3c363cb))
|
🎉 This PR is included in version 10.0.0-rc.25 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Description of the changes, What, Why and How?
What.
Poll.handlePollUpdatednow keeps the server's question and description translations (name_i18n,description_i18n) from apoll.updatedevent.Why. The backend translates polls automatically
(CHA-5308), and
#1878 added the response fields. But
handlePollUpda throughextractPollData, which builds anUpdatePollRequestand lists its fields one by one. The translations aren't in that lpoll.state. Checked against the live API with 10.0.0-rc.22: the server sends the newname_i18ninpoll.updated`, and the cacheare affected:
new question untranslated, until they reload.
client.translateMessage({ id }, { language })on a poll message translates the poll on the server
question's new language never reaches open clients.
Option translations were not affected, because
optionsis copied whole. I alsochecked the other paths that write poll state:
mess(answer_text_i18narrives withpoll_vote),query()andreinitializeState`. None of them lose translations.How.
handlePollUpdatedcopies both fields fromevent.pollexplicitly, also when they are absent.poll.updatedcarries the whole poll (confirmed live, including after an option is added), and a change made under channel-only translation removes the old translations, so an absent field clears the stale ones.extractPollDatais public and returns a request type, so it is lefis. There are no public API or type changes:PollStatealready has both fields. Tests -test/unit/poll.test.js: an edited question's translations are stored, a language added later is stored, the description's translations are stored,translations the event no longer carries are cleared. -test/unit/poll_manager.test.ts:poll.updatedsent through the clientlanguage added later is stored, the description's translations are stored, andtranslations the event no longer carries are cleared.
test/unit/poll_manager.test.ts:poll.updatedsent through the client updates the cached poll'sname_i18n.yarn types,yarn lintandyarn testpass (4513 tests). The run reports 2unhandled errors. Both also happen on an unmodified
release-v10, inpoll.test.js(slowRequest.reject) andmessageOperations/optimisticRouting.test.ts, and are unrelated.Verified live: with this build, a
translateMessageto a new language shows upin an open client's cached poll (
it_textadded). Before the fix, the cache wasunchanged.Consumer: GetStream/stream-chat-react React PR link, poll translations in the
React v15 UI.
Changelog
poll.updatednow keeps the poll's question and description translations (name_i18n,description_i18n), so edited questions and languages added withtranslateMessageshow without a reload.Video of Fix
Screen.Recording.2026-10-21.at.16.50.38.mov