Skip to content

Reconcile member viewport selected before Discord READY after metadata arrives #43

Closed

Description

@vbmithr

A member viewport selected before Discord's initial READY can remain unsubscribed after the connection succeeds. A standalone real-daemon test against a local fake Discord Gateway reproduces this ordering defect without the GUI or a real account.

Tested source: main 44ad327 plus #40 (6fa84d4).

Reproduction:

  1. Start chatd with a synthetic account and delay the Gateway READY response by 1.5 seconds after identify.
  2. After identify, but before READY, send Watch selecting a known fixture server/channel with members: [0, 50].
  3. Allow READY to deliver the server/channel metadata and wait for Link::Connected.
  4. Query Members and inspect outgoing subscription frames.

Observed: Members returns an immediate pending snapshot, but no subscription for the selected channel is delivered in the following 500 ms. The local regression member_viewport_selected_before_ready_is_subscribed_after_connect fails in 2.02 seconds overall. The 500 ms observation window is not a measurement of eventual recovery.

Code path in crates/chatd/src/adapters/discord/:

  • members.rs::watch records Watched.seen before resolving the conversation/server against available metadata.
  • With metadata absent, the desired live list cannot be established.
  • ready.rs::ready calls sync_subscription using that unresolved state, without reevaluating the stored Watch.
  • Later identical Watches are skipped by the equality check, so ordinary cache polling does not resolve this ordering error.

Expected: after READY installs metadata, reconcile the latest desired Watch against that metadata and subscribe the selected member window. Preserve ordering if navigation changes again while connecting. A member-cache miss should not be mistaken for an empty roster.

The controlled test establishes this startup failure path. It does not prove that every previously observed intermittent blank member pane has the same cause. Reconnect with RESUMED has a related but separate queue-loss reproduction in #42.

The reproducer and delayed-READY fixture support currently exist locally, not in #40. They can become a normal regression test with the fix. Other audit results: 133 daemon unit tests and 31 Discord integration tests passed; cached member IPC p99 was below 0.7 ms. This is a state-reconciliation problem rather than slow cache access.

Activity

  1. added 2 commits that reference this issue on Oct 20, 2026
    f7a2b31
    3cfad23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions