Skip to content

fix: skip invalid clip commit when media src empty - #180

Merged
dazzatronus merged 1 commit into
mainfrom
fix/empty-asset-src-clip-update
Sep 15, 2026
Merged

dazzatronus merged 1 commit into
mainfrom
fix/empty-asset-src-clip-update

Conversation

@dazzatronus

Copy link
Copy Markdown
Contributor

Why

Updating fit (or similar) on a media clip with an empty asset.src caused commitClipUpdate to throw a ZodError from ResolvedClipSchema.parse, surfacing as an unhandled error on pointer-up resize.

Verify

  • Unit: npx jest tests/edit-commands.test.ts -t "commitClipUpdate validation"
  • Vite e2e: open studio demo → add/select an image clip with empty src (or clear src) → resize via corner handle → release pointer. Expect no console ZodError; toolbar/canvas remain usable.

Risk

Low. Invalid live commits are skipped (warn + no history entry) instead of throwing. Valid commits unchanged.

Resize/fit gestures call commitClipUpdate after live document updates.
When a media asset still has an empty src, Zod validation threw and
bubbled as an unhandled error. Use safeParse and skip the history
commit instead so the host app stays stable.
@dazzatronus
dazzatronus merged commit a21b7e1 into main Sep 15, 2026
1 check passed
@dazzatronus
dazzatronus deleted the fix/empty-asset-src-clip-update branch September 15, 2026 12:48
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.19.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant