Aias00 opened a new issue, #7314:
URL: https://github.com/apache/shenyu/issues/7314

   ## Current Behavior
   
   Every method in `WebsocketDataChangedListener` receives a list of changed 
records, builds one message containing the entire list, takes the namespace 
only from the first record, and sends that message only to sessions registered 
for that namespace.
   
   If a batch contains records from multiple namespaces:
   
   - sessions for the first namespace receive records belonging to other 
namespaces;
   - sessions for the remaining namespaces receive nothing;
   - configuration can be leaked across namespace boundaries;
   - affected gateways remain stale until a full reload.
   
   The same first-element namespace assumption also appears in common 
data-change listener cache refresh code.
   
   ## Reproduction
   
   - Register one WebSocket session for namespace A and one for namespace B.
   - Call each applicable listener with a batch containing one A record and one 
B record.
   - Verify the current implementation sends the combined payload only to A 
when the A record is first.
   - Reverse the input order and verify the wrong target changes with list 
order.
   
   ## Expected Behavior
   
   Each namespace must receive only the records belonging to that namespace, 
independent of input order.
   
   ## Scope
   
   - Partition every changed-data batch by effective namespace before 
constructing the WebSocket payload.
   - Apply the default namespace only to records with no namespace according to 
the existing compatibility rule.
   - Reject or explicitly handle null records.
   - Ensure plugin, selector, rule, auth, metadata, proxy selector, discovery 
upstream, and AI API-key groups follow the same behavior.
   - Review other `DataChangedListener` implementations for the same 
first-element assumption.
   - Add per-namespace delivery counts and safe logs without exposing secrets.
   
   ## Acceptance Criteria
   
   - [ ] Mixed-namespace batches are split into independent messages.
   - [ ] Namespace A never receives namespace B records, and vice versa.
   - [ ] Delivery is independent of record order.
   - [ ] Null/default namespace behavior is explicitly tested.
   - [ ] All supported configuration groups have mixed-namespace tests.
   - [ ] Single-namespace event behavior remains backward compatible.
   - [ ] Multi-namespace WebSocket E2E verifies cache isolation.
   
   


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