feat: laat video en audio meereizen naar een git-repository #540
No reviewers
Labels
No labels
accepted
bug
declined
docs
duplicate
enhancement
good first issue
in-progress
needs-info
privacy
security
triage
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
LibreKAT/Ocideck!540
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/git-media"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
If you keep presentations in git, the media belongs there too. Warning about it is a courtesy, not a substitute for supporting it.
Part of #515 — media only. Sidecars are split off (see below).
What I got wrong first
I told the maintainer this needed a design decision before building. It did not: D5 already decided it — partial clone plus a size warning, explicitly no hard cap, because "telling a presentation author their video is too large is a bad answer from a tool that supports video". I should have read the design before saying it needed input.
What genuinely was undesigned is the way back, now recorded as D12.
The way back (D12)
Media cannot return the way an image does.
WebAssetStoreis aMap<String, Uint8List>— fine for a picture, wrong for the 1 GiBmaxMediaBytesallows. So arepo:media reference resolves to:AssetStaging.stageBytes), so the player reads from disk exactly as it does for a deck opened from a folder;mem:on web, within a browser-sized cap.Validation is symmetric with images: a forge is untrusted (P5), so bytes must sniff as a known container (
mediaMimeFromBytes) and stay inside the cap — the same shape aslooksLikeImage.Changes
deck_repo_serializer.dart—poolImagewas never image-specific (only its mem-path fallback name was); renamedpoolAsset, andvideoPath/audioPathnow go through it and are rewritten torepo:refs.repo_asset_resolver.dart— the media read path via staging, with container sniffing.GitDeckOmissionslosesvideoSlides/audioSlides, and the pre-commit warning loses those two lines. A warning that is untrue teaches people to dismiss the whole dialog — including the parts that are still true.docs/design/GIT_STORAGE.md— D12 added, D5 annotated with the confirmation and its date.Verification
Six tests in
test/git_media_roundtrip_test.dart, including that two slides using the same film produce one blob — the property that keeps history from growing on every commit — and that unreadable media is reported rather than silently dropped, which is the exact failure mode the issue describes.Mutation-checked: removing the pooling call makes three of the six fail. The test measures something.
make check,make check-secrets,make sastall green.Deliberately not in scope
The sidecars —
.ink.json,.user-notes.json,.seal.json— still do not travel, and the warning still says so. They are a different data class, and the ink half needs the merge driver from D7 (union of stroke sets), which depends on per-stroke identity in the annotation format. Filed separately rather than bolted on here.Principles
Touches storage, so weighed: the deck stays plain Marp Markdown, media lands in the shared content-addressed pool that images already use, and nothing new becomes unreadable outside OciDeck. It makes the user's copy more complete, which is the direction that matters — a deck you cannot take with you is the failure this project exists to avoid.