@mega-yfue/eufy-sdk 0.5.0-beta.24 → 0.5.0-beta.25

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/dist/index.js CHANGED
@@ -23514,8 +23514,8 @@ var RtcSession = class extends EventEmitter9 {
23514
23514
  this.announceClose();
23515
23515
  });
23516
23516
  this.signaling.on("error", (e) => this.emit("error", e));
23517
- this.peer.on("iceCandidate", (c) => this.signaling.sendInfoCandidate(toWireCandidate(c)));
23518
- this.peer.on("iceGatheringComplete", () => this.signaling.sendInfoCandidate(""));
23517
+ this.peer.on("iceCandidate", (c) => this.trickle(toWireCandidate(c)));
23518
+ this.peer.on("iceGatheringComplete", () => this.trickle(""));
23519
23519
  this.peer.on("commandChannelOpen", () => {
23520
23520
  if (this.connected)
23521
23521
  return;
@@ -23581,6 +23581,16 @@ var RtcSession = class extends EventEmitter9 {
23581
23581
  this.settleAuth(new Error("RTC session closed while waiting for signalling auth"));
23582
23582
  this.announceClose();
23583
23583
  }
23584
+ /**
23585
+ * Trickle one local candidate, or the empty end-of-candidates. The native peer can report one after the
23586
+ * signalling socket has closed, and sending then throws inside a native callback, where the throw can't
23587
+ * be caught and aborts the process. A candidate with no open socket is dropped.
23588
+ */
23589
+ trickle(candidate) {
23590
+ if (!this.signaling.isOpen)
23591
+ return;
23592
+ this.signaling.sendInfoCandidate(candidate);
23593
+ }
23584
23594
  announceClose() {
23585
23595
  if (this.closeAnnounced)
23586
23596
  return;