zmuxuny opened a new pull request, #5056: URL: https://github.com/apache/rocketmq-dashboard/pull/5056
### Which Issue(s) This PR Fixes - Fixes #5055 ### Brief Description A name-only edit used to read and replace the entire credential row. If it read the row before a concurrent secret rotation and saved after it, the old secret was written back. 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; the existing not-found behavior remains when an update affects no row. This fixes the persistence lost-update path. The client-cache invalidation race is a separate issue handled in #5052. ### How Did You Test This Change? - Added a controlled two-request interleaving: both requests read the old row, secret rotation saves first, then a name-only edit saves. Against unmodified `rocketmq-studio`, the test failed because the final secret was `old-secret` rather than `new-secret`; it passes with this patch. - Added repository tests that inspect the 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. - Added a MySQL integration regression with an isolated credential row to verify the actual mapper SQL preserves a rotated secret across a later metadata edit. - `cd server && mvn -B -ntp -Dtest=CloudCredentialPartialUpdateIntegrationTest,CloudCredentialServiceTest,MybatisPlusCloudCredentialRepositoryTest test` — 27 tests passed against local MySQL 8; Checkstyle passed. - `git diff --check` — passed. ### Checklist - [x] One coherent bug fix; no unrelated changes - [x] Conventional commit subject - [x] Regression tests added with `...Test` method names - [x] New test source file has an ASF license header - [x] No new UI text or external API contract -- 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]
