Skip to content

Commit eb99bcd

Browse files
authored
fix(client-loader): recognize early local signals (#25778)
Use signal audience to correctly classify pre-Connected, local signals as local.
1 parent 71f45ff commit eb99bcd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/loader/container-loader/src/container.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2417,7 +2417,15 @@ export class Container
24172417
if (protocolHandlerShouldProcessSignal(message)) {
24182418
this.protocolHandler.processSignal(message);
24192419
} else {
2420-
const local = this.clientId === message.clientId;
2420+
const local =
2421+
// Check against signal audience to detect current signals
2422+
// including very early signals before reaching "Connected".
2423+
message.clientId === this.signalAudience.getSelf()?.clientId ||
2424+
// and use "regular" audience to detect signals from past
2425+
// connection bouncing slowly back from service. This may never
2426+
// happen, but is kept as it was used historically as the only
2427+
// check.
2428+
message.clientId === this.clientId;
24212429
this.runtime.processSignal(message, local);
24222430
}
24232431
}

0 commit comments

Comments
 (0)