Skip to content

fix(timing-framework): avoidStreamEndFlag and traditional worker alignment#152

Open
qiyundai wants to merge 2 commits into
devfrom
fix/worker-traditional-alignment
Open

fix(timing-framework): avoidStreamEndFlag and traditional worker alignment#152
qiyundai wants to merge 2 commits into
devfrom
fix/worker-traditional-alignment

Conversation

@qiyundai
Copy link
Copy Markdown
Collaborator

@qiyundai qiyundai commented Jun 1, 2026

Summary

  • avoidStreamEndFlag: Stops treating the flag as natural stream-end; only disables MR blocking while toggleTime still selects the current fragment (fixes skip-to-last-slot bug).
  • worker-traditional.js (chrono-box production path): Aligned with worker.js for schedule behavior and performance:
    • Fast sync init via getFastInitialTime + background validateSchedulePosition (no blocking Akamai call before first render)
    • Monotonic time cache, drift detection, and validated cross-tab time sync
    • MR underrun requires toggleTime before early advance (matches module worker)
    • Shared hasToggleTimePassed / parseToggleTime helpers

Test plan

  • npx wtr test/unit/features/timing-framework/worker.test.js (46 passed)
  • ESLint on changed JS files
  • Manual: ?avoidStreamEndFlag=true on multi-slot MR schedule shows current-period fragment
  • Manual: ?serverTime=<ms>&avoidStreamEndFlag=true at known window
  • Manual: without flag, active MR still holds slot past toggleTime

Notes

worker.test.js targets the module worker as the reference implementation; worker-traditional.js is kept logically in sync (see README usage guidelines).

Made with Cursor

qiyundai and others added 2 commits June 1, 2026 09:44
avoidStreamEndFlag was reusing stream-ended early-advance paths, causing
the schedule to skip to the last timed fragment. Only disable MR blocking;
natural underrun and liveStreamEnd still apply when streams actually end.

Co-authored-by: Cursor <cursoragent@cursor.com>
Port fast schedule init, validateSchedulePosition, monotonic Akamai time
cache with drift detection, and MR underrun toggleTime guard so chrono-box
(production path) matches worker.js behavior without blocking on API at init.

Co-authored-by: Cursor <cursoragent@cursor.com>
@aem-code-sync
Copy link
Copy Markdown

aem-code-sync Bot commented Jun 1, 2026

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

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.

1 participant