Skip to content

Fix dataset and snapshot pagination in API order - #509

Open
Kerrycek wants to merge 1 commit into
codex/user-data-api-contractfrom
codex/storage-ordered-cursors
Open

Kerrycek wants to merge 1 commit into
codex/user-data-api-contractfrom
codex/storage-ordered-cursors

Conversation

@Kerrycek

Copy link
Copy Markdown
Owner

English

Dataset lists used the smallest ID and snapshots the largest ID as the next
cursor, although their visible API order is by name or creation time. This can
skip records when IDs do not follow that order. Use the last displayed record,
a lookahead row for the true end, and a refreshed forward boundary instead.
Invalid anchors offer retry or a filter-preserving first-page restart; empty
pages retain an escape. Filter edits reset the cursor, browser history restores
it, and obsolete requests are cancelled. Text filtering remains page-local.

Part of #189. Stacked on #496 for cursor history restoration. Requires
vpsfreecz/vpsadmin#44
(320af0e15) for (full_name,id) / (created_at,id) server cursors. Do not
release against the older numeric-ID API contract. Property/download/expansion
history and real combined VM verification remain separate follow-up work.

Validation:

  • Typecheck, lint, i18n audit, build; 21 relevant existing unit tests passed.
  • 26 fixture Playwright scenarios passed across desktop/mobile (cs/en,
    admin owner filter and member NAS/API scope), including three pages,
    non-monotonic IDs, tied times, exact end, reload/Back, 400/retry, empty results
    and a refreshed forward edge. Final filter-reset/Back addition passed 2 cases.
  • The first run had two incorrect member-route assumptions; corrected to the
    actual NAS route with backend owner scoping, then reran successfully.

No live VM certification, merge, shared deploy or data mutation. Concurrent
renames/writes are not a consistent snapshot; restart traversal if necessary.
Details: docs/contracts/storage-pagination.md.

Česky

Seznam datasetů používal nejmenší ID a snapshoty největší ID pro další stránku,
ale API záznamy řadí podle názvu nebo času. Při jiném pořadí ID tak mohlo dojít
k přeskočení záznamů. Kurzor nyní vychází z posledního zobrazeného řádku; jeden
řádek navíc určí konec a obnovená stránka přepočítá hranici další stránky.
Chybný kurzor lze zopakovat nebo se vrátit na první stránku se zachováním filtrů.
Prázdná stránka má cestu zpět, změna filtru resetuje kurzor a historie jej obnoví.
Textové hledání zůstává omezené na aktuální stránku.

Část #189, větev navazuje na #496 a vyžaduje backendové PR44. Nenasazovat proti
starému API kontraktu. Historie vlastností, downloadů/expanzí a společné ověření
ve skutečném izolovaném VM zůstávají samostatnými kroky.

Prošly typecheck, lint, audit překladů, build, 21 unit testů a 26 fixture
Playwright scénářů na desktopu/mobilu (cs/en, admin i člen). Dodatečné dvě kontroly
resetu filtru a tlačítka Zpět také prošly. Dva původní testy chybně předpokládaly
členskou cestu /app/datasets; byly opraveny na skutečný NAS a API scope.
Žádný merge, sdílené nasazení ani mutace dat. Testy nejsou live VM důkazem.

Use the last displayed row instead of min/max ID to follow the ordered
cursor contract. Fetch a lookahead row and rebuild forward edges after
refresh so exact end pages and changed boundaries remain navigable.

Keep filters on cursor recovery, clear cursors on filter edits, restore
browser history, and cancel obsolete requests. Cover non-monotonic IDs,
tied times, owner scope, retries, empty pages and stale forward edges.
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.

1 participant