mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-07-19 02:06:38 +00:00
The Generated tab walks GET /jobs with offset paging, which drifts when
jobs complete mid-scroll, and every status event resets the loaded list
back to page one. Core and cloud now share a keyset cursor contract on
/jobs (after / next_cursor), so:
- fetchHistoryPage accepts { after } and sends it instead of offset;
next_cursor is surfaced from the pagination response
- the assets store walks history by cursor, bootstraps into cursor mode
from the first offset page (the server mints a cursor either way), and
keeps offset as the fallback for backends that don't mint cursors
- a rejected cursor (e.g. 400 INVALID_CURSOR after a server restart)
drops the cursor and resumes once via the offset fallback
- fetchJobsRaw now throws on failure instead of fabricating an empty
hasMore:false page, so a failed fetch is distinguishable from the end
of the timeline and infinite scroll stays resumable after errors
- job-completion refreshes call refreshHistoryHead, which merge-prepends
the head page instead of resetting scroll state; it replaces the list
when the page spans the whole timeline (pruning server-side deletions)
and restarts the walk when more than a page of new jobs would leave an
unfillable gap
- in-flight page fetches are invalidated by an epoch counter when the
list resets, so stale continuations can't pollute a fresh walk
hasMoreHistory is now server-authoritative instead of inferred from
batch length.