Revert "Enable browser G2G latency measurement by default" - #194
Conversation
This reverts commit cb5a709.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Reviewed by Cursor Bugbot for commit 2de0f09. Configure here.
| // `timestamp` is the sync-source playout time as a DOMHighResTimeStamp | ||
| // (relative to performance.timeOrigin); convert to epoch ms so it lines up | ||
| // with the publisher's epoch `userTimestamp` and the epoch `startMs`. | ||
| if (frameMetadata) tracker.recordFrame(frameMetadata.userTimestamp, performance.timeOrigin + timestamp); |
There was a problem hiding this comment.
Broken G2G timestamp conversion
High Severity
timeSyncUpdate already carries an absolute wall-clock timestamp from RTCRtpContributingSource (performance.timeOrigin + performance.now()). Adding performance.timeOrigin again produces implausible latencies that recordFrame drops, so opted-in glass-to-glass metrics stay empty.
Reviewed by Cursor Bugbot for commit 2de0f09. Configure here.
| frameMetadataWorker = undefined; | ||
| throw error; | ||
| } | ||
| room = new LiveKitRoom(REALTIME_CONFIG.livekit.roomOptions); |
There was a problem hiding this comment.
Viewers break with debugQuality
High Severity
debugQuality still advertises frame_timing, so the server appends packet trailers to room frames, but subscribe no longer builds a strip worker or encodes frame_timing in tokens. Viewers of those sessions decode nothing and see a black video with no error.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 2de0f09. Configure here.


Reverts #191
Note
Medium Risk
Changes default realtime wire format and viewer compatibility semantics; publishers on the reverted behavior no longer send frame trailers unless
debugQualityis set, which fixes subscriber breakage but is a behavioral/API contract shift integrators should verify.Overview
Reverts default-on browser glass-to-glass (G2G) measurement so frame metadata and packet trailers are only used when publishers explicitly opt in.
Publishers must pass
connect({ debugQuality: true })to enable LiveKit frame-metadata workers, advertiseframe_timingto the server, and populateg2gMs/ttffMsonstatsand connection quality. Without that flag, sessions behave like standard realtime connects with no frame trailers. Worker creation failures no longer abort the media connection—they log and continue without latency metrics. Deep connectivity preflight still turns ondebugQualityfor its short probe session.Viewers no longer read
frame_timingfrom subscribe tokens or spin up strip workers;subscribeuses a plain LiveKit room, so mixed SDK versions and React Native subscribers are not blocked or left with a black video when an upgraded publisher would have advertised timing.Docs and the SDK demo page describe G2G as opt-in diagnostic measurement and add a checkbox wired to
debugQuality. React Native rejectsdebugQualitylike other browser-only features. G2G playout timestamp handling is corrected to treat LiveKittimeSyncUpdatetimestamps as relative toperformance.timeOrigin.Reviewed by Cursor Bugbot for commit 2de0f09. Bugbot is set up for automated code reviews on this repo. Configure here.