4f8046d7e939ac7237aba114d9050cfbba0fbab9
the store every dashboard layout is written through had no tests. writing them found a live defect on its rollback: the guard asked "does the cache still hold what i wrote?" by reference, and setQueryData runs react query's structural sharing, which rebuilds an object rather than storing the one it was handed. verified against 5.101.4 — an object comes back !==, a string comes back ===. so the check was false for every container the store exists to hold: every layout, every config.agentName. a refused write kept its optimistic value while the toast said it had been rolled back, and the change vanished at the next reload. only primitives ever reverted, which is why it went unnoticed. replaced with a per-key write sequence, which asks the question the identity check meant to ask — has anything written this key since — and does not depend on identity at all. 14 tests: readValue's kind guard, the optimistic write and its updater composition, and five on revert including the object regression pin. also moves testing-library's cleanup into test-setup. it auto-registers afterEach at module import time, so bun attaches it to whichever file imports the library first and every later file silently gets none. adding this test file was enough to break fourteen assertions in DataTable.test.tsx, which does not import it. preload has no file scope, so registering there removes the ordering from the question. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Description
No description provided
42 MiB
Languages
TypeScript
90.9%
Shell
4.7%
JavaScript
4.1%
CSS
0.2%
HTML
0.1%