Skip to content

fix(net): convert IETF object timestamps with Timestamp.as - #6387

Merged
kixelated merged 3 commits into
mainfrom
quest/m1/release-audit/ietf-timestamps
Oct 23, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m1/release-audit/ietf-timestamps

Conversation

@kixelated

@kixelated kixelated commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

encodeObjectTime (js/net/src/ietf/object.ts) converted a timestamp to the track's scale with its own value * timescale / scale in Numbers, bypassing Timestamp.as:

  • At the same scale it lost precision: the NANO timestamp 9007199254740985 went out as 9007199254740984, about 104 days into a nanosecond timeline.
  • It wrote converted values past 2^53, such as 10^10 ms at nanosecond scale (10^16), which the decoder on the other end, including ours, rejects.

Completes Preserve IETF timestamps.

Approach

Use Math.round(timestamp.as(timescale)), the conversion the Lite publisher already uses. It is exact at the same scale and throws RangeError before anything is written when the result leaves the range a Timestamp holds.

Impact

  • Public API and wire: none. Supported values encode exactly as before.
  • Error behavior: an unrepresentable conversion now fails encodeObjectExtensions with a RangeError on the sender, as Lite does. Previously the receiver refused the object.

Validation

  • New ietf/object.test.ts:

    • Same-scale round trips are exact through Number.MAX_SAFE_INTEGER, including 9007199254740985.
    • Cross-scale conversions round as before.
    • A conversion past 2^53 is refused before encoding.

    The first and last fail on main.

  • just check: passes apart from the pre-existing @moq/hang libav test-order failure, fixed in moq-dev/moq#6382.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU

(Written by Claude Opus 5.5)

kixelated and others added 2 commits October 22, 2026 13:58
`encodeObjectTime` scaled with its own multiply and divide, which lost
precision at the same scale (a NANO 9007199254740985 went out as
...984) and wrote values past 2^53 that its own decoder rejects, such
as 10^10 ms at nanosecond scale.

Use `Timestamp.as`, as Lite does: exact at the same scale, and a
RangeError before anything is written when the converted value leaves
the range a Timestamp holds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EeyiEy5FWz3z44DYZVo7vU
@kixelated kixelated changed the title Preserve timestamp conversion rules in JS IETF objects fix(net): convert IETF object timestamps with Timestamp.as Oct 22, 2026
@kixelated
kixelated marked this pull request as ready for review October 22, 2026 21:00
@kixelated

Copy link
Copy Markdown
Collaborator Author

Outcome: the quest is complete and its file is deleted. The IETF object encoder now shares Timestamp.as with Lite. It has no open decisions, so this is ready for review. just check passes apart from the pre-existing @moq/hang libav failure fixed in #6382.

(Written by Claude Opus 5.5)

@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-23T02:01:36.276079Z 95e255a 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 31 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: a249c473-aed5-48a8-8755-2f29ab9bcaf8
📥 Commits

Reviewing files that changed from the base of the PR and between 3b6234c and 95e255a.

📒 Files selected for processing: 4
  • js/net/src/ietf/object.test.ts
  • js/net/src/ietf/object.ts
  • quest/m1/release-audit/README.md
  • quest/m1/release-audit/ietf-timestamps.md
  • 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.

@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 23, 2026
# Conflicts:
#	quest/m1/release-audit/README.md
@kixelated
kixelated added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 6d07bd7 Oct 23, 2026
10 checks passed
@kixelated
kixelated deleted the quest/m1/release-audit/ietf-timestamps branch October 23, 2026 04:21
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