4 Commits

Author SHA1 Message Date
MasterZRC
d59738649f
fix(frontend): isolate background task cancellation reads (#7903)
* 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
2026-11-17 10:10:29 +08:00
Rei
097fa6dca7
fix(frontend): fence a confirmed background-task cancellation against stale polls (#7914)
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>
2026-11-06 10:29:57 +08:00
RongJie G
81c5c83384
fix: make MCP notification recovery rollback-safe (#5908)
Signed-off-by: CorgiBoyG <111257566+CorgiBoyG@users.noreply.github.com>
2026-09-27 20:46:56 +08:00
Aari
5ffc2d3e27
feat(mcp): complete durable task notifications and chat UI (#4833)
* feat(mcp): add reliable task notifications and cancellation

* feat(mcp): add background task chat UI

* fix(mcp): hide and sanitize task notification prompts

* fix(mcp): sanitize projected task names

* fix(mcp): harden task notifications and details

* fix(mcp): harden task lifecycle recovery

* fix(mcp): gate task UI and isolate cancellations

* test: scope plain-text response locator

* fix(mcp): align task notification boundaries

* fix(mcp): bound task delivery retries

* fix background task notification races
2026-08-22 16:53:32 +08:00