@voicethere/client 0.7.2 → 0.7.3
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## 0.7.3 — 2026-07-07
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **`waitForIceGatheringComplete` on Node** — fall back to `onicegatheringstatechange` when `RTCPeerConnection.addEventListener` is unavailable (`@node-webrtc-rust/sdk`), fixing headless E2E load tests that use `@voicethere/client/node`.
|
|
10
|
+
|
|
5
11
|
## 0.7.2 — 2026-07-07
|
|
6
12
|
|
|
7
13
|
### Fixed
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Wait until ICE gathering completes so localDescription includes relay candidates.
|
|
3
3
|
* Matches {@link @node-webrtc-rust/signaling} auto-negotiate and VoiceAgentSessionHost.
|
|
4
|
+
*
|
|
5
|
+
* Browser RTCPeerConnection implements EventTarget; Node (@node-webrtc-rust/sdk) uses
|
|
6
|
+
* `onicegatheringstatechange` only — chain any existing handler when falling back.
|
|
4
7
|
*/
|
|
5
8
|
export declare function waitForIceGatheringComplete(pc: RTCPeerConnection, timeoutMs?: number): Promise<void>;
|
|
6
9
|
//# sourceMappingURL=wait-for-ice-gathering.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait-for-ice-gathering.d.ts","sourceRoot":"","sources":["../../src/browser/wait-for-ice-gathering.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wait-for-ice-gathering.d.ts","sourceRoot":"","sources":["../../src/browser/wait-for-ice-gathering.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,EAAE,EAAE,iBAAiB,EACrB,SAAS,SAAS,GACjB,OAAO,CAAC,IAAI,CAAC,CAuBf"}
|
|
@@ -1,24 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Wait until ICE gathering completes so localDescription includes relay candidates.
|
|
3
3
|
* Matches {@link @node-webrtc-rust/signaling} auto-negotiate and VoiceAgentSessionHost.
|
|
4
|
+
*
|
|
5
|
+
* Browser RTCPeerConnection implements EventTarget; Node (@node-webrtc-rust/sdk) uses
|
|
6
|
+
* `onicegatheringstatechange` only — chain any existing handler when falling back.
|
|
4
7
|
*/
|
|
5
8
|
export function waitForIceGatheringComplete(pc, timeoutMs = 30_000) {
|
|
6
9
|
if (pc.iceGatheringState === "complete") {
|
|
7
10
|
return Promise.resolve();
|
|
8
11
|
}
|
|
9
12
|
return new Promise((resolve, reject) => {
|
|
13
|
+
let unsubscribe;
|
|
10
14
|
const timer = setTimeout(() => {
|
|
11
|
-
|
|
15
|
+
unsubscribe?.();
|
|
12
16
|
reject(new Error(`ICE gathering timeout after ${timeoutMs}ms`));
|
|
13
17
|
}, timeoutMs);
|
|
14
18
|
const onChange = () => {
|
|
15
19
|
if (pc.iceGatheringState !== "complete")
|
|
16
20
|
return;
|
|
17
21
|
clearTimeout(timer);
|
|
18
|
-
|
|
22
|
+
unsubscribe?.();
|
|
19
23
|
resolve();
|
|
20
24
|
};
|
|
21
|
-
pc
|
|
25
|
+
unsubscribe = subscribeIceGatheringStateChange(pc, onChange);
|
|
26
|
+
onChange();
|
|
22
27
|
});
|
|
23
28
|
}
|
|
29
|
+
function subscribeIceGatheringStateChange(pc, handler) {
|
|
30
|
+
if (typeof pc.addEventListener === "function") {
|
|
31
|
+
pc.addEventListener("icegatheringstatechange", handler);
|
|
32
|
+
return () => pc.removeEventListener("icegatheringstatechange", handler);
|
|
33
|
+
}
|
|
34
|
+
const previous = pc.onicegatheringstatechange;
|
|
35
|
+
const wrapped = (event) => {
|
|
36
|
+
previous?.call(pc, event);
|
|
37
|
+
handler();
|
|
38
|
+
};
|
|
39
|
+
pc.onicegatheringstatechange = wrapped;
|
|
40
|
+
return () => {
|
|
41
|
+
if (pc.onicegatheringstatechange === wrapped) {
|
|
42
|
+
pc.onicegatheringstatechange = previous;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
24
46
|
//# sourceMappingURL=wait-for-ice-gathering.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait-for-ice-gathering.js","sourceRoot":"","sources":["../../src/browser/wait-for-ice-gathering.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wait-for-ice-gathering.js","sourceRoot":"","sources":["../../src/browser/wait-for-ice-gathering.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CACzC,EAAqB,EACrB,SAAS,GAAG,MAAM;IAElB,IAAI,EAAE,CAAC,iBAAiB,KAAK,UAAU,EAAE,CAAC;QACxC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,WAAqC,CAAC;QAE1C,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,WAAW,EAAE,EAAE,CAAC;YAChB,MAAM,CAAC,IAAI,KAAK,CAAC,+BAA+B,SAAS,IAAI,CAAC,CAAC,CAAC;QAClE,CAAC,EAAE,SAAS,CAAC,CAAC;QAEd,MAAM,QAAQ,GAAG,GAAG,EAAE;YACpB,IAAI,EAAE,CAAC,iBAAiB,KAAK,UAAU;gBAAE,OAAO;YAChD,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,WAAW,EAAE,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;QAEF,WAAW,GAAG,gCAAgC,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC7D,QAAQ,EAAE,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,gCAAgC,CACvC,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