Silently drop stale route signals (#309)

This commit is contained in:
AAA authored and GitHub committed 2026-08-28 02:06:11 +08:00 Unverified
1 parent bbeb99da38
commit aa3043b905
2 files changed
+13 -5

No files matched your search

-5
View File
@@ -1530,11 +1530,6 @@ export class SignalingServer {
: parentToChild || childToParent;
const authorized = candidateAuthorized ?? assignedEdgeAuthorized;
if (!authorized) {
this.sendError(
sourceSocket,
"FORBIDDEN",
"Signal target is not authorized by the media assignment",
);
return;
}
+13
View File
@@ -920,6 +920,19 @@ describe("WebSocket signaling", () => {
(viewer) => viewer.peerId === relayParentPeerId,
),
).toBe(true);
host.inbox.ignore("route-update");
host.socket.send(
JSON.stringify({
type: "signal",
targetPeerId: relay.peerId,
payload: {
kind: "candidate",
connectionId: "stale_connection_12345678",
candidate: null,
},
}),
);
await host.inbox.expectNone(40);
viewers[2].socket.send(
JSON.stringify({ type: "set-display-name", displayName: "后来改名" }),