Skip to content

fix(call): ignore stale roomJoined events that fire before joinRoomndCall#6045

Open
tareko wants to merge 1 commit intonextcloud:masterfrom
tareko:fix-call-already-in-progress
Open

fix(call): ignore stale roomJoined events that fire before joinRoomndCall#6045
tareko wants to merge 1 commit intonextcloud:masterfrom
tareko:fix-call-already-in-progress

Conversation

@tareko
Copy link
Copy Markdown
Contributor

@tareko tareko commented Apr 11, 2026

When the app launches and immediately joins an existing call, the WebSocket may already be connected from a previous session. The server sends a stale roomJoined event before joinRoomAndCall() is called, causing performCall() to fire prematurely. Later when joinRoomAndCall runs, the WebSocket does a local join and the server never re-sends the participant list. The call stays stuck in JOINED and never transitions to IN_CONVERSATION.

Add joinRoomInitiated flag to guard the roomJoined handler against stale events. Only process roomJoined after joinRoomAndCall has been called.

This fixes Issue #6044 . I used OpenCode and GLM-5.1 to debug and fix this bug.

🏁 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?)

@AndyScherzinger AndyScherzinger requested a review from mahibi April 11, 2026 21:37
@AndyScherzinger AndyScherzinger added the 3. to review Waiting for reviews label Apr 11, 2026
…dCall

When the app launches and immediately joins an existing call, the
WebSocket may already be connected from a previous session. The server
sends a stale roomJoined event before joinRoomAndCall() is called,
causing performCall() to fire prematurely. Later when joinRoomAndCall
runs, the WebSocket does a local join and the server never re-sends the
participant list. The call stays stuck in JOINED and never transitions
to IN_CONVERSATION.

Add joinRoomInitiated flag to guard the roomJoined handler against stale
events. Only process roomJoined after joinRoomAndCall has been called.

Signed-off-by: Tarek Loubani <tarek@tarek.org>
@tareko tareko force-pushed the fix-call-already-in-progress branch from e0e1c7d to 261d20b Compare April 11, 2026 21:59
@mahibi
Copy link
Copy Markdown
Collaborator

mahibi commented Apr 13, 2026

Hi @tareko
thanks for contributing! we will have a closer look soon!

@mahibi
Copy link
Copy Markdown
Collaborator

mahibi commented Apr 17, 2026

@tareko are you interested to be invited to the nextcloud.com instance as a guest so we could also chat and you can further connect to the community? Should i invite you via tarek@tarek.org ?

Also, do you like to have advanced access to the talk repo? Then you could create PR's inside it instead in your fork, which will simplify the review process

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

Labels

3. to review Waiting for reviews

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants