zmuxuny opened a new pull request, #5254: URL: https://github.com/apache/rocketmq-dashboard/pull/5254
### Which Issue(s) This PR Fixes - Fixes #5055. ### Problem A name-only credential edit used to read and replace the entire row. If it read the row before a concurrent secret rotation and saved afterward, it wrote the old secret back and silently undid the rotation. ### Changes Replace whole-row updates with one atomic SQL update that touches only fields supplied in the request. A null field stays unchanged, while an empty remark still clears the remark. Re-read the persisted row for the response and audit after a successful update; preserve not-found behavior when the update affects no row. This addresses the persistence lost-update path. The separate Aliyun client-cache invalidation race is covered by #5252 (originally #5052). ### Previous Submission This replaces #5056, which the inactivity bot closed after seven days without activity. The original PR retains the earlier context and test history. The linked issue remains open and the fix is still needed. The original branch was refreshed onto `rocketmq-studio@a460673f`, preserving upstream changes. Tested head: `3c447f76d7186d02926445f89e1cc251b0d95c11`. ### How Did You Test This Change? Validation rerun on the refreshed branch on 2026-10-01: - `cd server && mvn -B -ntp -Dtest=CloudCredentialServiceTest,MybatisPlusCloudCredentialRepositoryTest test`: **26 passed**; Checkstyle passed. Local execution used the Mockito Java agent required by the installed JDK. - A controlled two-request interleaving reads the old row in both requests, saves the secret rotation first, and then saves a name-only edit. The original regression failed without the fix because the final secret reverted to the old value. - Repository tests inspect generated update fields: a name edit omits `secret_key`, a secret edit encodes only the supplied key, and an empty remark remains a valid clear operation. - `git diff --check`: passed. Known verification limits: - `CloudCredentialPartialUpdateIntegrationTest` is retained to verify actual mapper SQL against an isolated MySQL row, but **was not rerun locally on this refreshed head**: this environment has no MySQL/Docker service and localhost:3306 refuses connections. The original PR's historical 27-test MySQL result is not presented as a fresh pass. This integration regression still needs CI verification. - Full CI is pending. The refreshed base includes MySQL provisioning from #5029 and workflow fixes from #5020. - Unrelated upstream frontend blockers include `MetricsExplorer.test.tsx:516` TS2353 and the separate final-artifact license gate in #5019; this backend change does not alter those paths. ### Checklist - [x] One coherent bug fix; no unrelated changes - [x] Conventional Commit subjects - [x] Service, repository and MySQL integration regressions included - [x] New test source has an ASF license header - [x] No new UI text or external API contract - [ ] Refreshed MySQL integration and full CI are green -- 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]
