@xtr-dev/rondevu-client 0.18.3 → 0.18.5
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/rondevu.d.ts +1 -1
- package/dist/rondevu.js +17 -9
- package/package.json +3 -3
package/dist/rondevu.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RondevuAPI, Keypair, IceCandidate, BatcherOptions } from './api.js';
|
|
2
2
|
import { CryptoAdapter } from './crypto-adapter.js';
|
|
3
|
-
import { EventEmitter } from '
|
|
3
|
+
import { EventEmitter } from 'eventemitter3';
|
|
4
4
|
export type IceServerPreset = 'ipv4-turn' | 'hostname-turns' | 'google-stun' | 'relay-only';
|
|
5
5
|
export declare const ICE_SERVER_PRESETS: Record<IceServerPreset, RTCIceServer[]>;
|
|
6
6
|
export interface RondevuOptions {
|
package/dist/rondevu.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RondevuAPI } from './api.js';
|
|
2
|
-
import { EventEmitter } from '
|
|
2
|
+
import { EventEmitter } from 'eventemitter3';
|
|
3
3
|
// ICE server presets
|
|
4
4
|
export const ICE_SERVER_PRESETS = {
|
|
5
5
|
'ipv4-turn': [
|
|
@@ -470,15 +470,23 @@ export class Rondevu extends EventEmitter {
|
|
|
470
470
|
const activeOffer = this.activeOffers.get(answer.offerId);
|
|
471
471
|
if (activeOffer && !activeOffer.answered) {
|
|
472
472
|
this.debug(`Received answer for offer ${answer.offerId}`);
|
|
473
|
-
|
|
474
|
-
type: 'answer',
|
|
475
|
-
sdp: answer.sdp
|
|
476
|
-
});
|
|
473
|
+
// Mark as answered BEFORE setRemoteDescription to prevent race condition
|
|
477
474
|
activeOffer.answered = true;
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
475
|
+
try {
|
|
476
|
+
await activeOffer.pc.setRemoteDescription({
|
|
477
|
+
type: 'answer',
|
|
478
|
+
sdp: answer.sdp
|
|
479
|
+
});
|
|
480
|
+
this.lastPollTimestamp = answer.answeredAt;
|
|
481
|
+
this.emit('offer:answered', answer.offerId, answer.answererId);
|
|
482
|
+
// Create replacement offer
|
|
483
|
+
this.fillOffers();
|
|
484
|
+
}
|
|
485
|
+
catch (err) {
|
|
486
|
+
// If setRemoteDescription fails, reset the answered flag
|
|
487
|
+
activeOffer.answered = false;
|
|
488
|
+
throw err;
|
|
489
|
+
}
|
|
482
490
|
}
|
|
483
491
|
}
|
|
484
492
|
// Process ICE candidates
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xtr-dev/rondevu-client",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.5",
|
|
4
4
|
"description": "TypeScript client for Rondevu with durable WebRTC connections, automatic reconnection, and message queuing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@eslint/js": "^9.39.1",
|
|
28
|
-
"@types/node": "^25.0.2",
|
|
29
28
|
"@typescript-eslint/eslint-plugin": "^8.48.1",
|
|
30
29
|
"@typescript-eslint/parser": "^8.48.1",
|
|
31
30
|
"eslint": "^9.39.1",
|
|
@@ -42,6 +41,7 @@
|
|
|
42
41
|
"README.md"
|
|
43
42
|
],
|
|
44
43
|
"dependencies": {
|
|
45
|
-
"@noble/ed25519": "^3.0.0"
|
|
44
|
+
"@noble/ed25519": "^3.0.0",
|
|
45
|
+
"eventemitter3": "^5.0.1"
|
|
46
46
|
}
|
|
47
47
|
}
|