Repository navigation
Conversation
A Watch that arrived while the gateway was connecting found no servers or channels, so it placed nothing, yet was recorded as seen; READY then synced that empty state and the same Watch again was skipped. READY now places the shell's latest Watch against the metadata it just installed, and a Watch overtaken by a newer one on the other thread is not applied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
@vbmithr this one fixes the pre-READY ordering case from #43. What changed (
Test:
It fails with the fix reverted. One behaviour change: on reconnect, the screen is rebuilt from the last Watch. If a different Space was opened from the tree after that Watch, READY puts the Watch's screen back until the next Watch arrives. To try it: git fetch origin pull/51/head:pr-51 && git checkout pr-51
cargo test -p chatd --test discord member_viewport_selected_before_ready
cargo test -p chatd # full daemon suiteYour delayed-READY reproducer should pass on this branch too, if you still have it. |
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.
Cause
members.rs::watchstored the Watch inWatched.seenbefore working out what it puts on screen. A Watch sent between identify and READY found no servers instate.guildsand no conversation in the store, so it placed nothing.ready.rs::readythen calledsync_subscriptionwith that empty state, and every later identical Watch (including the heartbeat's) was skipped by theseenequality check. The member list stayed unsubscribed, andMembersanswered pending for good.Fix
watchnow does only the dedupe and recordsseen. The placement logic moved, unchanged, intoplace.rewatch. At the end ofreadyit places the latestseenWatch against the metadata READY just installed. If no Watch was ever sent, it falls back to the oldsync_subscription, so a Space opened byTreealone stays as it is.placechecksArc::ptr_eqagainst the currentseen. A Watch that a newer one overtook on the viewport thread is never applied over it, which keeps ordering intact when navigation changes while connecting.pending: truewith no members, never an empty roster.The change touches only
watchand the final call inready. Resume (#42) and the send budget (#44) are left alone.Validation
member_viewport_selected_before_ready_is_subscribed_after_connect(not ignored). The fake gateway gains aready_afterdelay, here 1.5 s. After identify and before READY, the test sends Watch #general and then Watch #rules (members: (0, 50)). It then checks:Connected, op 37 subscribes{"4105": [[0, 99]]};Membersis pending, not empty.srcchanges reverted, the test fails ("timed out waiting for the member window"). With them, it passes.cargo test -p chatd: 134 unit tests, plus integration tests: discord 31 (30 existing + 1 new), e2e 25, telegram 17, slack 15, blobs 14, polish 12, calls 10, signal 10, teams 7, messages 5, upload 5, playback 4. All pass: 0 failed, 0 ignored.Fixes #43
🤖 Generated with Claude Code