Skip to content

fix(call): do not leave the call when rejoining alone in it - #6951

Open
ToteMeiSter wants to merge 1 commit into
nextcloud:masterfrom
ToteMeiSter:pr/call-rejoin-alone-keeps-call-1
Open

ToteMeiSter wants to merge 1 commit into
nextcloud:masterfrom
ToteMeiSter:pr/call-rejoin-alone-keeps-call-1

Conversation

@ToteMeiSter

Copy link
Copy Markdown
Contributor

When the publisher connection fails or the signaling session is renewed, the client leaves the call and joins it again. If the caller is alone in the call (the callee has not answered yet), the leave request makes the server end the call: the callee's ringing stops, the callee gets a missed call, and the next join starts a new call with a new notification.

Changes in CallActivity:

  • otherParticipantWasInCall is set when another session is in the call (handleCallParticipantsChanged). A rejoin does not reset it.
  • shouldLeaveCallOnHangup(...): on a rejoin (RECONNECTING / PUBLISHER_FAILED, the screen stays open) the leave request is skipped until somebody else was in the call. Leaving the screen and "end call for everyone" always send it.
  • isJoinSilent(...): after somebody else was in the call, the join is silent, so a call that the server restarted is not rung again.

Known trade-off: on a rejoin alone, the old session is not left explicitly; the server drops it after the session timeout.

Fixes #6950

🖼️ Screenshots

🏚️ Before 🏡 After
The callee's ringing stops on the caller's rejoin; missed call, then a second ring The callee keeps ringing

🚧 TODO

  • Test on a device with the master build

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

Tests: CallActivityRejoinAloneTest, 4 JVM tests of the pure functions. Without the fix the rejoin-alone test fails.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Trailers of the commit:

Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru>
Assisted-by: Claude Code:claude-sonnet-5-5

🤖 Generated with Claude Code

When the publisher connection fails or the signaling session is
renewed, the call is left and joined again. If the caller is alone in
the call (nobody has answered yet), leaving it makes the server end the
call: the ringing of the callee stops, the callee gets a missed call, and the
next join starts a new call with a new notification.

Remember whether somebody else was in the call and skip the leave
request on a rejoin until then. After somebody else was in the call,
join silently, so a call restarted by the rejoin does not ring again.

Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru>
Assisted-by: Claude Code:claude-sonnet-5-5
@mahibi

mahibi commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Thanks for contributing, we will have a closer look soon

@mahibi

mahibi commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

@ToteMeiSter are you fine if i take over this PR?

In general: Is it okay for you if we just add commits for PRs and maybe take PRs over?

@ToteMeiSter

Copy link
Copy Markdown
Contributor Author

@mahibi Yes, of course, please feel free to take over this PR. In general, you are also very welcome to add commits to my PRs or take them over. Before pushing any further changes to branches you have taken over, I will first ask whether you are happy for me to resume work on them.

It would also be helpful to know where we could discuss proposed changes in advance, including rough edges I would like to address and features I would like to implement. Is there a preferred place for these discussions?

@mahibi

mahibi commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

@mahibi Yes, of course, please feel free to take over this PR. In general, you are also very welcome to add commits to my PRs or take them over. Before pushing any further changes to branches you have taken over, I will first ask whether you are happy for me to resume work on them.

It would also be helpful to know where we could discuss proposed changes in advance, including rough edges I would like to address and features I would like to implement. Is there a preferred place for these discussions?

Alright thanks to let us know. To discuss bigger changes or features, please add your thoughts to existing issues or create new ones. It makes sense to first discuss and only then begin with pull requests. Otherwise there is the risk of spending too much time in something that wont be merged, e.g. if it needs to be aligned with the other platforms and we have to choose different ways of implementing it etc.

@rapterjet2004 rapterjet2004 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. The guard covers both rejoin paths (direct hangupNetworkCalls(shutDownView=false) and via hangup(false,false)), while leaving the screen and end-for-all still send the leave, and otherParticipantWasInCall is only ever set, never reset.

Not blocking, just a cross-PR note: the two rejoin paths treat ApplicationWideCurrentRoomHolder.isInCall differently (hangup() sets it false, the direct path keeps it true), which is pre-existing. It only matters because #6953 filters call pushes on isInCall, so a push during a hangup()-path rejoin could briefly slip through. Narrow and already racy — worth keeping in mind when both land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Caller alone in the call: a rejoin after a connection failure ends the call and the callee gets a missed call

3 participants