tju-yxq opened a new pull request, #5454:
URL: https://github.com/apache/rocketmq-dashboard/pull/5454

   ### Which Issue(s) This PR Fixes
   
   - Fixes #5399
   - Fixes #5404
   - Fixes #5407
   - Fixes #5409
   - Fixes #5411
   
   ### Brief Description
   
   Consolidates five previously separate single-guard PRs into one cohesive 
change, following the grouping guideline in #2107 ("one PR per guard of the 
same pattern" is exactly the fragmentation it asks contributors to avoid). Each 
guard closes a real double-submission or in-flight clobbering defect, and each 
keeps its own regression test:
   
   1. **DLQ Excel exports** (#5399): `handleExport`/`exportDetailExcel` had no 
in-flight guard — double-clicking 导出/导出全部/导出选中 ran the broker queue scan twice 
and downloaded twice. Now one shared `exportInFlightRef`, with loading states 
on the acting buttons and the other rows' export buttons disabled while one 
runs.
   2. **K8s certificate deletes** (#5404): a single unguarded `deletingId` slot 
— a second delete mid-flight stole the first row's spinner, re-enabled its 
button and let a repeat confirmation re-POST an already-deleted cert. Now a 
per-id Set behind a synchronous ref guard.
   3. **One-click instance import** (#5407): `handleImportAll` bypassed the 
add-modal's shared `mutationInFlightRef` — an import could run concurrently 
with the create it shares the modal with, both closing/resetting the modal and 
reloading the list under each other. Now it participates in the shared guard 
and both footer buttons reflect the cross-flight state.
   4. **AI conversation deletes** (#5409): `remove()` replaced the whole 
`deletingIds` array — a row delete during a batch wiped the batch rows' 
spinners and re-enabled their buttons (repeat confirmations double-POSTed and 
produced misleading partial-failure warnings). Now the merge pattern (the 
sibling `toggleArchive`'s `archivingIds` approach) plus a ref guard that skips 
already-queued ids.
   5. **Bare-route AI conversation creation** (#5411): the creation window in 
`useAiSend.startRun` had no guard while the stream path's twin does — a second 
Enter created a second conversation and silently dropped the first prompt (the 
armed entry is a single slot). Now `createInFlightRef` covers the create + 
navigation window, and a suppressed send returns the prompt to the composer 
like a failed create.
   
   ### How Did You Test This Change?
   
   All five suites together on the consolidated branch (the member PRs each 
passed their own suite; this verifies the combination):
   
   ```
   cd web && npm test -- DLQPage.test.tsx K8sCertsPage.test.tsx 
InstancePage.test.tsx ConversationListModal.test.tsx AiPage.test.tsx --run
    Test Files  5 passed (5)
         Tests  102 passed (102)
   ```
   
   One regression test per guard: the DLQ double-click submits exactly one 
export; concurrent certificate deletes keep independent `ant-btn-loading` 
spinners and delete each id once; the import button stays disabled while a 
Connect submission is pending; a row delete during a batch keeps all three 
spinners and never double-POSTs; a second bare-route Enter fires exactly one 
`createConversation` and restores the suppressed prompt to the composer.
   
   ```
   cd web && npm run lint
   ✖ 10 problems (0 errors, 10 warnings)   # the trunk baseline
   ```
   
   ```
   cd web && npx tsc -b --force
   (no output — exit 0)
   ```
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in (one 
purpose — in-flight guards — across the five pages it fixes, per the grouping 
guideline #2107)
   - [x] Commit subject follows Conventional Commits
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
(no new UI text)
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks) (no Java changes)
   - [x] New source files carry the ASF license header (no new source files)
   - [ ] Documentation touched where behaviour changed (guards only)
   


-- 
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