Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/curly-worms-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

fix: OTR session closing after 10 seconds without warning
8 changes: 8 additions & 0 deletions apps/meteor/app/otr/client/OTRRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,17 @@ export class OTRRoom implements IOTRRoom {
this.reset();
await establishConnection();
} else {
/* We have to check if there's an in progress handshake request because
Notifications.notifyUser will sometimes dispatch 2 events */
if (this.getState() === OtrRoomState.REQUESTED) {
return;
}

if (this.getState() === OtrRoomState.ESTABLISHED) {
this.reset();
}

this.setState(OtrRoomState.REQUESTED);
imperativeModal.open({
component: GenericModal,
props: {
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/app/otr/lib/OtrRoomState.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export enum OtrRoomState {
DISABLED = 'DISABLED',
NOT_STARTED = 'NOT_STARTED',
REQUESTED = 'REQUESTED',
ESTABLISHING = 'ESTABLISHING',
ESTABLISHED = 'ESTABLISHED',
ERROR = 'ERROR',
Expand Down