btlqql opened a new pull request, #5839:
URL: https://github.com/apache/rocketmq-dashboard/pull/5839
## Why
`createUser` and `updatePassword` await `form.validateFields()` outside
their try/catch, and the modals call them fire-and-forget (`onOk={() => void
createUser()}`). Every failed validation therefore escapes as an unhandled
promise rejection. The other settings modals (DataSourceTab,
CloudCredentialTab) already guard this with the `errorFields` check.
## What changed
- Move `validateFields()` inside the try and return early when the rejection
carries `errorFields` (antd already renders the field errors); other failures
still surface via `message.error`.
## Validation
- New test `UserManagementModalValidation.test.tsx` clicks OK on both modals
with empty forms and asserts field errors render, no API call is made, and no
unhandled rejection leaks. Fails before the fix (the rejection is captured),
passes after.
- Note: `UserManagement.test.tsx` 'exports all users that match the active
filters' fails on pristine rocketmq-studio as well (pre-existing debounce
flake), unrelated to this change.
--
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]