perf(companies): integrate verified owner cache invalidation
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# PERF-01 Companies cache
|
||||
|
||||
Base `fd524a4b9d55d671d4f9c93134057d42f9cd6373`. The browser's Companies cache is scoped to the current owner. A response that started before invalidation could finish after its replacement and overwrite the fresh list. A pre-logout response could also write after signing back in as the same account. Separately, a mounting consumer could publish its initial empty array as cached data before the network request finished, so another consumer could miss the shared result.
|
||||
|
||||
Only the current in-flight response can now populate the cache. It must still match the active owner. The resource-state effect no longer writes a second copy into the shared cache. Existing readers, invalidation callers, request URL and server authorisation are unchanged.
|
||||
|
||||
Before the fix, the three added cases failed on the stale post-edit list, a missed shared response and the stale pre-logout list. After the fix, the two simultaneous readers both received the shared result with exactly one request. The post-invalidation check used exactly two requests across the old and new generations, with no extra request on a warm mount. Re-login and account switching checks also passed.
|
||||
|
||||
**Verification:** 16 tests across the account-scoped state, Edit Job revision and theme state suites passed. Targeted lint and TypeScript passed. The test worktree reused the installed dependency tree from the matching A3 lockfile. These are mock request counts, with no browser or production latency measurement.
|
||||
|
||||
The A3 integration used the exact source and regression delta from `21db35d2b965fbda2ddf5b419ac2646fcae05517`. Both input files matched its parent at A3 base `bca750446f1069eb55d648be838be192d70c2d30`. The fresh A3 run passed 37 tests across account-scoped state, JobTable density and Jobs integration, plus type-check and scoped lint. These runs overlap. [A3 receipt](../ui-modernisation/evidence/perf-company-cache/TESTS.txt)
|
||||
@@ -0,0 +1 @@
|
||||
PASSED ESLint with zero warnings for useCompanies.ts and account-scoped-state.test.tsx
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user