uniwrtc 1.9.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/main.js +5 -0
package/package.json
CHANGED
package/src/main.js
CHANGED
|
@@ -711,6 +711,11 @@ async function connectNostr() {
|
|
|
711
711
|
log(`Ignoring non-answer in signal-answer from ${peerId.substring(0, 6)}...`, 'warning');
|
|
712
712
|
return;
|
|
713
713
|
}
|
|
714
|
+
// Perfect negotiation guard: only accept an answer when we have a local offer
|
|
715
|
+
if (pc.signalingState !== 'have-local-offer') {
|
|
716
|
+
log(`Ignoring answer; unexpected signaling state: ${pc.signalingState}`, 'warning');
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
714
719
|
await pc.setRemoteDescription(new RTCSessionDescription(payload.sdp));
|
|
715
720
|
await flushPendingIce(peerId);
|
|
716
721
|
}
|