Repository navigation
Keep Discord member scrolling responsive with viewport-driven caching - #40
Merged
Merged
Conversation
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>
This was referenced Oct 18, 2026
itz4blitz
approved these changes
Oct 18, 2026
itz4blitz
left a comment
Owner
There was a problem hiding this comment.
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.
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.
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
pendingflag. 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:
-gitpackage.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.