-
Notifications
You must be signed in to change notification settings - Fork 120
Issue/880 center point not in rectangle #1044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This issue is not limited to TIRAMISU. It happens when you "Select All" and the editor just contains empty spans. Spans that are started but do not actually contain any text/content. Another way to reproduce the crash is to start the example app with a blank editor (no EXAMPLE text)
The reason it is reproducible from the example app when you clear the Example text may be because there are a number of empty spans that are left behind after trying to clear the text. In particular many AztecVisualLinebreak spans left behind which is a separate issue. My guess is that the fix for this may be in handling onTextContextMenuItem and Aztec may need to implement its own selectAllText similar to how it custom handles cut/copy/paste. This may also fix the issue of spans being left behind when you select all of the EXAMPLE text and delete it. |
@cameocoder Thanks for the clarification! I've removed the version check in 690ae78. I'm not well-versed with this codebase, so I'll wait for someone on the team to chime in about other solutions. |
While the fix prevents the crash, if you start typing after selecting empty span, the app will hang :) As @cameocoder suggested, we can a add a bit of logic to Something like this should handle it (have not tested it extensively):
|
@khaykov Thanks for the assist! I made the changes you suggested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes 👍 . I've tested this fixes the crash
Fixes #880
We have 37 Sentry users experiencing the "IllegalArgumentException: Center point is not inside any of the rectangles" crash in Day One, all of which are on Android 13 (Tiramisu). This appears to be a platform issue rather than a problem with Aztec itself.
Update: It turns out the crash isn't limited to Android 13.
This PR resolves the problem by detecting and ignoring that crash on Android 13. I'm not well-versed with the Aztec codebase, so if there's a better way to resolve this please let me know.
To test:
In trunk, clear the example app's editor
Long press in the empty editor
Choose "Select all"
Boom!
Then pull this branch and observe the problem no longer occurs
If there are new strings that have to be translated, I have added them to the client's
strings.xml
as a part of the integration PR.