@mega-yfue/eufy-sdk 0.5.0-beta.23 → 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
@@ -23015,7 +23015,7 @@ async function loadNativePeerFactory() {
23015
23015
  try {
23016
23016
  ndc = await import("node-datachannel");
23017
23017
  } catch (err) {
23018
- const message = UNBUILT_ARCHES.has(process.arch) ? `the WebRTC transport for a HomeBase S1 Pro (T9000) needs 'node-datachannel', which has no build for ${process.arch}; a 64-bit OS is needed to drive a T9000` : "the WebRTC transport for a HomeBase S1 Pro (T9000) needs the optional peer dependency 'node-datachannel' (`npm install node-datachannel`)";
23018
+ const message = UNBUILT_ARCHES.has(process.arch) ? `the WebRTC transport for a HomeBase S1 Pro (T9000) needs 'node-datachannel', which has no build for ${process.arch}; a 64-bit OS is needed to drive a T9000` : "the WebRTC transport for a HomeBase S1 Pro (T9000) could not load 'node-datachannel'";
23019
23019
  throw new Error(message, { cause: err });
23020
23020
  }
23021
23021
  return (name, config) => new ndc.PeerConnection(name, config);
@@ -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;