Repository navigation
Conversation
Each event was its own MoQ group. @moq/net's track-level readFrame() drops an older group as soon as a newer one exists, even if the older group's frame has not arrived yet, so two events sent close together could lose one. The 50 ms gap between writes only made this less likely. Now the events track has one group per ad-break cycle and each event is one frame in it, so a cycle's events arrive complete and in order. The 50 ms queue is removed. debug-subscriber.mjs reads each group to its end. A subscriber that joins mid-cycle first gets the events of that cycle that were already sent. New sgai/event-delivery.ci-check.mjs compares the publisher and subscriber logs in both SGAI CI jobs and fails if an event is lost.
This was referenced Oct 27, 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.
What
The SGAI
eventstrack now uses one MoQ group per ad-break cycle. Each event is one frame in that group.Why
Before, each event was its own group.
@moq/net's track-levelreadFrame()/readJson()drops an older group as soon as a newer one exists, even if the older group's frame has not arrived yet. So two events sent close together could lose one. The 50 ms gap between writes only made this less likely. This also blocked the update tomoq-relay0.14.18+.Changes
sgai/ad-decisioning-publisher.mjs: one group per cycle, the 50 ms queue is removed. A subscriber that joins mid-cycle first gets the events of that cycle that were already sent.sgai/debug-subscriber.mjs: reads each group to its end (recvGroup(), thenreadJson()on the group).sgai/event-delivery.ci-check.mjs: compares the publisher and subscriber logs and fails if an event is lost. Used insmoke-test-sgaiandsmoke-test-podman-sgai.Tests
Local, with
moq-relay0.14.5 and 0.17.8: no lost events, also with five events at the same moment and with the CPU under load. A subscriber that joins after the first blackout event: the old code lost it in 5 runs out of 5, the new code in 0.