Browse other conversations during a call (with a second signaling session)#18813
Open
vladopol wants to merge 1 commit into
Open
Browse other conversations during a call (with a second signaling session)#18813vladopol wants to merge 1 commit into
vladopol wants to merge 1 commit into
Conversation
β¦naling session Keep the call's signaling + WebRTC singleton pinned to the call and open a separate lightweight signaling connection for the browsed conversation, so it stays live-updated (instant chat-relay messages, typing indicators) without a second window or a re-dial. The secondary session runs on a distinct Talk session (dedicated tab-id, applied via a non-clobbering request interceptor) and does not leak its events onto the global EventBus, so the call is never affected. It never joins a call or sets up WebRTC/media. The browsed conversation's participant list is loaded from the secondary session so that participant-dependent UI (typing indicator) works while browsing. Falls back to REST/polling browsing on the internal (non-HPB) signaling. Refs nextcloud#12299 Signed-off-by: Vladimir Poluliashenko <vladopol@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Browse other conversations during a call (with a second signaling session)
Fixes #12299
Summary
While a call is ongoing, the user can now navigate to and interact with other
conversations in the same window, without the call being interrupted and
without opening a second window or tab. The browsed conversation stays
live-updated β new messages arrive instantly via chat-relay and typing
indicators are shown β because it is backed by a second, lightweight signaling
session.
This supersedes the earlier single-session attempt (#18787), which was correctly
rejected for lacking the second signaling session described in the dev notes on
this issue. The approach here follows those notes directly:
How it works
The primary signaling + WebRTC singleton stays pinned to the call and is
never touched. For the conversation being browsed, a separate, lightweight
signaling connection is opened that:
(
x-nextcloud-talk-session-tab-id, feat(sessions): Allow multiple Talk session in the same conversation with the same PHP sessionΒ #17230) is now applied non-destructively,and browse requests carry a dedicated secondary tab-id, so the server maps
them to a distinct session (
TalkSessionkeys sessions by tab-id) instead ofthe one holding the call.
chat-relay (instant messages) and typing.
allow-list forwards only
supportedFeatures; the token-scoped chat-relaymessage events flow as usual, so the call state is never affected.
Lifecycle: the secondary session is mounted when navigating to another
conversation during a call, switched when browsing further, and torn down when
returning to the call's conversation or when the call ends.
On the internal (non-HPB) signaling backend there is no cheap second
connection, so it transparently falls back to the previous REST/polling browsing
behaviour.
What the user sees
conversation; returning to the call's conversation shows the call view again.
Files
utils/webrtc/browseSignaling.js(new) β lifecycle of the secondary chat-onlysignaling session; also loads/refreshes the browsed conversation's participant
list (needed by participant-dependent UI such as the typing indicator, which
is not fetched the usual way while browsing).
services/talkSessionUniqueTabId.tsβ secondary tab-id + a non-clobberingrequest interceptor and a helper to route a request through the browse session.
utils/signaling.jsβ optional per-instance allow-list for events forwarded tothe global EventBus (
setEventBusEmitAllowlist).utils/SignalingTypingHandler.jsβ attribute received typing to the room thesignaling connection is joined to (identical behaviour for the primary
connection, correct for the secondary one).
App.vueβ navigation guard that keeps the call alive while browsing, plusmount/switch/teardown of the browse session and teardown on call end.
components/NewMessage/NewMessage.vueβ enable the composer while browsingduring a call.
Requirements
Live updates for the browsed conversation require the High-Performance Backend
and multiple Talk sessions per device (#17230). Without them, browsing falls back
to REST/polling.
Trade-offs
Only one browsed conversation is kept live at a time (the one currently viewed),
which keeps the second connection cheap β in line with the "maybe simplified"
note.
Testing
conversation A, browse conversation B β the call is not interrupted; a message
and typing from another participant in B appear live; returning to A the call
is intact; ending the call while browsing tears the session down. The server
shows two distinct Talk sessions (call + browse) and a single call session.
allow-list.
lint,stylelint,ts:checkand unit suite pass.