fix: clamp clip resize height to schema max (2160)#113
Merged
Conversation
|
🎉 This PR is included in version 2.10.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary
clampDimensions()capped both axes at 3840, butResolvedClipSchemarequiresheight ≤ 2160. Any clip resize that crossed 2160 px height threw an unhandledZodErrorinside the pixipointeruplistener.MAX_DIMENSIONintoMAX_WIDTH(3840) andMAX_HEIGHT(2160) so the interaction clamp stops at the same bound the schema enforces.Root cause
src/core/interaction/clip-interaction.ts— symmetricMAX_DIMENSION: 3840clamp.src/core/ui/selection-handles.ts:567— pointer-up callsedit.commitClipUpdate(...).src/core/edit-session.ts:1062—ResolvedClipSchema.parse(finalConfig)throws synchronously.@shotstack/schemas/zod—width: z.number().lte(3840),height: z.number().lte(2160).Sentry
Top issue by volume on dashboard-v2: DASHBOARD-V2-29 — 1,690 captured events / 14 days at 5% sample rate (~34k actual occurrences).
Test plan
npx jest tests/clip-interaction.test.ts— 56 / 56 pass (assertions updated to use the new constants; the 3840×3840 boundary case now expects the legal 3840×2160 maximum).npm run typecheck— clean.Out of scope (deliberate, YAGNI)
safeParsemigration inedit-session.ts— once the clamp matches the schema, the throw path is unreachable.ClipUpdateRejected) — nothing subscribes to it.