zmuxuny opened a new pull request, #6375: URL: https://github.com/apache/rocketmq-dashboard/pull/6375
### Which Issue(s) This PR Fixes Fixes #6357 ### Brief Description A metrics history entry names the data source that produced its result. If that source is no longer available, restoring the entry currently substitutes the default backend and executes the old expression there, potentially showing another environment's data. Reject restoration before any query/editor mutation when a named source is missing. Show a bilingual warning and keep the current source, draft, applied expression, time range, and result. Entries intentionally using the default source continue to restore normally. ### How Did You Test This Change? Base: rocketmq-studio at 779b8c0e7aed2396d3cc72743dcd544ea48e9ae6. - Exact final regression tests on original production: 4 failures; 2 default-source controls passed. - `./node_modules/.bin/vitest run --configLoader runner --no-cache src/components/__tests__/MetricsExplorer.test.tsx src/utils/metricsExplorerDiagnostics.test.ts`: 55 tests passed. - Real MetricsExplorer tests exercise both history restoration modes, preserve the active editing/query state, and verify no unintended default-backend request. Default-source controls remain green. - Full lint: 0 errors / 10 existing baseline warnings. Changed-file Prettier and `git diff --check` passed. - Full TypeScript/Vite production build and license check passed (133 components / 140 files). - Independent review passed. Mock APIs only; no live services or credentials. Full frontend suite and backend tests were not run locally; CI remains to be verified. ### Checklist - [x] One coherent change and Conventional Commit - [x] Regression tests added with Test suffix - [x] Warning available in Chinese and English - [x] No new source files - [ ] Backend architecture checks (not run locally; frontend-only change) - [x] In-app warning explains the restored-source constraint -- 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]
