Skip to content

fix(paginator): do not issue the first-page query twice - #1858

Merged
MartinCupela merged 1 commit into
release-v10from
fix/paginator-duplicate-first-page
Sep 9, 2026
Merged

fix(paginator): do not issue the first-page query twice#1858
MartinCupela merged 1 commit into
release-v10from
fix/paginator-duplicate-first-page

Conversation

@MartinCupela

Copy link
Copy Markdown
Contributor

canExecuteQuery gates on isLoading, which lives in state — and on the first-page path that flag is published only after the offline-DB preload is awaited. A second call made in the same tick therefore still reads false and proceeds, and with no loaded window both directions resolve to the same first page, so the two calls issue byte-identical requests.

A UI does exactly that: an empty or short list sits within the scroll threshold of its top AND its bottom, so the scroll handler calls toTail and toHead one line apart. Publishing the flag before the await closes the gap. Only the flag — publishing the whole prepared state early would blank a list that offline data is about to fill, which is why that write waits.

`canExecuteQuery` gates on `isLoading`, which lives in state — and on the
first-page path that flag is published only after the offline-DB preload is
awaited. A second call made in the same tick therefore still reads `false` and
proceeds, and with no loaded window both directions resolve to the same first
page, so the two calls issue byte-identical requests.

A UI does exactly that: an empty or short list sits within the scroll threshold of
its top AND its bottom, so the scroll handler calls `toTail` and `toHead` one line
apart. Publishing the flag before the await closes the gap. Only the flag —
publishing the whole prepared state early would blank a list that offline data is
about to fill, which is why that write waits.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@MartinCupela
MartinCupela merged commit 6462cef into release-v10 Sep 9, 2026
4 checks passed
@MartinCupela
MartinCupela deleted the fix/paginator-duplicate-first-page branch September 9, 2026 12:31
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