Loyal-Young opened a new pull request, #5183:
URL: https://github.com/apache/rocketmq-dashboard/pull/5183

   ## What changed
   
   - Store Metrics Explorer query history under an account-scoped key. Reads, 
writes, and clearing now target the current user ID (or username when no ID is 
available).
   - Discard the old unowned key so its entries cannot be assigned to the next 
account that opens the page.
   - Keep history state associated with its owner while the component remains 
mounted. A late query callback writes under the account that started it, while 
the currently visible drawer uses the current account's history.
   - Update component fixtures and add regression tests for account isolation, 
legacy data, and a mounted account switch.
   
   Fixes #5182.
   
   ## Verification
   
   - Reproduced Bob reading Alice's history with a failing test on the previous 
implementation.
   - `npx vitest run src/utils/metricsExplorerDiagnostics.test.ts 
src/components/__tests__/MetricsExplorer.test.tsx` — 40 passed.
   - `npx tsc -b` — passed.
   - `npx eslint src/utils/metricsExplorerDiagnostics.ts 
src/utils/metricsExplorerDiagnostics.test.ts src/components/MetricsExplorer.tsx 
src/components/__tests__/MetricsExplorer.test.tsx` — passed.
   - `git diff --check` — passed.
   
   Unowned history from older versions cannot be safely attributed to an 
account, so it is intentionally discarded. The touched existing files already 
fail the repository's Prettier check on unmodified `master`.
   
   ## AI assistance
   
   An AI assistant helped trace the history storage and component state paths, 
draft the owner-scoped change, and write the regression tests. The 
cross-account read was observed before the fix, and the checks above were run 
afterward.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to