Skip to content

Conversation

danxuliu
Copy link
Member

@danxuliu danxuliu commented Jul 2, 2025

Fixes #4635

⚠️ ⚠️ ⚠️ WIP, it seems that sometimes it does not work as expected, so it still needs further development ⚠️ ⚠️ ⚠️

When the external signaling server is used it is possible to assign an id to a message to then be able to identify the response in the messages sent by the signaling server. For example, when joining a room, the signaling server confirms that joining the room was successful with a room message.

Until now the Android app assumed that room messages were sent only in that case, but a room message can be sent also if the properties of the room change. When the room is joined and the call activity is active the call is also joined, so if the properties of the room changed while in a call, the Android app rejoined the call. However, this was not done in a clean way; previous event handlers were replaced without tearing down them first, and that caused strange issues. For example, when a recording started additional guests appeared in the UI. That would be the most common/visible case, but there could be others too when something caused a room message to be sent while in a call.

To solve that now only the room event that is sent as a response of joining a room is treated as such. Currently other room messages are ignored, although they could be used to update the properties of the room and things like that, but that would be a future improvement.

TODO

  • Check why the join room message is sent twice when joining a call, was it introduced by these changes or was it happening already?
  • Test thoroughly (including federation)
  • Check other messages that could require a callback besides joining a room (for example, hello responses)
  • Guard against joining a call while already in a call? Or properly replace the event handlers? This would be just a safety measure, although not really needed after the fix.

How to test

  • Setup an HPB
  • Setup a recording server
  • In the WebUI, create a conversation
  • Invite the user of the Android app
  • Start a call
  • In the Android app, join the call
  • In the WebUI, start a recording

Result with this pull request

Nothing strange happens in the Android app

Result without this pull request

A guest user appears in the call view of the Android app

danxuliu added 6 commits July 2, 2025 08:50
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The interface is now passed to "sendMessage" instead of a serialized
message, which will make possible to customize the "id" property (still
to be added) if needed before sending the message.

Note that, for consistency, the interface was applied to all "overall"
data objects, even if some of them are only for received messages (like
"ErrorOverallWebSocketMessage").

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
WebSocket messages may contain an "id" property used to match a response
message with its request.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
With the external signaling server, if the "id" property is set when
sending a signaling message the response to that specific message will
be identified by the same id. Now a callback can be passed to
"sendMessage", which automatically adds an id to the message and makes
possible to run the callback when/if the response to the message is
received.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
When joining a room, the signaling server confirms that joining the room
was successful by sending a "room" message. Until now the Android app
assumed that "room" messages were sent only in that case, but a "room"
message can be sent also if the properties of the room change. When the
room is joined while the call activity is active the call is also
joined, so if the properties of the room changed while in a call the
Android app rejoined the call, which caused strange issues due to how it
was done. For example, when a recording started additional guests
appeared in the UI.

To solve that now only the "room" message that actually confirms that
the join was successful, which can be identified by setting an ID in the
request to join the room, is treated as such.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu added this to the 22.0.0 milestone Jul 2, 2025
@danxuliu danxuliu added bug Something isn't working 2. developing Work in progress feature: call ☎️ labels Jul 2, 2025
@danxuliu
Copy link
Member Author

danxuliu commented Jul 2, 2025

/backport to stable-21.1

Copy link
Contributor

github-actions bot commented Jul 2, 2025

Codacy

Lint

TypemasterPR
Warnings10096
Errors100

SpotBugs

CategoryBaseNew
Bad practice66
Correctness1616
Dodgy code6161
Internationalization33
Malicious code vulnerability33
Performance44
Security11
Total9494

Copy link
Contributor

github-actions bot commented Jul 2, 2025

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/5115-talk.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Start recording from Talk Android breaks participant list layout in the app
1 participant