chennaji9 opened a new pull request, #5212:
URL: https://github.com/apache/rocketmq-dashboard/pull/5212
### Which Issue(s) This PR Fixes
None — small self-contained fix found by inspection (no issue tracked).
### Brief Description
`GeneralSettingsTab.loadFreshSettings` swallowed a failed fresh read of the
settings record and returned the mount-time snapshot, so a save continued with
a stale full-record payload and could overwrite fields another tab had just
persisted — the exact outcome the code comment above it promises to prevent
("every save must be built from a fresh read"). The fresh read failure now
propagates: `persistPreference`/`mergeAndSave` catch it and surface the
existing save-failed toast, and no write is sent.
Base is `rocketmq-studio` per CONTRIBUTING.md (the PR template's base
comment is outdated).
### How Did You Test This Change?
`cd web && npx vitest run
src/pages/settings/__tests__/GeneralSettingsTab.test.tsx` — 8/8 pass, including
the new `aborts the save when the fresh settings read fails` (initial load OK,
second `getGeneralSettings` rejects → `saveGeneralSettings` never called,
save-failed toast shown) and the existing success-path regression `saves llm
fields from a fresh read instead of the mount-time snapshot`. `npm run lint` —
0 errors. A capped-worker full `vitest run --maxWorkers=6` also ran 144 files /
1353 tests green on this branch (one unrelated worker start-up flake
re-verified green standalone).
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits (`fix:`)
- [x] Tests added or updated for non-trivial changes
- [x] New UI text has both Chinese and English entries under `web/src/i18n/`
(n/a — reuses existing toast keys)
- [x] Architecture constraints stay green (n/a — no Java change)
- [x] New source files carry the ASF license header (n/a — no new source
file)
- [x] Documentation touched where behaviour changed (function comment
updated)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]