Skip to content

fix(share): leave out media the Worker rejects instead of aborting the share - #83

Merged
wolfgang-aura merged 1 commit into
mainfrom
fix/share-media-ext-80
Oct 8, 2026
Merged

wolfgang-aura merged 1 commit into
mainfrom
fix/share-media-ext-80

Conversation

@wolfgang-aura

Copy link
Copy Markdown
Owner

Fixes #80.

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 content.html, content.md and manifest.json had already uploaded. The user got no link.

Change

  • mimeToExt: image/avif -> avif (the Worker already serves it).
  • createShareLink: media names go through SHARE_MEDIA_NAME, a client mirror of the Worker's validFilePath. Anything else is left out of the upload and out of publicMedia, so the shared copy lists that image as missing, as it already does for raw video; the sharedModel completeness check from Shared capsule drops a captured video when its poster failed, while gate and CLI report complete #61 then reports it. created.mediaFilesSkipped carries the count. The Worker stays strict.
  • eslint ignores .claude/** and _scratch/**, so npm run lint on this machine reports on the repo rather than on leftover agent worktrees (5536 errors on main before this).

Verification

  • New dom test fails on main with Share service returned HTTP 400. Invalid file path. and passes here.
  • npm test, npm run lint, npm run format:check pass locally.
  • Not live-verified: whether pbs.twimg.com ever serves AVIF/BMP/HEIC/SVG bytes for a post image is unknown. The code path is confirmed offline.

Found by the 2026-10-08 second-opinion audit of the 2026-10-07 review.

🤖 Generated with Claude Code

…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>
@wolfgang-aura
wolfgang-aura merged commit 40f0b40 into main Oct 8, 2026
1 check passed
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.

Share aborts with 'Invalid file path' for AVIF/BMP/HEIC/SVG images: client emits .bin/.svg names the Worker rejects since #71

1 participant