Repository navigation
fix(share): use forward-slash snapshot keys across platforms - #9203
miguel-heygen wants to merge 1 commit into
Conversation
Edit accuracy: accurate 275 (base branch 275), smooth 67 of thoseThe gate passes. Quarantined, measured but not gated (0) |
jrusso1020
left a comment
There was a problem hiding this comment.
Approve. Every snapshot key the package writes now goes through snapshotRelativePath, and the check that skips files reads the same key.
Need: yes. On Windows the changed-files list had backslash keys that never matched. Size: small (+8 / -5 plus a test). Reuse: a single helper serves snapshotProject, snapshotFiles and excludedFromSnapshot. Simpler: this is already minimal. Structure: fine.
Risk: low in this repo. One follow-up for the next Desktop share bump, below.
Checked at this head:
- Producers and consumers. Snapshot maps come from
snapshotProjectandsnapshotFiles, and both key through the helper now.excludedFromSnapshot,diffChangedFilesandsnapshotFingerprintread those keys unchanged. In this repo the only other consumer is theindex.mjsre-export;checkPipeline.ts'ssnapshotFilesis an unrelated local list. - Fails without the fix: with the base
projectSnapshot.mjsput back,projectSnapshotPosix.test.mjsfails (expected/actual key mismatch). With the head version restored it passes. - Tests: after building parsers, the
packages/sharesuite passes 213/213 at this head.
Follow-up for the next Desktop share bump, not blocking here. Nothing in this repo stores snapshots. Desktop does:
.hyperframes/film-snapshot.json(recordFilmSnapshot) holds the old Windows keys, such ascompositions\title.html. After the bump,filmChangedcompares those against the new/keys, so on Windows any launch film with a subfolder reads as changed until its snapshot is written again. Normalizing the recorded keys when reading ("\\"→"/") would cover it.- Saved export fingerprints (
exportFileslast.fingerprint) will also read as out of date once on Windows. - The Desktop watcher already turns keys into
/(readKeys), so it lines up with this change.
Nit: on macOS and Linux a backslash is a legal filename character. A file literally named a\b.png now gets the key a/b.png, which points at a different path. It's rare enough to leave.
— Rames
Summary
snapshotProject,snapshotFiles, andexcludedFromSnapshotin@hyperframes/sharenow derive project-relative snapshot keys through one shared helper (snapshotRelativePath) that always uses/separators.Previously,
snapshotProjectstored rawpath.relative(dir, full)keys (producing Windows backslash keys such asboards\storyboard.html), whileexcludedFromSnapshotnormalized separators separately for ignore matching. Unifying key generation prevents snapshot keys and ignore matching from drifting across platforms and ensuresdiffChangedFilesemits forward-slash paths on Windows.Verification
packages/share/tests/projectSnapshotPosix.test.mjs(usingpath.win32.relative) failed before the fix with backslash keys (["assets\\raw.mov", "boards\\storyboard.html", "compositions\\title.html", "index.html"]) and passed 3/3 consecutive runs after the fix.packages/sharefull test suite: 213/213 passing.packages/sharetypecheck, build,oxlint(0 warnings, 0 errors), andoxfmt --checkpassing.