Repository navigation
fix(share): leave out media the Worker rejects instead of aborting the share - #83
Merged
Merged
Conversation
…e share Since #71 the share Worker accepts only jpe?g|png|gif|webp|avif under media/. The client still named AVIF, BMP, HEIC and unknown images media/<id>.bin and SVG media/<id>.svg, so the first such PUT answered 400 "Invalid file path." and createShareLink threw after the content, Markdown and manifest had already uploaded. No link, no toast that explains why. - mimeToExt maps image/avif to avif; the Worker already serves it. - createShareLink filters media names through a client mirror of the Worker rule (SHARE_MEDIA_NAME) and drops the rest from the upload list and from publicMedia, so the shared copy lists that image as missing the way it already does for raw video. The sharedModel completeness assessment from #61 then reports it. created.mediaFilesSkipped carries the count. - Regression test: a BMP and an AVIF image share without a .bin PUT, the AVIF uploads under its own extension, the shared copy is incomplete, the live model keeps its bytes. Fails on main with "Share service returned HTTP 400. Invalid file path." - eslint ignores .claude/** (agent worktrees with their own dist/) and the gitignored _scratch/**, so npm run lint reports on the repo again. Fixes #80 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Fixes #80.
Since #71 the share Worker accepts only
jpe?g|png|gif|webp|avifundermedia/. The client still named AVIF, BMP, HEIC and unknown imagesmedia/<id>.binand SVGmedia/<id>.svg, so the first such PUT answered400 Invalid file path.andcreateShareLinkthrew aftercontent.html,content.mdandmanifest.jsonhad already uploaded. The user got no link.Change
mimeToExt:image/avif->avif(the Worker already serves it).createShareLink: media names go throughSHARE_MEDIA_NAME, a client mirror of the Worker'svalidFilePath. Anything else is left out of the upload and out ofpublicMedia, so the shared copy lists that image as missing, as it already does for raw video; thesharedModelcompleteness check from Shared capsule drops a captured video when its poster failed, while gate and CLI report complete #61 then reports it.created.mediaFilesSkippedcarries the count. The Worker stays strict..claude/**and_scratch/**, sonpm run linton this machine reports on the repo rather than on leftover agent worktrees (5536 errors on main before this).Verification
Share service returned HTTP 400. Invalid file path.and passes here.npm test,npm run lint,npm run format:checkpass locally.Found by the 2026-10-08 second-opinion audit of the 2026-10-07 review.
🤖 Generated with Claude Code