Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: [VideoConference] If the caller loses connection, direct calls are never canceled #26099

Merged
merged 1 commit into from
Jul 1, 2022
Merged
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
15 changes: 15 additions & 0 deletions apps/meteor/server/services/video-conference/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,21 @@ export class VideoConfService extends ServiceClassInternal implements IVideoConf
const messageId = await this.createDirectCallMessage(call, user);
VideoConferenceModel.setMessageById(callId, 'started', messageId);

// After 40 seconds if the status is still "calling", we cancel the call automatically.
setTimeout(async () => {
try {
const call = await VideoConferenceModel.findOneById<Pick<VideoConference, '_id' | 'status'>>(callId, { projection: { status: 1 } });

if (call?.status !== VideoConferenceStatus.CALLING) {
return;
}

await this.cancel(user._id, callId);
} catch {
// Ignore errors on this timeout
}
}, 40000);

return {
type: 'direct',
callId,
Expand Down