Summary
The wrapper diffs prop changes by stringifying option objects and comparing the strings (src/ImageEditor.tsx, remountKey / updatableKey). This is fragile and can cause bad behavior.
Severity: P1 (correctness / data loss)
Problem
- Key-order sensitivity — semantically identical
options objects that differ only in property declaration order produce different strings → a spurious remount (the README explicitly warns remount-tier options destroy unsaved edits, so this is silent data loss) or a spurious updateOptions call.
- Drops
undefined / functions — JSON.stringify silently omits them, so real changes inside options can be invisible to the diff → stale editor configuration without any warning.
- Throws on circular references — a circular reference inside
options crashes during render.
Verification
- Code-proven from
src/ImageEditor.tsx (lines around remountKey / updatableKey). Reproduced logically; no runtime repro shipped.
Suggested fix
Use structural deep-equality or a canonical form (stable, sorted-key serialization); compare values, not raw strings. Keep the repo's 100% coverage threshold by adding tests for the key-order and dropped-field cases.
Summary
The wrapper diffs prop changes by stringifying option objects and comparing the strings (
src/ImageEditor.tsx,remountKey/updatableKey). This is fragile and can cause bad behavior.Severity: P1 (correctness / data loss)
Problem
optionsobjects that differ only in property declaration order produce different strings → a spurious remount (the README explicitly warns remount-tier options destroy unsaved edits, so this is silent data loss) or a spuriousupdateOptionscall.undefined/ functions —JSON.stringifysilently omits them, so real changes insideoptionscan be invisible to the diff → stale editor configuration without any warning.optionscrashes during render.Verification
src/ImageEditor.tsx(lines aroundremountKey/updatableKey). Reproduced logically; no runtime repro shipped.Suggested fix
Use structural deep-equality or a canonical form (stable, sorted-key serialization); compare values, not raw strings. Keep the repo's 100% coverage threshold by adding tests for the key-order and dropped-field cases.