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:
@@ -330,6 +330,12 @@ class AnsweringState extends PeerState {
|
||||
const answer = await this.peer.pc.createAnswer();
|
||||
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
|
||||
const iceTimeout = options.timeouts?.iceGathering || 10000;
|
||||
await this.waitForIceGathering(iceTimeout);
|
||||
@@ -357,8 +363,6 @@ class AnsweringState extends PeerState {
|
||||
}
|
||||
};
|
||||
|
||||
if (this.timeout) clearTimeout(this.timeout);
|
||||
|
||||
// Transition to exchanging ICE
|
||||
this.peer.setState(new ExchangingIceState(this.peer, offerId, options));
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user