feat(conversation): prototype infinite-query pagination for classic history - #568
Open
RonenMars wants to merge 2 commits into
Open
feat(conversation): prototype infinite-query pagination for classic history#568RonenMars wants to merge 2 commits into
RonenMars wants to merge 2 commits into
Conversation
…istory
First concrete step of ADR 0001 (Hub data layer: lazy pagination over eager multi-server drain).
The Classic History ConversationList is now fed by the already-existing infinite useConversations hook with a real onEndReached -> fetchNextPage, instead of the eager full-drain.
useConversations gains an { enabled } option so it only fetches when that tab is visible; the eager path still backs the tree/hub/classic-sessions surfaces, so the two coexist during migration (documented interim state).
Adds a stable EMPTY_CONVERSATIONS reference so the list does not see a fresh [] each render while the query is disabled or loading.
This is a prototype: on-device verification and migrating the remaining surfaces are follow-ups per the ADR.
…lassic Captures the per-view loading strategy (flat row-pagination for classic; group-first, expand-to-load for the directory-grouped tree/hub), the sessions-stay-eager vs conversations-go-lazy split, the open questions to resolve first, deliverables, and the on-device verification method.
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.
Implements step 1 of ADR 0001 (added in this PR:
docs/adr/0001-hub-data-layer-lazy-pagination.md).Why
The Hub eager-drains every page of every server up front (
useEagerConversations), which is the source of the progress churn and the "syncing" re-render loop that #563 / #566 pace and guard.The finest fix is to not drain — paginate lazily.
The infrastructure already exists but was never wired:
useConversationsis auseInfiniteQuerywith no callers, andConversationListalready supportsonEndReached/hasNextPage/isFetchingNextPage.What this prototype does
ConversationListfrom the infiniteuseConversationswith a realonEndReached→fetchNextPage, replacing the eager-drained array and the stubbed pagination props (onEndReached={() => {}},isFetchingNextPage={false}).{ enabled }option touseConversationsso it only fetches when the History tab is visible.EMPTY_CONVERSATIONSstable reference so the list doesn't see a fresh[]each render while the query is disabled or loading.Scope / caveats (it's a prototype)
Verification
ESLint clean on the changed files;
tscreports no new errors (the repo-widerouter.pushtyped-routes errors are pre-existing).The
useConversationssignature change is backward-compatible (new optional 3rd arg), so existing behavior is unchanged.