* fix(frontend): fence background task cancellation cache
Cancel the exact list and target-detail reads before publishing confirmed cancellation state. Forward AbortSignals and refresh only the list, preserving sibling detail loads.
Cover delayed reads after panel close, initial detail loads, cancellation failures, and request isolation with real QueryClient/HTTP regressions.
Fixes#7177
AI-assisted with OpenAI Codex.
* test(frontend): cover cancellation before initial task list loads
Address PR #7903 review by covering the uncached-list case through cancellation, stale-response settlement, and the next enabled refresh. Document the single-argument fetch contract and capitalize the polling guidance.
* chore: remove background task screenshots from PR
A background-task detail or list read issued before the user cancels can
resolve after the mutation's success handler and overwrite the confirmed
"cancelled" snapshot with the pre-cancel "working" one, so the expanded card
shows the task as active again (and polling resumes) until a later response
corrects it.
useCancelBackgroundTask now awaits cancelQueries for the thread's
["background-tasks", threadId] prefix before seeding the confirmed detail and
list entry, so a read that started before the cancel is dropped instead of
landing afterwards. The following list invalidation is unchanged, so a mounted
card still refreshes from the server. This is the same ordering contract as the
memory mutations fixed in #6959.
Regression: frontend/tests/unit/core/background-tasks/hooks.dom.test.tsx uses a
real QueryClient with deferred detail and list reads; it ends on "working"
without the fix and keeps "cancelled" with it.
Co-authored-by: REI-330 <173389910+REI-330@users.noreply.github.com>
Co-authored-by: AochenShen99 <sac1063467113@hotmail.com>