Skip to content

Keep Discord member scrolling responsive with viewport-driven caching - #40

Merged
itz4blitz merged 1 commit into
itz4blitz:mainfrom
vbmithr:fix/discord-member-viewport
Oct 18, 2026
Merged

itz4blitz merged 1 commit into
itz4blitz:mainfrom
vbmithr:fix/discord-member-viewport

Conversation

@vbmithr

@vbmithr vbmithr commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Fast scrolling through a large Discord member list could leave empty placeholders or wait seconds for obsolete pages. Cache reads shared the HTTP/backfill command queue, and successive page requests displaced the subscribed member windows.

This change makes the visible viewport own the Discord subscription and makes member queries return an immediate cache snapshot with an explicit pending flag. An ordered foreground thread handles viewport commands independently of HTTP backfill. The GUI retains 64 pages of 50 members, prioritizes missing visible pages, cancels obsolete work on navigation, and refreshes on member updates with a cache-only polling fallback. Gateway subscriptions coalesce by guild, and listed members do not generate duplicate presence subscriptions.

Architecture and pane documentation describe the updated contract. GUI and daemon should be updated together.

Validation:

  • Full Discord integration suite: 30 passed.
  • Daemon unit tests: 133 passed; protocol: 27 passed.
  • GUI tests: 349 passed, 1 ignored.
  • Rechecked the large-roster viewport integration and pending-response compatibility test before publication.
  • Built and exercised the changes through the Arch -git package.

Known limitation: an intermittent initial-load state with an empty cache is still under investigation. Cache replies are fast during that state, but its cause is not confirmed. This PR addresses scrolling, queue contention, and cache behavior; it does not claim to resolve that remaining initial subscription issue.

Serve member cache reads and viewport changes independently of HTTP
backfill. Keep a bounded GUI page cache, expose pending snapshots, and
let the latest visible range drive one coalesced gateway subscription.
Document the cache contract and cover rapid viewport changes in tests.

Co-Authored-By: GPT-6 <noreply@openai.com>

@itz4blitz itz4blitz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Member queries now return a cache snapshot immediately, with pending for a miss, and only Watch.members moves the live Discord subscription. Viewport commands run off the HTTP/backfill queue, unsent op 37 frames coalesce per guild, and the GUI keeps a bounded page cache that prefers visible holes over refreshes. Old Members payloads still decode, and the gateway budget stays inside Discord's 120 frames per minute. The disclosed initial empty-cache case is outside this change; scrolling, queue contention, and the cache contract are covered.

@itz4blitz
itz4blitz merged commit 7b98c4c into itz4blitz:main Oct 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants