Repository navigation
fix(ios): never lay out the selection toolbar from non-finite bounds (0.3.6) - #57
Merged
Merged
Conversation
CGRect.width reports the standardized width, so inverted or overflowing selection bounds passed the existing > 0 guard while the rect's origin and midpoints were infinite or NaN, and setting the toolbar frame raised CALayerInvalidGeometry (OpenNotes 1.2 App Store crash group). Reject non-finite rects. Also derive the podspec version from package.json so the CocoaPods version and tag never drift. Release 0.3.6.
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.
Problem
OpenNotes 1.2 App Store crash group (5 crashes, symbolicated):
Reason:
CALayerInvalidGeometry: CALayer position contains NaN.clear()kept the stale selection (fixed at the source in 0.3.5), sogetSelectionBoundsreturned±FLT_MAX.selectionBoundsInViewguarded withrect.width > 0.CGRect.widthis the standardized width, so+infpassed the check,midXbecameinf - inf = NaN, andsetFrameaborted.clear()bounds, run through the shipped toolbar math into a realCALayer, raise the sameCALayerInvalidGeometry.Fix
selectionBoundsInViewrejects non-finite rects, and is now the only place selection bounds are read. Hit-testing (selectionBoundsContain,selectionHandleHitTest,touchesBegan) andnotifySelectionChangeuse it, soonInkSelectionChangesendsnullbounds instead of NaN to JS.package.json. It was stuck at0.3.2, so the CocoaPods version andv…source tag no longer drift from the npm package.Evidence
±FLT_MAXreturnsnil, a NaN point returnsnil, and a normal selection is unchanged.swiftc -typecheckof the module passes against the iOS 26.5 simulator SDK and the React framework.typecheck,test:native:selection-smokeandtest:native:eraser-smokepass.pod ipc specreports version0.3.6, tagv0.3.6.Release
0.3.6 with a CHANGELOG entry.