spreed icon indicating copy to clipboard operation
spreed copied to clipboard

Media capture is not stopped when failing to leave a call

Open danxuliu opened this issue 4 years ago • 8 comments

Although the specific steps below are a regression introduced in Talk 9 with the handling of conflicts between sessions the issue is unrelated to that. It could be tested too by forcing errors when leaving a call by adding return new DataResponse([], Http::STATUS_NOT_FOUND); to CallController::leaveCall

How to test

  • Use the external signaling server
  • Open the Files app
  • Share two files
  • Refresh (due to the bug in the Files app that causes the FileInfo to not be updated)
  • Open the sidebar for the first shared file
  • Open the Chat tab
  • Join the conversation
  • Start a call
  • Open the sidebar for the second shared file (without leaving the call first)

Expected result

The browser stops audio and video capture.

Actual result

The browser is still capturing audio and video, even if the UI no longer shows the call.

danxuliu avatar Nov 09 '20 21:11 danxuliu

Not sure if related but something that happened to me once or twice was when leaving the company call the UI showed as if I had left but I could still hear people talking, so it "failed to leave" somehow. Next time it happens I'll open the debugger...

PVince81 avatar Nov 10 '20 08:11 PVince81

the UI showed as if I had left but I could still hear people talking, so it "failed to leave" somehow.

Note that you may have successfully left too. It could have been that your audio buffers had accumulated some latency so they were still playing by PulseAudio (not the browser), or that the UI was updated before the WebRTC connections were fully closed.

danxuliu avatar Nov 10 '20 08:11 danxuliu

Not sure if it was the buffers because the audio really lasted many more seconds until I hit page refresh. I'll keep an eye on this.

In any case, if it's the WebRTC connection still being there, we should sync up the UI to that somehow...

PVince81 avatar Nov 10 '20 08:11 PVince81

I had a similar case just now in a 1-1 call with no file sharing involved. image

I refreshed too quickly and missed the opportunity to look at the network console.

Nevertheless, we should catch that error and keep the call view visible so that users don't think that the call is done. Not sure what the server side state is and whether we need to retry or whether it will time out.

If we are confident that it will time out anyway we could also close the camera/audio as if it had succeeded.

PVince81 avatar Nov 25 '20 15:11 PVince81

The browser is still capturing audio and video, even if the UI no longer shows the call.

@danxuliu should we maybe as a hardening measure call the "leaving call" code path whenever the CallView is getting destroyed ? This way we don't need to think about all cases where that view might be disappearing.

PVince81 avatar Feb 04 '21 12:02 PVince81

Mmm, that might have some undesirable side effect, as the call view sometimes gets destroyed and recreated while in a call. For example, in those cases in which there is a bit of lag of the status received from the server when starting a call and the chat view briefly appears again.

danxuliu avatar Feb 08 '21 06:02 danxuliu

Then setTimeout(() => {}, 90000) to stop it after 90sec of not using?

nickvergessen avatar Feb 09 '21 14:02 nickvergessen

I found other scenarios where the camera is not ungrabbed after being kicked out as participant:

  • lock a conversation as moderator to kick out other participants
  • delete a conversation as moderator during a call to kick out other participants

There might be more. These are consistently reproducible.

Let me know if related at all with this ticket or requires a different one. @danxuliu

PVince81 avatar Mar 02 '21 11:03 PVince81

Just a question, is this still a thing, or can we close it?

nickvergessen avatar Sep 16 '22 14:09 nickvergessen

The original issue as well as the scenario mentioned by Vincent about locking a conversation are no longer reproducible (they were probably fixed by #7799).

The scenario about deleting a conversation is still reproducible for guests when using the HPB; I have opened a specific issue for that here: #7962

danxuliu avatar Sep 20 '22 15:09 danxuliu