fix(history): isolate query scope transitions
This commit is contained in:
@@ -2,6 +2,18 @@
|
||||
|
||||
This document records verified risks, the production controls that address them, and the next evidence to collect. It is intentionally operational: a passing build alone is not proof that the browser application is production-ready.
|
||||
|
||||
## 2026-07-16: scope-safe history transitions
|
||||
|
||||
The history page previously used every successful detail and trend response as placeholder data for the next query key. Changing the vehicle, time window, protocol or data category could therefore leave the old table, chart legend and selected-row evidence visible under the new filters until both replacement requests completed. Besides retaining the old high-cardinality payload during the transition, this could make an operator attribute evidence to the wrong search scope.
|
||||
|
||||
Placeholder reuse is now limited to pagination inside an identical history scope. A scope change immediately removes the old detail and trend payloads, resets the evidence panel and displays an explicit loading state; same-scope page changes retain the last page to avoid layout jumps. Selected evidence stores only the scope and row ID instead of a complete row object. TanStack Query documents previous-data placeholders specifically as a pagination technique, while Elastic Discover treats the query, filters and time range as the search context that defines the displayed result:
|
||||
|
||||
- <https://tanstack.com/query/v5/docs/framework/react/guides/paginated-queries>
|
||||
- <https://tanstack.com/query/v5/docs/framework/react/guides/placeholder-query-data>
|
||||
- <https://www.elastic.co/docs/explore-analyze/discover>
|
||||
|
||||
The regression suite holds the replacement requests open after a scope change and proves that the old plate, trend and evidence ID are absent while the new loading state is visible. A query-policy test independently proves that page placeholders survive only when the scope key is unchanged.
|
||||
|
||||
## 2026-07-16: session-scoped client cache
|
||||
|
||||
Logout previously removed only the bearer token. TanStack Query's inactive query results and mutation records could therefore remain in browser memory for their normal lifecycle and be reused after another operator logged in on the same workstation. An expired token also left the current route and its cached vehicle data visible while protected requests repeatedly returned 401.
|
||||
|
||||
Reference in New Issue
Block a user