fix(timing): Record first-frame timestamp from the worker#3236
Merged
Conversation
ltrung
previously approved these changes
Jun 29, 2026
f536171 to
9de12c8
Compare
The MeetingSession first-packet/first-frame send and receive times were stamped with Date.now() on the main thread, after the encoded-transform worker -> main postMessage hop. That hop lags the true media time, so the client-reported send time could land after the server's receive time and produce negative cross-clock deltas server-side. Capture the timestamp in the worker when the first frame for an SSRC is processed, carry it on the NEW_SSRC message, and thread it through MediaMetricsTransformManager -> DefaultAudioVideoController -> the four MeetingSessionTimingManager record methods. The parameter is optional and falls back to Date.now(), so behavior is unchanged when absent. Also bump nyc 17 -> 18 and declare uuid (a test-only dependency that was previously satisfied transitively via nyc's istanbul chain) to clear dev-dependency audit advisories; regenerate the encoded-transform worker bundle.
9de12c8 to
f7ad594
Compare
ltrung
approved these changes
Jun 30, 2026
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.
Issue #: N/A
Description of changes:
The MeetingSession first-packet/first-frame send and receive times were stamped with Date.now() on the main thread, after the encoded-transform worker -> main postMessage hop. That hop lags the true media time, so the client-reported send time could land after the server's receive time and produce negative cross-clock deltas server-side.
Capture the timestamp in the worker when the first frame for an SSRC is processed, carry it on the NEW_SSRC message, and thread it through MediaMetricsTransformManager -> DefaultAudioVideoController -> the four MeetingSessionTimingManager record methods. The parameter is optional and falls back to Date.now(), so behavior is unchanged when absent.
Testing:
smoke tested values are reasonable
Can these tested using a demo application? Please provide reproducible step-by-step instructions.
N/A
Checklist:
Have you successfully run
npm run build:releaselocally?y
Do you add, modify, or delete public API definitions? If yes, has that been reviewed and approved?
n
Do you change the wire protocol, e.g. the request method? If yes, has that been reviewed and approved?
n
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.