Repository navigation
feat(normalize, author): the page's build moves an mp4's index to the front - #259
Merged
Merged
Conversation
… front, by the normalizer's plan (#218)
Contributor
There was a problem hiding this comment.
6 issues found across 11 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="design/normalize.md">
<violation number="1" location="design/normalize.md:7">
P2: Adding `./mp4` as an exported subpath makes `mp4.mjs` public, so the next sentence's claim that the other modules 'stay free to change' no longer holds. Update that sentence to name `./mp4` (`mp4Info`, `faststartPlan`) as documented API, matching docs/compatibility.md.</violation>
</file>
<file name="packages/author/README.md">
<violation number="1" location="packages/author/README.md:382">
P2: The README names only mp4 and m4a, but the page build also moves the index of `.m4v` and `.mov` files (`ISO_MEDIA` in `lib/browser.mjs`), as the PR description states. List all four so the documented behavior matches the code.</violation>
</file>
<file name="packages/author/lib/browser.mjs">
<violation number="1" location="packages/author/lib/browser.mjs:20">
P3: The header comment names only mp4 and m4a, but this build also moves the index of m4v and mov files. Name all four containers so the doc matches the code and the PR description.</violation>
<violation number="2" location="packages/author/lib/browser.mjs:131">
P3: This extension list duplicates `ISO_MEDIA_EXTENSIONS` in the normalizer. If one list changes and the other does not, the page and Node builds will lay out different files. Export the set from the normalizer and gate on that instead of a second copy here.</violation>
<violation number="3" location="packages/author/lib/browser.mjs:131">
P2: The new `.m4v` and `.mov` branches are unreachable: `MediaStore` rejects those extensions before `laidOut()` runs, so page builds still cannot provide the advertised four-container support. Extend the author media whitelist and its naming/MIME rules consistently, or remove these dead alternatives.</violation>
</file>
<file name="packages/normalize/lib/mp4.mjs">
<violation number="1" location="packages/normalize/lib/mp4.mjs:293">
P2: The public planner recursively descends untrusted `moov` containers without a depth bound. A crafted nested-container chain can overflow the call stack instead of returning `skipped`; use an iterative walk or enforce a maximum nesting depth.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…he plan of every file, and the publish check holds the normalizer's version (#218)
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 7 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…below it, and the file plan says its positions (#218)
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.
Part of #218: item 5, "The build page moves an mp4's index to the front". Item 4 is #258; item 6 and the open question stay in #218.
What changes
./mp4asfaststartPlan(read, size), onUint8ArrayandDataViewrather thanBuffer, likemp4Infobeside it. It returns{ status, detail, pieces, size }: each piece a range of the file or the rewritten index. Only the index is read whole.mp4-faststart.mjs'splanFaststart(file, base, size)is now a wrapper: the file's bytes in, the ranges shifted bybase. The remux exists once, andnormalizeArchiveis unchanged.Blobof the given file's slices and the rewritten index, so no byte of the media is copied, and its CRC is that of what is stored. Every stored file is asked of the plan, which tells an ISO media file by its first eight bytes and leaves any other file, and one with its index first already, as given: the page keeps no list of extensions beside the normalizer's.moovwent into every container, so a crafted file of a hundred thousandtrakatoms inside each other ended it with aRangeError, in the normalizer too, before this change. It now stops eight deep (a real index nests four) and the file comes backskipped.Before, a phone's video built on the build page could start playing only once it had arrived whole.
Release order: the normalizer first, and the publish check holds it
The page build imports
faststartPlanby name, and npm's record of a version lists entries, not what they export. Socheck-pack-published.mjsnow refuses to publish the author whilepackages/normalizeis below 1.5.0, the first version with it:workspace:^publishes as^1.5.0, which the same check then finds on npm.Run today, with the normalizer at 1.4.1, the check stops with that instruction. I have not bumped anything.
Tests
faststartPlanon bytes in memory gives the same bytes as the file path, and leaves the bytes it read unchanged; a faststart file and a web page come back as one whole-file piece. The crafted index isskipped, and one nested as a real one is moved.moovbeforemdat, and its CRC checks out on read.Docs
The author README ("In a page"), the normalizer README (
faststartPlan),docs/compatibility.md,design/author.md,design/normalize.mdanddesign/layout.md.