unbridled-41 opened a new pull request, #4177:
URL: https://github.com/apache/rocketmq-dashboard/pull/4177

   {"body": "Fixes #4176.\n\n## Problem / Evidence\n\nThe cloud-instance edit 
dialog renders the **\u63a5\u5165\u5730\u5740 (endpoint)** input as editable 
for Aliyun/Tencent instances, posts the new value, and shows the 
`\u5b9e\u4f8b\u300c{name}\u300d\u5df2\u66f4\u65b0` success toast \u2014 but the 
backend never persists it:\n\n- `InstanceService.updateInstance` (~lines 
589\u2013600): `boolean cloudInstance = existing.getVendor() != null && 
existing.getVendor() != InstanceVendor.APACHE;` \u2014 the `endpoint` (and 
`type`) update only runs `if (!cloudInstance)`.\n- Cloud endpoints are 
catalog-resolved (`resolveEndpoint(detail)`, `InstanceService.java:512`); 
`createCloudInstance` even rejects a manual endpoint (`\"Commercial instances 
must be selected from the cloud catalog, endpoint cannot be set 
manually\"`).\n- Frontend: the endpoint `Form.Item`/`Input` in 
`web/src/pages/instance/index.tsx` has no vendor gating (only 
`adminCredentialRef` is gated to Apache), and `handleUpdate` uncon
 ditionally shows `message.success(t('instance.updated', ...))`.\n- The page's 
own tooltip declares the intent: `instance.cloudEndpointExtra` = 
\"\u4e91\u670d\u52a1\u5b9e\u4f8b\u63a5\u5165\u5730\u5740\u7531\u4e91\u5382\u5546\u76ee\u5f55\u89e3\u6790\uff0c\u4e0d\u652f\u6301\u624b\u52a8\u4fee\u6539\"
 \u2014 but the input ignores it.\n\nNet effect: the operator edits a critical 
connection setting, gets a success toast, and the change silently 
disappears.\n\n## Root cause / Fix\n\nThe edit form never vendor-gated the 
endpoint field the way the backend does. Minimal fix: disable the endpoint 
`Input` when `editingInstance.vendor` is set and not `APACHE`. Apache instances 
stay editable (pinned by the existing \"updates instance type and endpoint 
through the edit dialog\" test).\n\n## Priority & scoring\n\nPRIORITY = 79 
(\u5f71\u54cd 32: a critical connection setting silently no-ops while reporting 
success; \u6ce2\u53ca\u8303\u56f4 15: all Aliyun/Tencent instances' edit 
dialogs; \u53ef\u590d\
 u73b0\u6027 18: deterministic \u2014 edit endpoint on a cloud row, save, 
reload, old value; \u7ef4\u62a4\u4ef7\u503c 14: aligns UI with backend contract 
already stated in code and tooltip). FIX_CONFIDENCE = 92 (one attribute + 
regression tests; no backend change needed).\n\n## Tests\n\nRed (before fix, 
branch `rocketmq-studio` @ 0a596661):\n\n```\nnpx vitest run 
src/pages/instance/__tests__/InstancePage.test.tsx -t \"keeps the endpoint 
editable\"\n FAIL ... Error: expect(element).toBeDisabled()\n Received element 
is not disabled: <input id=\"endpoint\" ...>\n```\n\nGreen (after fix): `npx 
vitest run src/pages/instance/__tests__/InstancePage.test.tsx` \u2192 **24/24 
passed**.\n\nNew regression test: `keeps the endpoint editable for Apache 
instances but read-only for cloud vendors` \u2014 opens the edit dialog for an 
Apache row (input enabled) and an ALIYUN row (input disabled, still showing the 
catalog endpoint).\n\nFull web suite (`npx vitest run`): 945 tests \u2014 first 
run 945 pa
 ssed with 1 unhandled-error note; second run 944 passed + 1 failed = 
`ConsumerPage > shows group health diagnostics from subscriptions, progress and 
clients` (untouched file; isolated run with this change applied: 1 passed 
\u2192 load flakiness, same file known flaky under parallel load).\n\n`tsc 
--noEmit` clean; `eslint` on both changed files 0 errors/0 warnings; `npm run 
build` \u2713 (8.24s).\n\n## Risk\n\nLow. One `disabled` attribute on a dialog 
input; no API/payload change. The disabled input still submits the existing 
endpoint value (matching the current behavior of resending the unchanged 
endpoint), so nothing changes for the backend.\n"}


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