123123213weqw opened a new pull request, #4466:
URL: https://github.com/apache/rocketmq-dashboard/pull/4466

   ### Which Issue(s) This PR Fixes
   
   - Fixes #4273
   - Fixes #4274
   
   ### Brief Description
   
   Clearing an optional field had no effect. The update replaces every editable 
field of the entry, but MyBatis-Plus `updateById` omits null entity fields, so 
an omitted column silently kept its previous value even though the request 
submitted no value for it:
   
   - **Instance**: a cleared `admin_credential_ref` survived the update. The 
column is now assigned explicitly when the request omits it, next to the 
existing "update was not applied" guard (#4273).
   - **NameServer registry entry**: an omitted `k8s_namespace`, `k8s_id` or 
`description` kept its previous value. The registry update now assigns the 
omitted optional columns explicitly, so the stored entry matches what the 
request asked for (#4274).
   
   This is one functional domain — "an omitted optional field means cleared, 
not unchanged" — so it covers both entry points in one change rather than one 
patch each.
   
   It builds on #4276 and #4277, whose pull requests were closed when 
`rocketmq-studio` was folded into `master` and the base branch was deleted; 
#4276 is folded in here rather than resubmitted on its own. The changes are in 
`save()` and the registry update, not in the search paths, so this does not 
overlap the open LIKE-escaping change (#4458).
   
   `topic remark cannot be cleared` (#4272) is the same class of defect but was 
already fixed by #4275, which is in `master`; it is deliberately not touched 
here.
   
   ### How Did You Test This Change?
   
   ```
   cd server && mvn -B -ntp test
   [INFO] Tests run: 2431, Failures: 0, Errors: 0, Skipped: 0
   ```
   
   The 17 errors reported alongside are the `@SpringBootTest` classes that need 
a reachable MySQL 8 (`StudioApplicationTest`, `HealthProbeIntegrationTest`, 
`AuthService*IntegrationTest`, `RmqAlertStateMapperIntegrationTest`); they fail 
identically on the untouched baseline, and the bundled 
`deploy/docker-compose.yml` MySQL is the intended way to run them.
   
   Test coverage, each with its red/green pair from the original branch:
   
   - `MybatisPlusInstanceRepositoryTest` — an update that clears the admin 
credential reference writes `NULL`; against the unfixed code the stored 
reference survives and the assertion fails.
   - `NameserverRegistryServiceTest` — an update that omits the k8s namespace, 
k8s id and description writes `NULL` for each, and an update that supplies them 
still stores the supplied values.
   
   ### 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, test methods named 
`...Test`
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
— not applicable, no frontend change
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [x] New source files carry the ASF license header — no new source files
   - [x] Documentation touched where behaviour changed — none of these 
behaviours is documented
   


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