Skip to content

feat(json)!: window consumers return each event's frame timestamp - #6274

Merged
kixelated merged 4 commits into
mainfrom
quest/m1/json-window-timestamps
Oct 22, 2026
Merged

kixelated merged 4 commits into
mainfrom
quest/m1/json-window-timestamps

Conversation

@kixelated

@kixelated kixelated commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Completes quest quest/m1/json-window-timestamps.md (deleted here).

Summary

  • moq_json::window::Consumer::next / poll_next (Rust) and Window.Consumer.next() / async iterator (JS) yield Timed<Event<T>>, matching the snapshot and stream consumers from feat(js)!: data consumers return each value's timestamp #5099 / feat(data)!: data consumers return each value's timestamp #5677. at is the timestamp of the frame that produced the event, None / absent when untimed.
  • A record a reader first learns of from a group header (joined late, or missed while behind) carries the header frame's time. Documented on both consumers. The decoder queue is drained before the next frame is read, so every queued event belongs to the last frame and shares its timestamp; the track-free Decoder is unchanged.
  • Room chat Subscriber::recv / poll_recv (Rust) and Chat.Subscriber.recv() (JS) return Timed<Event>, so readers get the send time the chat publisher already stamps on every message.
  • moq-mux and @moq/hang timeline readers unwrap .value: each record carries its own pts.
  • No moq-ffi or binding exposes the window consumer, so no binding changes.

Public API and wire impact

  • Breaking (Rust): moq_json::window::Consumer::{next, poll_next}, moq_room::chat::Subscriber::{recv, poll_recv} return moq_net::Timed<...>.
  • Breaking (JS): @moq/json Window.Consumer.next() and its iterator, @moq/room Chat.Subscriber.recv() return Timed<...>.
  • MIGRATE.md updated for moq-json, @moq/json, moq-room, @moq/room.
  • Wire: none.

Decisions

  1. Chat passes the timestamp through. Decided by the maintainer: keep the pass-through. moq_room::chat::Subscriber::{recv, poll_recv} and @moq/room Chat.Subscriber.recv() return Timed<Event>, because the chat track is timed precisely so each message is stamped when sent, and unwrapping here would leave that stamp unreadable.

Tests

  • New Rust and JS tests: timed events carry their frame's time (push, push, pop), a late joiner's header-restated records carry the header's time, and untimed tracks yield no timestamp.
  • just check passed (lint, build, Rust and JS tests for the changed packages). just test interop not run (no wire or moq-ffi change).

Overlaps moq-dev/moq#6054 in the window module and quest/m1/refresh/json.md; expect a small rebase conflict for whichever lands second.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

kixelated and others added 2 commits October 21, 2026 22:39
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
The Rust and JS window consumers yield `Timed<Event<T>>`, matching the
snapshot and stream consumers. A record restated by a group header carries
the header frame's time, since the wire has no per-record time. Room chat
subscribers pass the send time through; timeline readers drop it, since
each record carries its own pts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Outcome: quest implemented in full (Rust and JS window consumers, chat, timeline readers, MIGRATE entries). just check passed. Left as draft for one decision: whether chat recv should expose the send time (implemented, recommended) or unwrap it to keep the chat API unchanged. Suggested next step: /quest-iterate to settle it, then /quest-ready.

(Written by Claude Opus 5.5)

@kixelated
kixelated marked this pull request as ready for review October 22, 2026 06:10
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T10:58:00.049447Z 4cbae92 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6742efa6-8410-4618-85f4-9622972fa41c
📥 Commits

Reviewing files that changed from the base of the PR and between fa35ad5 and 4cbae92.

📒 Files selected for processing: 20
  • js/hang/src/timeline.ts
  • js/json/MIGRATE.md
  • js/json/src/window/consumer.ts
  • js/json/src/window/window.test.ts
  • js/room/MIGRATE.md
  • js/room/README.md
  • js/room/src/chat.test.ts
  • js/room/src/chat.ts
  • quest/m1/README.md
  • quest/m1/json-window-timestamps.md
  • quest/m1/refresh/README.md
  • quest/m1/refresh/json.md
  • rs/moq-archive/src/reader/tests.rs
  • rs/moq-json/MIGRATE.md
  • rs/moq-json/src/window/consumer.rs
  • rs/moq-json/src/window/mod.rs
  • rs/moq-mux/src/timeline.rs
  • rs/moq-room/MIGRATE.md
  • rs/moq-room/README.md
  • rs/moq-room/src/chat.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated added this pull request to the merge queue Oct 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 22, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Merged origin/main to clear the merge-queue conflict. The only conflict was in quest/m1/README.md: this PR drops its own "JSON window timestamps" entry, while main added the "FETCH_OK whole group" and "Pause an IETF SUBSCRIBE" entries next to it. Kept main's two entries and left this quest's entry removed. No code changes.

quest check (also --base origin/main), clippy -D warnings and tests for moq-json, moq-room, moq-mux and moq-archive, and check plus tests for js/json, js/room and js/hang all pass.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit 9c01b6f Oct 22, 2026
10 checks passed
@kixelated
kixelated deleted the quest/m1/json-window-timestamps branch October 22, 2026 12:08
kixelated added a commit that referenced this pull request Oct 22, 2026
#6274 made window consumers return each event's frame timestamp, so the refresh test reads .value and checks the restated header's timestamp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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