fix(relay): require peer catch-up during joins
Catch-up lifecycle events to the newly joined peer are part of the accepted handshake. They seed the peer's view of room membership before the rest of the room can rely on that peer being ready. The gateway-join ordering already sends the current client list to a new gateway before notifying clients that a gateway is available. Make that delivery mandatory: if the relay cannot send the catch-up event stream, clean up the accepted peer and fail the handshake instead of publishing an incompletely seeded gateway. The same required catch-up behavior applies to newly joined clients after their welcome. Existing-peer join/leave notifications remain best effort; a stale existing peer should not prevent the relay from accepting healthy joins. Test Plan: - cargo fmt --check - cargo test -p lanparty-relay - cargo test --workspace - cargo clippy --workspace --all-targets -- -D warnings - git diff --check - git diff --cached --check Refs: MVP lifecycle ordering
This commit is contained in:
@@ -153,11 +153,12 @@ Unknown unicast from a client is forwarded only to the gateway port; unknown
|
||||
unicast from the gateway is dropped instead of flooded to every remote client.
|
||||
When a peer joins or leaves, the relay sends a reliable lifecycle control event
|
||||
to peers that are still present in the room. Newly joined peers also receive
|
||||
`PeerJoined` events for peers that were already present. When a client joins,
|
||||
the relay notifies existing peers before the client receives its welcome, so
|
||||
gateways can seed client MAC state before that client starts sending frames.
|
||||
When a gateway joins, the relay gives the gateway the current client list
|
||||
before notifying clients that the gateway is available.
|
||||
`PeerJoined` events for peers that were already present, and catch-up delivery
|
||||
is part of the accepted handshake rather than a best-effort follow-up. When a
|
||||
client joins, the relay notifies existing peers before the client receives its
|
||||
welcome, so gateways can seed client MAC state before that client starts
|
||||
sending frames. When a gateway joins, the relay gives the gateway the current
|
||||
client list before notifying clients that the gateway is available.
|
||||
|
||||
### MVP Trust Model
|
||||
|
||||
|
||||
Reference in New Issue
Block a user