element-hq / element-hq/element-web
Starting a new call ends in a race where either: the new call wont be sticky, or: both calls will be disconnected.
- Dominant language
- TypeScript
- Stars
- 13.5k
- Forks
- 2.8k
- PR merge metrics
- PR metrics pending
Description
Currently this is solved with the workaround that the user does not even get the option to start a new call if there is a running one.
But in the future it would be nice if starting a new call would first disconnect the old call and then connect the new one.
All the requirements are in place:
The new call needs to wait until it can become sticky -> since there is always only one widget that can be sticky, we would kill the running widget by making the new one sticky. This is solved by a stickyPromise that needs to resolve before we can connect the new call.
It seems the issue is, that if a call is hung up the roomview [will dispatch an action](https://github.com/matrix-org/matrix-react-sdk/blob/479b4b3ff4e5421e3bfa49bba17bdefdfde5e022/src/components/structures/RoomView.tsx#L826) with view_call = false this action will kill the newly started call...
The logic is correct: only dispatch with view_call = false if there is no active call. But due to a potential race there seems to be no active call even though there should be. Maybe checking CallStore.instance.getCall could reveal if there is another call and one should not dispatch view_call = false
Contributor guide
Assessment
This issue has not been assessed yet.