lll-peanut opened a new pull request, #6534:
URL: https://github.com/apache/shenyu/pull/6534

   Fixes #6517
   
   ## What's changed
     - ProxySelectorServiceImpl.update no longer calls
       `discoveryUpstreams.forEach(...)` when the list is null/omitted.
     - The delete-and-reinsert of discovery upstreams (and its log statement) is
       now guarded by a non-empty check, consistent with the create path
       (`addUpstreamList`). A null/empty list means upstreams are left 
untouched.
   
     ## Why
     `discoveryUpstreams` is optional in ProxySelectorAddDTO, but the update 
path
     deleted existing upstream rows and then iterated the request list without a
     null check, throwing NullPointerException and returning a server error
     instead of a consistent result.
   
     ## Tests
     - Added ProxySelectorServiceTest.testUpdateWithNullDiscoveryUpstreams:
       update with null discoveryUpstreams must succeed and must not call
       deleteByDiscoveryHandlerId. It failed with
       `NullPointerException: ... getDiscoveryUpstreams() is null` before the 
fix.
     - `mvn -pl shenyu-admin test -Dtest=ProxySelectorServiceTest` → 6 tests 
passed.
   
     ## Manual verification
     - Create a proxy selector with one upstream, then PUT /proxy-selector/{id}
       with the JSON body omitting discoveryUpstreams.
     - Before fix: HTTP 500 + NPE in admin log.
     - After fix: HTTP 200 "update success", existing upstreams are preserved.
   
   
   Make sure that:
   
   - [X] You have read the [contribution 
guidelines](https://shenyu.apache.org/community/contributor-guide).
   - [X] You submit test cases (unit or integration tests) that back your 
changes.
   - [X] Your local test passed `./mvnw clean install 
-Dmaven.javadoc.skip=true`.
   


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