unbridled-41 opened a new issue, #5933:
URL: https://github.com/apache/rocketmq-dashboard/issues/5933

   ### Studio Version
   branch: `rocketmq-studio` @ `7e7aa344` (the revision verified; the branch is 
based on it)
   deployed as: not required to reproduce
   
   ### Runtime Environment
   
   Reproduced with the frontend tests (`cd web && npx vitest run 
src/pages/settings/__tests__/GeneralSettingsTab.test.tsx`); any browser.
   
   ### Connected RocketMQ Cluster
   
   Not involved; the secret signs DingTalk notifications.
   
   ### Describe the Bug
   
   The notification form saves the DingTalk signing secret, but the page 
reconciles its state from a settings read taken **before** the write:
   
   ```ts
   const base = await loadFreshSettings();
   await saveGeneralSettings(buildPayload({ ...base, ...patch }));
   setSettings({ ...base, ...statePatch });
   ```
   
   `dingtalkSigningSecretConfigured` is a server-derived marker that 
`buildPayload` strips, so it stays `false` after a save - and it is the only 
thing that renders the clear button:
   
   ```tsx
   {settings?.dingtalkSigningSecretConfigured && (<Button danger 
onClick={clearDingtalkSigningSecret}>清除钉钉签名密钥</Button>)}
   ```
   
   So an operator who pasted a wrong secret cannot remove it until a full page 
reload. The remaining action - emptying the field and saving - reports "保存成功" 
while `SettingsService` keeps the stored secret (a blank value means "keep the 
current one"), so DingTalk signing keeps failing with a secret the UI claims to 
have cleared. The AI tab's key field on the same page already marks itself 
configured after a successful save.
   
   ### Steps to Reproduce
   
   1. Settings → open the notification form, type a signing secret, save.
   2. The save succeeds, but 清除钉钉签名密钥 never appears; emptying the field and 
saving again says success while the old secret stays active.
   3. Red before the fix: the new test cannot find the clear button after the 
save.
   
   ### What Did You Expect to See?
   
   After a successful save the page knows a secret is stored, offers the clear 
action, and does not resubmit the same value on the next save.
   
   ### What Did You See Instead?
   
   No way to remove the secret from the UI, and a success toast for a save that 
did not clear anything.
   
   ### Evidence
   
   - `web/src/pages/settings/GeneralSettingsTab.tsx` (`mergeAndSave`, 
`handleNotifyFinish`, the clear button's condition), 
`web/src/pages/settings/AiAssistantTab.tsx` (the key field's counterpart), 
`server/.../settings/SettingsService.java` (blank secret means keep).
   - `cd web && npx vitest run 
src/pages/settings/__tests__/GeneralSettingsTab.test.tsx -t 'reveals the clear 
action'` - fails before the fix.
   
   ### Impact
   
   A wrong signing secret cannot be revoked from the console, which silently 
breaks DingTalk notification signing until an operator reloads the page and 
finds the button.
   
   ### Acceptance Criteria
   
   - A successful save marks the secret configured and empties the field, with 
a regression test; the existing clear action still works.
   
   **Corresponding PR:** #ISSUEPR#
   


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