fix(admin): keep the namespace id in the proxy selector listAllData response - #7387
Open
Sean-Walker0 wants to merge 1 commit into
Open
Sean-Walker0 wants to merge 1 commit into
Sean-Walker0 wants to merge 1 commit into
Conversation
…esponse ProxySelectorServiceImpl#listAllData builds ProxySelectorVO from every ProxySelectorDO but, unlike its sibling listByPage (which sets vo.setNamespaceId(proxySelectorDO.getNamespaceId()) a few lines above), it never copies the namespace id, so the list-all API returns proxy selectors whose namespaceId is always null even though the rows are namespaced. The new test pins the round trip and fails on current master with expected <ns-1> but was <null>. Verified with ./mvnw test -pl shenyu-admin -am and ./mvnw checkstyle:check -pl shenyu-admin (module-scoped).
Aias00
approved these changes
Oct 1, 2026
Aias00
left a comment
Contributor
There was a problem hiding this comment.
ProxySelectorServiceImpl#listAllData builds its VO without copying the namespace id while its sibling listByPage in the same file does — a clear inconsistency, and the one-line fix plus the regression test is exactly right. The red e2e / e2e-logging-rocketmq jobs are the known flakes and unrelated to an admin transfer fix. Approving.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by code audit (no existing issue; happy to file one if maintainers prefer).
ProxySelectorServiceImpl#listAllDatabuilds aProxySelectorVOfrom everyProxySelectorDObut never copies the namespace id, while its siblinglistByPagein the same file does (vo.setNamespaceId(proxySelectorDO.getNamespaceId())). The list-all response therefore reportsnamespaceId: nullfor every proxy selector even though the rows are namespaced.The same read-path field drop was fixed for
MetaDataTransferwrite paths in #7324; this is the proxy-selector variant.Make sure that:
./mvnw test -pl shenyu-admin -amand./mvnw checkstyle:check -pl shenyu-admin(module-scoped; full build left to CI).Modifications
listAllDatanow setsvo.setNamespaceId(proxySelectorDO.getNamespaceId()), mirroringlistByPage.Verifying this change
ProxySelectorServiceTest#testListAllDataKeepsNamespaceIdbuilds a DO withnamespaceId=ns-1, callslistAllData, and asserts the VO carries it. Fails on current master withexpected: <ns-1> but was: <null>, passes with this change.Notes
namespaceIdinstead ofnull.DiscoveryDTOembedded in the same response is produced byDiscoveryTransfer#mapToDTO(DiscoveryDO), which also dropsnamespaceId— addressed separately to keep this PR single-purpose.ProxySelectorServiceImpl(verified via keyword search and per-PR file audit).