mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-10 10:53:24 +00:00
fix: Clear answer creation timeout before ICE gathering
The timeout for creating an answer was incorrectly including the ICE gathering process, causing the answerer to fail when ICE gathering took close to the timeout duration. Now the timeout is cleared immediately after createAnswer() completes, and ICE gathering relies on its own separate timeout. Fixes connection failures where answerer would timeout even though the answer was created successfully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xtr-dev/rondevu-client",
|
"name": "@xtr-dev/rondevu-client",
|
||||||
"version": "0.5.0",
|
"version": "0.5.1",
|
||||||
"description": "TypeScript client for Rondevu topic-based peer discovery and signaling server",
|
"description": "TypeScript client for Rondevu topic-based peer discovery and signaling server",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
|||||||
@@ -330,6 +330,12 @@ class AnsweringState extends PeerState {
|
|||||||
const answer = await this.peer.pc.createAnswer();
|
const answer = await this.peer.pc.createAnswer();
|
||||||
await this.peer.pc.setLocalDescription(answer);
|
await this.peer.pc.setLocalDescription(answer);
|
||||||
|
|
||||||
|
// Clear the answer creation timeout - ICE gathering has its own timeout
|
||||||
|
if (this.timeout) {
|
||||||
|
clearTimeout(this.timeout);
|
||||||
|
this.timeout = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
// Wait for ICE gathering
|
// Wait for ICE gathering
|
||||||
const iceTimeout = options.timeouts?.iceGathering || 10000;
|
const iceTimeout = options.timeouts?.iceGathering || 10000;
|
||||||
await this.waitForIceGathering(iceTimeout);
|
await this.waitForIceGathering(iceTimeout);
|
||||||
@@ -357,8 +363,6 @@ class AnsweringState extends PeerState {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.timeout) clearTimeout(this.timeout);
|
|
||||||
|
|
||||||
// Transition to exchanging ICE
|
// Transition to exchanging ICE
|
||||||
this.peer.setState(new ExchangingIceState(this.peer, offerId, options));
|
this.peer.setState(new ExchangingIceState(this.peer, offerId, options));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user