Skip to content

Commit 6af4730

Browse files
committed
resetState is actually only used internally
1 parent 31c5cfd commit 6af4730

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

src/matrixrtc/NewMembershipManager.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ export class MembershipManager implements IMembershipManager {
168168
this.focusActive = focusActive;
169169
this.leavePromiseDefer = undefined;
170170
if (!this.scheduler.state.running) {
171-
this.scheduler.resetState();
172171
this.scheduler.state.running = true;
173172
this.scheduler.startWithJoin().catch((e) => {
174173
// Set the rtc session to left state since we cannot recover from here and the consumer user of the

src/matrixrtc/NewMembershipManagerActionScheduler.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export class ActionScheduler {
116116
* In most other error cases the manager will try to handle any server errors by itself.
117117
*/
118118
public async startWithJoin(): Promise<void> {
119+
this.state = ActionScheduler.defaultState;
119120
this._actions = [{ ts: Date.now(), type: MembershipActionType.SendFirstDelayedEvent }];
120121

121122
while (this._actions.length > 0) {
@@ -178,10 +179,6 @@ export class ActionScheduler {
178179
this.wakeup?.({ replace: [{ ts: Date.now(), type: MembershipActionType.SendScheduledDelayedLeaveEvent }] });
179180
}
180181

181-
public resetState(): void {
182-
this.state = ActionScheduler.defaultState;
183-
}
184-
185182
public resetRateLimitCounter(type: MembershipActionType): void {
186183
this.state.rateLimitRetries.set(type, 0);
187184
this.state.networkErrorRetries.set(type, 0);

0 commit comments

Comments
 (0)