Skip to content

fix(timing): Record first-frame timestamp from the worker#3236

Merged
hensmi-amazon merged 1 commit into
mainfrom
meeting-session-timing-cross-clock
Jun 30, 2026
Merged

fix(timing): Record first-frame timestamp from the worker#3236
hensmi-amazon merged 1 commit into
mainfrom
meeting-session-timing-cross-clock

Conversation

@hensmi-amazon

Copy link
Copy Markdown
Contributor

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:

  1. Have you successfully run npm run build:release locally?
    y

  2. Do you add, modify, or delete public API definitions? If yes, has that been reviewed and approved?
    n

  3. 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.

@hensmi-amazon hensmi-amazon requested a review from a team as a code owner June 29, 2026 22:20
ltrung
ltrung previously approved these changes Jun 29, 2026
@hensmi-amazon hensmi-amazon force-pushed the meeting-session-timing-cross-clock branch 2 times, most recently from f536171 to 9de12c8 Compare June 30, 2026 19:07
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.
@hensmi-amazon hensmi-amazon force-pushed the meeting-session-timing-cross-clock branch from 9de12c8 to f7ad594 Compare June 30, 2026 19:46
@hensmi-amazon hensmi-amazon enabled auto-merge (squash) June 30, 2026 21:37
@hensmi-amazon hensmi-amazon merged commit 8c4c516 into main Jun 30, 2026
7 checks passed
@hensmi-amazon hensmi-amazon deleted the meeting-session-timing-cross-clock branch June 30, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants