Repository navigation
core: rtcstats doesn't send recording and transcribing changes when they happen - #1200
Open
misi-whereby wants to merge 11 commits into
Open
misi-whereby wants to merge 11 commits into
misi-whereby wants to merge 11 commits into
Conversation
🦋 Changeset detectedLatest commit: d749fe2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
misi-whereby
force-pushed
the
misi/cob-3449-rtcstats-doesnt-send-recording-and
branch
3 times, most recently
from
November 13, 2026 08:01
57eeebe to
d749fe2
Compare
rtcstats connects with the page's path, and the server uses it as the room name. The server also uses the Origin header for the subdomain, and both in the stored file name. On a page that isn't the room's page, these are the page's, and a page can't set the Origin header. setRoomUrl() takes the room's origin and path: the connection then uses an empty path, so the page's path isn't sent, and the room's origin and path are sent in the roomUrl query parameter, for a server that reads it. It's used from the next connection. Without it, the URL is the same as before. After requireRoomUrl(), rtcstats doesn't connect while the room's URL isn't set, so the page's origin and path are never sent.
rtcstats uses the page's path as the room name, and the page's origin for the subdomain, and both in the stored file name. Core doesn't run on the room's page, so it gives rtcstats the room's origin and path when the app starts, and clears them when the app stops. The room URL's query isn't passed on, as it can hold a room key.
No behaviour change. doRtcAnalyticsCustomEventsInitialize and the action listener had their own copies of the compare, send and mark logic. Both now use sendIfChanged, which the next commit also uses from reactors.
clientId, deviceId, externalId, organizationId, signalConnectionStatus, rtcConnectionStatus and userRole were only sent by doRtcAnalyticsCustomEventsInitialize, when the RtcManager is initialized. Later changes, such as a signal disconnect or reconnect, weren't sent unless another RtcManager was initialized. Each is now also sent when its value changes. Values are only sent once the RtcManager is initialized. doRtcAnalyticsCustomEventsInitialize runs then and sends insightsStats first, which rtcstats uses to set the session's timestamp. Checking only that an RtcManager existed wasn't enough: rtcManagerCreated sets the RtcManager and status "ready" in the same action, before the initialization. Values that change before it are left unmarked, and the initialization sends their current value.
Sent when the RtcManager is initialized and whenever the mode changes.
rtcstats reads the userRole event's value from its role property, both for the stored session info and for insights. It was sent as userRole, so the role was never recorded.
A value is sent when makeComparable(value), a JSON string for objects, differs from the last reported value, but the raw value was stored as the last reported one. For objects and null the two never match, so those events were sent again on every action that triggers them, even when they hadn't changed, for example recording on every newClient. Store the comparable value instead.
The room slice now keeps room.sfuServer from roomJoined, null when the room has none, with selectRoomSfuServer to read it. It's sent as the sfuServer event when the RtcManager is initialized and when the server changes. The rtcstats connection already re-sends the last sfuServer event after it reconnects.
The screenshare stop had its own entry, localScreenshareStreamStopped, with the same rtcEventName and a getValue that returned a new function every time. It never matched the last reported value, so every initialization, for example when joining a room, sent localScreenshareStream without tracks: a stop when there was no screenshare at all, and a stop right after the real tracks while screensharing. It also stored a function in the Redux state. localScreenshareStream is now also checked after stopScreenshare, so a stop is still sent without tracks, and initialization only sends it while there is a screenshare.
The listener for the rtcstats trigger actions only checked the first value that listed the action. recording, transcribing and roomSessionId all list newClient, so only recording was checked, and a transcribing change or a new room session id that came with newClient wasn't sent. Every value that lists the action is now checked.
… stop recording and transcribing were only checked on newClient. A recording starts when the recorder joins, so that start was sent, but its stop only at the next join. The captioner joins before live transcription has started, so a transcription start and stop were only sent when another participant joined. recording is now also checked on cloudRecordingStarted and cloudRecordingStopped, and transcribing on liveTranscriptionStarted and liveTranscriptionStopped instead of newClient.
misi-whereby
force-pushed
the
misi/cob-3449-rtcstats-doesnt-send-recording-and
branch
from
November 17, 2026 10:39
d749fe2 to
337b70a
Compare
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.
Description
Summary:
rtcstats doesn't send recording and transcribing changes when they happen
Related Issue:
Testing
Check rtcstats transcribing and recording events
Screenshots/GIFs (if applicable)
Checklist
under the terms of the MIT license.
Additional Information