Skip to content

Commit

Permalink
Add leave req full reconnect simulation scenario (#1137)
Browse files Browse the repository at this point in the history
* add leave req full reconnect simulation scenario

* add scenario to sample

* Create mighty-drinks-film.md
  • Loading branch information
lukasIO authored May 13, 2024
1 parent 55afc67 commit f6e9d6a
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/mighty-drinks-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-client": patch
---

Add leave req full reconnect simulation scenario
1 change: 1 addition & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ <h2>Livekit Sample App</h2>
<option value="force-tls">Force TURN/TLS</option>
<option value="subscribe-all">Subscribe all</option>
<option value="unsubscribe-all">Unsubscribe all</option>
<option value="leave-full-reconnect">Leave Request Full Reconnect</option>
</select>
<button
id="disconnect-room-button"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"size-limit": "size-limit"
},
"dependencies": {
"@livekit/protocol": "1.15.0",
"@livekit/protocol": "1.16.0",
"events": "^3.3.0",
"loglevel": "^1.8.0",
"sdp-transform": "^2.14.1",
Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/room/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,13 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
},
});
break;

case 'leave-full-reconnect':
req = new SimulateScenario({
scenario: {
case: 'leaveRequestFullReconnect',
value: true,
},
});
default:
}
if (req) {
Expand Down
4 changes: 3 additions & 1 deletion src/room/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export type SimulationScenario =
// to disable congestion control entirely (by setting bandwidth to 100Mbps)
| 'subscriber-bandwidth'
| 'disconnect-signal-on-resume'
| 'disconnect-signal-on-resume-no-messages';
| 'disconnect-signal-on-resume-no-messages'
// instructs the server to send a full reconnect reconnect action to the client
| 'leave-full-reconnect';

export type LoggerOptions = {
loggerName?: string;
Expand Down

0 comments on commit f6e9d6a

Please sign in to comment.