Tasks and events: older responses overwrite newer ones #1734

Closed
opened 2026-11-02 04:12:26 +00:00 by sam · 1 comment
Owner

These async writes have no request guard:

  • ui/src/tasks/TasksPage.vue:105-141: load() and loadMore() can put the previous status filter's rows, or its next cursor, under the new filter.
  • ui/src/tasks/use-task-run.ts:167-190: keyedLoad writes after dropCaches(), and its 30 s timeout writes null over a newer successful response, so a loaded log, changes or debug panel flips to "could not load".
  • ui/src/tasks/TaskLogs.vue:118-127: loadOlder writes a page fetched under the old attempt or filter.
  • ui/src/events/EventsPage.vue:76-95: counts for the previous workspace can overwrite the current one.

Done when: each write is dropped unless it belongs to the latest request, using the generation guard in ui/src/logs/state.ts:86-112.

These async writes have no request guard: - `ui/src/tasks/TasksPage.vue:105-141`: `load()` and `loadMore()` can put the previous status filter's rows, or its `next` cursor, under the new filter. - `ui/src/tasks/use-task-run.ts:167-190`: `keyedLoad` writes after `dropCaches()`, and its 30 s timeout writes `null` over a newer successful response, so a loaded log, changes or debug panel flips to "could not load". - `ui/src/tasks/TaskLogs.vue:118-127`: `loadOlder` writes a page fetched under the old attempt or filter. - `ui/src/events/EventsPage.vue:76-95`: counts for the previous workspace can overwrite the current one. Done when: each write is dropped unless it belongs to the latest request, using the generation guard in `ui/src/logs/state.ts:86-112`.
sam added the highbug labels 2026-11-02 04:12:26 +00:00
sam self-assigned this 2026-11-02 04:12:26 +00:00
Author
Owner

Fixed in 7a8d948f, using the generation guard from logs/state.ts:86-112 at all four sites. TasksPage load/loadMore drop responses that settle after a newer read; use-task-run keyedLoad keeps a per-key generation and dropCaches stales every in-flight read, so the 30s timeout can't write null over a newer success; TaskLogs loadOlder drops pages fetched under a changed attempt/filter (the pageKey watch also bumps the generation); EventsPage loadCounts drops the previous workspace's counts. Verified: task check passed on the committed tree.

Fixed in 7a8d948f, using the generation guard from logs/state.ts:86-112 at all four sites. TasksPage load/loadMore drop responses that settle after a newer read; use-task-run keyedLoad keeps a per-key generation and dropCaches stales every in-flight read, so the 30s timeout can't write null over a newer success; TaskLogs loadOlder drops pages fetched under a changed attempt/filter (the pageKey watch also bumps the generation); EventsPage loadCounts drops the previous workspace's counts. Verified: task check passed on the committed tree.
sam closed this issue 2026-11-06 11:34:50 +00:00
sam added the task label 2026-11-14 14:45:22 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1734