qwen-code/packages/web-shell/client
易良 8a34d3eee1
test(web-shell): pin silent failure of background artifact refreshes (#7427) (#9227)
* test(web-shell): pin silent failure of background artifact refreshes (#7427)

The toast-spam behavior reported in #7427 no longer exists on main — loadArtifacts carries no notice dispatch and the hook swallows background-refresh failures, keeping the last-good artifacts. What was missing is a regression pin: add one that fails a background refresh and asserts last-good artifacts survive, loading clears, no error surfaces, and the next refresh recovers. Mutation-verified: clearing artifacts in the catch turns it red.

* test(web-shell): cover artifact refresh triggers

* test(web-shell): tighten artifact refresh assertions

* test(web-shell): settle artifact-refresh mocks via deferred awaits (#7427)

The two regression tests added here flushed their mocked refreshes with
a single microtask, so under full-suite parallel load the hook's refresh
continuation intermittently missed the React commit and the last-good
assertions saw artifacts === [] — a signature indistinguishable from a
real #7427 regression. Model every mocked load as a deferred and
resolve/reject + await it inside act, the shape the file's pre-existing
tests already use (review round, 7 fragile flush sites).

Also fold in two review pins while the tests are being rewritten:
- R2-2: the superseded-failure test now rejects the stale load while
  the superseding load is still in flight and asserts loading stays
  true — the requestId guard in the finally cleanup becomes
  load-bearing (mutation-verified: dropping the guard fails the test).
- add a waiting -> idle settling-trigger test so the prompt guard
  cannot be specialized to 'streaming' ('waiting' is a real prompt
  status).

* test(web-shell): pin the version bookkeeping and owner-guard halves (#7427)

- Non-monotonic artifactsVersion sequence (1->2->1 from a non-zero start)
  with exact loadArtifacts call counts: killing the previous-value
  bookkeeping silently skips the refresh that returns to a previously-seen
  version (stale artifacts panel, suite green) — measured mutant.
- Owner-flip supersede variant: the provider flips isCurrent() the instant
  the session switches, before a re-render; an in-flight load resolving in
  that window passes the requestId half and only the !owner.isCurrent()
  half of the guard stops it from painting the previous session's
  artifacts — deleting that half left all prior tests green (measured).

* test(web-shell): pin superseded artifact successes

---------

Co-authored-by: yiliang114 <yiliang114@users.noreply.github.com>
2026-08-16 15:29:58 +00:00
..
adapters feat(web-shell): support text file attachments in the composer (#9180) 2026-08-15 16:34:20 +00:00
assets/icons feat(web-shell): support mutable default mid-turn messages (#8229) 2026-08-01 10:41:29 +00:00
completions fix(web-shell): reduce composer input latency (#8015) 2026-07-29 08:06:53 +00:00
components feat(web-shell): support text file attachments in the composer (#9180) 2026-08-15 16:34:20 +00:00
config fix(web-shell): preserve token and base path in session URLs (#7926) 2026-07-29 06:12:37 +00:00
constants feat(web-shell): add contextual task panels (#7929) 2026-07-30 13:45:30 +00:00
e2e feat: support fork from any conversation (#8817) 2026-08-15 10:01:49 +00:00
extensions fix(web-shell): reduce composer input latency (#8015) 2026-07-29 08:06:53 +00:00
hooks test(web-shell): pin silent failure of background artifact refreshes (#7427) (#9227) 2026-08-16 15:29:58 +00:00
lib feat(web-shell): add shadcn UI foundation (#6760) 2026-07-12 13:51:52 +00:00
live feat(web-shell): add native Live Voice (#7859) 2026-08-05 08:33:22 +00:00
session-catalog feat(web-shell): Share session catalog scheduling (#8891) 2026-08-11 09:13:14 +00:00
styles fix(web-shell): add explicit ::selection for message content in Firefox (#8417) 2026-08-04 12:33:51 +00:00
test feat(cli): improve subagent observability — untruncated live commands, transcript path, approval context (#6580) 2026-07-11 11:21:23 +00:00
utils feat(web-shell): support text file attachments in the composer (#9180) 2026-08-15 16:34:20 +00:00
voice fix(desktop): consolidate 0.1.1 regressions (#8896) 2026-08-11 15:41:14 +00:00
App.module.css feat: support drag and drop img in web-shell (#8696) 2026-08-10 05:48:17 +00:00
App.test.tsx feat(web-shell): support text file attachments in the composer (#9180) 2026-08-15 16:34:20 +00:00
App.tsx feat(web-shell): support text file attachments in the composer (#9180) 2026-08-15 16:34:20 +00:00
build-artifact.test.ts fix(web-shell): improve subagent panel updates (#8915) 2026-08-11 07:02:53 +00:00
customization.tsx feat(web-shell): support text file attachments in the composer (#9180) 2026-08-15 16:34:20 +00:00
i18n.tsx feat(web-shell): support text file attachments in the composer (#9180) 2026-08-15 16:34:20 +00:00
index-html.test.ts fix(web-shell): prevent React measure detail OOM (#7596) 2026-07-23 11:35:42 +00:00
index.html fix(web-shell): prevent React measure detail OOM (#7596) 2026-07-23 11:35:42 +00:00
index.test.tsx fix(webui): revert #8882's transactional session switching to the loading-skeleton model (#9129) 2026-08-14 08:00:25 +00:00
index.tsx feat(web-shell): add contextual task panels (#7929) 2026-07-30 13:45:30 +00:00
interactionBlockContext.ts feat(web-shell): add cell value dialog on double-click in markdown tables (#6530) 2026-07-11 15:21:34 +00:00
main.test.tsx fix(web-shell): preserve standalone session target (#9038) 2026-08-13 05:53:35 +00:00
main.tsx fix(web-shell): preserve standalone session target (#9038) 2026-08-13 05:53:35 +00:00
midTurnDedup.test.ts feat(web-shell): support text file attachments in the composer (#9180) 2026-08-15 16:34:20 +00:00
midTurnDedup.ts feat(web-shell): support text file attachments in the composer (#9180) 2026-08-15 16:34:20 +00:00
monitorDetailsContext.tsx feat(web-shell): add monitor task details (#7817) 2026-07-27 12:30:17 +00:00
portalRoot.ts feat(web-shell): add shadcn UI foundation (#6760) 2026-07-12 13:51:52 +00:00
shadowDom.test.ts feat(web-shell): add Channel management page (#7793) 2026-07-27 17:58:11 +00:00
shadowDom.ts feat(web-shell): add Channel management page (#7793) 2026-07-27 17:58:11 +00:00
subagentDetailsContext.tsx feat(web-shell): show subagent sessions in detail panel (#7380) 2026-07-22 02:31:08 +00:00
themeContext.ts feat(web-shell): daemon web-shell improvements — token usage, settings, retry, streaming metrics, hidden commands (#5066) 2026-06-13 02:58:08 +00:00
transcriptRenderMode.ts feat(webshell): replay ChatRecord history in readonly WebShell (#6999) 2026-07-19 00:09:44 +00:00
vite-config.test.ts feat(web-shell): Share session catalog scheduling (#8891) 2026-08-11 09:13:14 +00:00
vite-env.d.ts