feat(user-session): record satellite capability bitmap on slot (VS-13) #16

Merged
David merged 2 commits from feat/user-capability-metadata-vs-13 into main 2026-05-17 14:37:21 +02:00
Owner

Summary

Resolves the (TODO) at crates/meshcentral-web/src/user_session.rs:10142. The satellite control action's setFlags advertisement is now stored per session slot, and satellite responses are routed to matching slots instead of broadcasting.

Changes

  • UserSessionRegistry::Slot grows a satellite_flags: u32.
  • SessionGuard::set_satellite_flags(flags) updates the calling slot.
  • UserSessionRegistry::push_to_satellite_match(flags, frame) fan-outs only to slots whose bitmap intersects the request.
  • dispatch threads the live SessionGuard into handle_satellite.
  • Two new unit tests cover the match path and the zero-flag short-circuit.

Test plan

  • cargo test -p meshcentral-web --lib user_session_registry (7/7 passing).
  • cargo check -p meshcentral-web clean.
  • Reviewer: confirm the SPA's AMT manager still filters on satelliteFlags (the response shape did not change, so client-side filtering still works; the targeting just got tighter).

Closes VS-13.

## Summary Resolves the `(TODO)` at `crates/meshcentral-web/src/user_session.rs:10142`. The `satellite` control action's `setFlags` advertisement is now stored per session slot, and `satellite` responses are routed to matching slots instead of broadcasting. ## Changes - `UserSessionRegistry::Slot` grows a `satellite_flags: u32`. - `SessionGuard::set_satellite_flags(flags)` updates the calling slot. - `UserSessionRegistry::push_to_satellite_match(flags, frame)` fan-outs only to slots whose bitmap intersects the request. - `dispatch` threads the live `SessionGuard` into `handle_satellite`. - Two new unit tests cover the match path and the zero-flag short-circuit. ## Test plan - [x] `cargo test -p meshcentral-web --lib user_session_registry` (7/7 passing). - [x] `cargo check -p meshcentral-web` clean. - [ ] Reviewer: confirm the SPA's AMT manager still filters on `satelliteFlags` (the response shape did not change, so client-side filtering still works; the targeting just got tighter). Closes VS-13.
feat(user-session): record satellite capability bitmap on slot (VS-13)
Some checks failed
Check / fmt + clippy + build + tests (pull_request) Failing after 3s
b1f783878b
The `satellite` control action's `setFlags` branch was a no-op TODO at `user_session.rs:10142`: the per-session registry had no place to hang the capability bitmap, so the AMT manager fan-out broadcast to every connected session and the SPA filtered client-side.

Adds a `satellite_flags: u32` field to each `Slot`, an `UserSessionRegistry::push_to_satellite_match(flags, frame)` helper that delivers only to slots whose bitmap intersects the request, and a `SessionGuard::set_satellite_flags(flags)` setter the dispatcher invokes on `setFlags`. `handle_satellite` now records the bitmap and routes responses via `push_to_satellite_match` instead of `broadcast`, so sessions that never advertised a satellite role no longer see (and drop) every satellite response frame.

Backward compatible on the wire: the response shape is unchanged; only the fan-out targeting tightens. Two new unit tests cover the match and the zero-flag short-circuit.

#VS-13 State Done
Merge branch 'main' into feat/user-capability-metadata-vs-13
Some checks failed
Check / fmt + clippy + build + tests (pull_request) Failing after 3s
Create release / Create release from merged PR (pull_request) Has been skipped
9a500e15b1
David merged commit 31e93e96de into main 2026-05-17 14:37:21 +02:00
David deleted branch feat/user-capability-metadata-vs-13 2026-05-17 14:37:21 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-server!16
No description provided.