Skip to content

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

Open
dazzatronus wants to merge 1 commit into
mainfrom
fix/empty-asset-src-clip-update
Open

fix: skip invalid clip commit when media src empty#180
dazzatronus wants to merge 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.
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.

1 participant