zmuxuny opened a new pull request, #7187: URL: https://github.com/apache/rocketmq-dashboard/pull/7187
### Which Issue(s) This PR Fixes Fixes #7186 ### Brief Description Keep alert-rule imports owned by the keyed domain page that started them. A pending File.text() currently survives page departure and can dispatch an import into the old domain. Read/API outcomes can also show global success/error messages after departure. Capture a monotonic page generation and check it after file reading and the import request, including error and loading-state continuations. Same-domain navigation preserves the current import. Already-dispatched backend writes are not cancelled or rolled back. Export, APIs, payload validation and mutation serialization are unchanged. This is a narrow continuation of the page ownership established by merged #6190, not a duplicate of #6454's repeat-submit locks or #6889's export partitioning. ### How Did You Test This Change? Added 11 real-page tests using React Router and AntD controls, with File.text/API promises deferred at the boundaries: - Pending file success/error after domain navigation and full unmount. - API success/failure after domain navigation and full unmount. - Leaving and returning to the same domain does not revive an old read. - StrictMode permits an active import and another selection of the same file after completion. - Same-domain query navigation preserves the pending import. The exact final suite with a nonempty native-rule transfer produces **9 failures and 2 passing controls** against unchanged production at 127c47b06a268cc74224d5f34c56ec7c36ac0d55. With the fix: - `npx vitest run src/pages/ops/__tests__/AlertsPage.test.tsx src/pages/ops/__tests__/alertRulePayload.test.ts --maxWorkers=1`: **54 passed**. - `npx tsc -b --force`: passed. - Changed-file ESLint: zero errors, five existing warnings in alerts.tsx. - Changed-file Prettier: passed. - `npm run build`: passed, including distribution license check (132 components, 139 license files). No live alert rules were imported. Full frontend/backend suites were not run locally; CI remains pending. The diff was independently reviewed. AI assistance was used. ### Checklist - [x] One coherent change; no unrelated modifications. - [x] Conventional Commit subject. - [x] Regression tests added; original assertions preserved. - [x] No new UI text or source files; existing license headers preserved. - [ ] Full CI completed (pending). -- 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]
