fix: close race window that dropped active channel messages#410
Merged
Conversation
useLiveChannelUpdates skipped cache writes for the active channel, relying on useChannelSubscription to handle them. But useChannelSubscription connects asynchronously, so messages arriving in the gap were dropped by both paths. Remove the early return for the active channel so the global subscription always writes to the message cache. The merge function deduplicates by event ID, so double-writes from both subscriptions are harmless. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tlongwell-block
added a commit
that referenced
this pull request
Apr 28, 2026
* origin/main: Add multi-workspace support to desktop app (#409) feat(mobile): add #channel autocomplete to compose bar (#411) fix: close race window that dropped active channel messages (#410) feat(pulse): rich text editor with @mentions, media uploads, and formatting (#407) feat(mobile): multi-workspace support (#408) feat: always notify on DM messages like Slack/Discord (#405)
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.
Summary
useLiveChannelUpdates) was skipping cache writes for the active channel, relying on the per-channel subscription (useChannelSubscription) — but that subscription connects asynchronously, creating a window where neither path writes to the cachemergeTimelineCacheMessagesdeduplicates by event ID, making double-writes harmlessChanges
desktop/src/features/channels/useLiveChannelUpdates.ts— 7 insertions, 6 deletionsReview notes
if (!current) return currentguard differs fromuseChannelSubscription's(current = [])pattern — intentionally different semantics (global listener should not seed cache for unvisited channels)Test plan
🤖 Generated with Claude Code