Frun1na opened a new issue, #6810:
URL: https://github.com/apache/rocketmq-dashboard/issues/6810

   ### Before Creating the Bug Report
   
   - [x] I have searched the [open 
issues](https://github.com/apache/rocketmq-dashboard/issues) of this repository 
and believe that this is not a duplicate.
   - [x] This is a defect in RocketMQ Studio, not a usage question and not a 
defect in another Apache RocketMQ repository.
   - [x] I can reproduce this on the current `rocketmq-studio` branch, or I 
have stated the exact version I am running below.
   
   ### Studio Version
   
   branch: rocketmq-studio
   git commit id: a92c23144408cdf5729707050e9ecd9b75f1bad0
   deployed as: reproduced by a unit test against that commit
   
   ### Runtime Environment
   
   not applicable — the defect is in the settings tab, reproduced with a jsdom 
unit test
   
   ### Connected RocketMQ Cluster
   
   not applicable — reproduced with a stubbed settings API in a unit test
   
   ### Describe the Bug
   
   After saving a DingTalk signing secret on Settings → General, the "清除钉钉签名密钥" 
button does not appear until the page is reloaded, so the operator cannot 
remove the secret they just stored.
   
   `POST /api/settings/general/save` answers `Result<Void>` 
(`SettingsController.saveGeneralSettings:47-54`), and the server never echoes 
the secret back (`SettingsService:157-160`: `clearDingtalkSigningSecret` clears 
it, a blank value keeps the stored one). The tab therefore has to maintain the 
`dingtalkSigningSecretConfigured` flag itself: `mergeAndSave` merges the save 
patch into the *fresh read taken before the save* 
(`GeneralSettingsTab.tsx:148-161`), whose flag is still `false`, and 
`handleNotifyFinish` (line 196) passes only the form values — so the flag stays 
false and the clear button gated on it (line 358) never renders.
   
   The same tab already patches the flag in the other direction 
(`clearDingtalkSigningSecret` sets it to `false`, line 171), and 
`AiAssistantTab.tsx:316` calls `setApiKeyConfigured(true)` right after a 
successful API-key save for exactly this reason.
   
   ### Steps to Reproduce
   
   ```
   cd web && npx vitest run 
src/pages/settings/__tests__/GeneralSettingsTab.test.tsx
   ```
   
   The new case loads the tab with no secret configured, types one, submits the 
notification form and asserts the clear button appears. On a92c2314 it fails 
with:
   
   ```
   TestingLibraryElementError: Unable to find an element with the text: 清除钉钉签名密钥
    ❯ src/pages/settings/__tests__/GeneralSettingsTab.test.tsx:237:25
   ```
   
   In a browser: Settings → General → enter a signing secret → 保存设置 → the 
"清除钉钉签名密钥" button is missing until a full reload.
   
   ### What Did You Expect to See?
   
   Saving a secret makes the clear affordance available immediately, as the 
"保存后不会回显" help text implies the value is now stored server-side.
   
   ### What Did You See Instead?
   
   The clear button stays hidden until the tab is reloaded, because the local 
`dingtalkSigningSecretConfigured` flag is never set after a successful save.
   
   ### Additional Context
   
   A fix with a regression test follows in a pull request.
   
   ### Are You Willing to Submit a Pull Request?
   
   - [x] Yes, I am willing to submit a pull request.
   


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