-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
JSApplicationIllegalArgumentException: Error while updating property 'text' of a view managed by: RCTAztecView #9832
Comments
30-day impact: ~31 per day https://sentry.io/share/issue/c467f624ddc244c593cf6442ae7d3cc2/ ~Approx. number of crashes went from ~10/day to |
@malinajirka certainly! 👍 I'll look into it. |
There are a few There is a comment here that may be relevant: https://github.com/WordPress/gutenberg/blob/master/packages/rich-text/src/component/index.native.js#L800 as it describes a workaround used in Gutenberg code to avoid setting the selection out of bounds. It works by anticipating |
Another potential clue on this crash is that many of the exceptions are "off-by-one". I have been using the following #!/bin/bash
jq '
(
.exception.values[]
| select( .type | contains("IndexOutOfBoundsException") )
| {
value,
offBy: ( [.value | capture("(?<n>\\d+)"; "g")]
| map(.n|tonumber)
| .[2]-.[1]
),
modules: (.stacktrace.frames[-7:]
#| map(.function)
#| map(.abs_path)
| map(.module)
#| map(.in_app)
#| map(.lineno)
#| map(.filename)
#|join(",")
)
}
) +
( { breadcrumbs:
[
.breadcrumbs.values[]
#| select( .message | contains("WordPress-EDITOR") )
| select( .message | contains("will be trimmed for spaces") )
#| select( .message | contains("Processed HTML") )
| .message
][-1]
} )
' Via |
8 of the 14 cases listed have an IndexOutOfBoundsException caused by the index being off by 1: Parsed output{
"value": "setSpan (29 ... 29) ends beyond length 28",
"offBy": -1
}
{
"value": "setSpan (426 ... 426) ends beyond length 425",
"offBy": -1
}
{
"value": "setSpan (481 ... 481) ends beyond length 480",
"offBy": -1
}
{
"value": "setSpan (345 ... 345) ends beyond length 319",
"offBy": -26
}
{
"value": "setSpan (52 ... 52) ends beyond length 31",
"offBy": -21
}
{
"value": "setSpan (126 ... 126) ends beyond length 125",
"offBy": -1
}
{
"value": "setSpan (187 ... 187) ends beyond length 186",
"offBy": -1
}
{
"value": "setSpan (335 ... 335) ends beyond length 327",
"offBy": -8
}
{
"value": "setSpan (326 ... 326) ends beyond length 325",
"offBy": -1
}
{
"value": "setSpan (4 ... 4) ends beyond length 1",
"offBy": -3
}
{
"value": "setSpan (57 ... 57) ends beyond length 56",
"offBy": -1
}
{
"value": "setSpan (143 ... 143) ends beyond length 132",
"offBy": -11
}
{
"value": "setSpan (664 ... 664) ends beyond length 663",
"offBy": -1
}
{
"value": "setSpan (341 ... 341) ends beyond length 339",
"offBy": -2
} |
I noticed that in some cases, the modules listed in the stacktrace leading up to Also, it is a bit puzzling to see that this crash sometimes occurs, even when the breadcrumbs show that Parsed output{
"value": "setSpan (29 ... 29) ends beyond length 28",
"offBy": -1,
"modules": [
"android.widget.EditText",
"android.widget.TextView",
"android.text.Selection",
"android.text.Selection",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder"
],
"breadcrumbs": null
}
{
"value": "setSpan (426 ... 426) ends beyond length 425",
"offBy": -1,
"modules": [
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"android.widget.EditText",
"android.text.Selection",
"android.text.Selection",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder"
],
"breadcrumbs": null
}
{
"value": "setSpan (481 ... 481) ends beyond length 480",
"offBy": -1,
"modules": [
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"android.widget.EditText",
"android.text.Selection",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder"
],
"breadcrumbs": null
}
{
"value": "setSpan (345 ... 345) ends beyond length 319",
"offBy": -26,
"modules": [
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"android.widget.EditText",
"android.text.Selection",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder"
],
"breadcrumbs": "w/WordPress-EDITOR: RichText value will be trimmed for spaces! Avoiding setting the caret position manually."
}
{
"value": "setSpan (52 ... 52) ends beyond length 31",
"offBy": -21,
"modules": [
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"android.widget.EditText",
"android.widget.TextView",
"android.text.Selection",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder"
],
"breadcrumbs": null
}
{
"value": "setSpan (126 ... 126) ends beyond length 125",
"offBy": -1,
"modules": [
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"android.widget.EditText",
"android.widget.TextView",
"android.text.Selection",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder"
],
"breadcrumbs": null
}
{
"value": "setSpan (187 ... 187) ends beyond length 186",
"offBy": -1,
"modules": [
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"android.widget.EditText",
"android.text.Selection",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder"
],
"breadcrumbs": null
}
{
"value": "setSpan (335 ... 335) ends beyond length 327",
"offBy": -8,
"modules": [
"android.widget.EditText",
"android.widget.TextView",
"android.text.Selection",
"android.text.Selection",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder"
],
"breadcrumbs": "w/WordPress-EDITOR: RichText value will be trimmed for spaces! Avoiding setting the caret position manually."
}
{
"value": "setSpan (326 ... 326) ends beyond length 325",
"offBy": -1,
"modules": [
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"android.widget.EditText",
"android.text.Selection",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder"
],
"breadcrumbs": null
}
{
"value": "setSpan (4 ... 4) ends beyond length 1",
"offBy": -3,
"modules": [
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"android.widget.EditText",
"android.text.Selection",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder"
],
"breadcrumbs": null
}
{
"value": "setSpan (57 ... 57) ends beyond length 56",
"offBy": -1,
"modules": [
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"android.widget.EditText",
"android.widget.TextView",
"android.text.Selection",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder"
],
"breadcrumbs": null
}
{
"value": "setSpan (143 ... 143) ends beyond length 132",
"offBy": -11,
"modules": [
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"android.widget.EditText",
"android.widget.TextView",
"android.text.Selection",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder"
],
"breadcrumbs": null
}
{
"value": "setSpan (664 ... 664) ends beyond length 663",
"offBy": -1,
"modules": [
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"android.widget.EditText",
"android.widget.TextView",
"android.text.Selection",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder"
],
"breadcrumbs": null
}
{
"value": "setSpan (341 ... 341) ends beyond length 339",
"offBy": -2,
"modules": [
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"org.wordpress.mobile.ReactNativeAztec.ReactAztecManager",
"android.widget.EditText",
"android.text.Selection",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder",
"android.text.SpannableStringBuilder"
],
"breadcrumbs": null
} |
I also noticed that some, but not all of the cases had a breadcrumb with a message containing |
I merged all the issues to one in Sentry. Here are the updated numbers for reference. 90-day impact: ~111 per day https://sentry.io/share/issue/91a4511e98264a9b97a16db7b5486a36/ |
90-day impact: ~200 per day https://sentry.io/share/issue/91a4511e98264a9b97a16db7b5486a36/ |
👋 @mkevins , let me know if you're still working on this ticket, thanks! |
Hi @hypest 👋 I tried this next step, but was unable to reproduce using a few samples of content (from the crash reports):
Since then, I have unassigned myself. |
90-day impact: ~333 per day https://sentry.io/share/issue/91a4511e98264a9b97a16db7b5486a36/ Looks like a widespread crash happening for a lot of users. Let's raise the priority on this one. |
My first attempt on fixing this issue was based on the following idea:
I've made this branch here: https://github.com/wordpress-mobile/WordPress-Android/tree/issue/9832-Aztec-crash-Span-Out-of-bounds The key point is calling the Unfortunately when the error does happen, the ReactInstanceManager does properly call the custom handler and log the error in Sentry, but the ReactInstance does remain in a broken state, and the current block is froze. The UI is not responding anymore to the taps... I'm not going to update this proposed solution above, since it's already a bit too convoluted, and not working fine. Reporting here a suggestion by @mzorz |
Events in the last 90 days: 93,000 |
Events in the last 90 days: 100,000 |
I'll take a look at this since I have a Redmi (Xiaomi) device, I'll start by trying to reproduce the crash. |
So I had some time to test this issue reviewing the reports from Sentry. Found three cases that make the editor crash, I replaced the content with placeholder texts.
Block snippet example
Also, some of the crashes I saw were with languages other than English so maybe there's an issue with some characters. The steps to reproduce with the cases from above:
My knowledge of Aztec is pretty limited still but maybe someone else has more experience with it to know what could be happening? |
1,656 events have been tracked for this crash in 14.6.1 since it was released 9d ago on Apr 22. Events in the last 90 days: 127,000 |
@mchowning, can you put this one at the top of your attention list? Thanks! |
3,236 events have been tracked for this crash in 14.7 since it was released 15d ago on May 4. Events in the last 90d: 137,000 Update to add a graph and note that events per day looks to be steadily rising for this one: |
@geriux can you help with a code review on this one? Nice find on the steps to reproduce btw!! Thank you for the PR @mchowning. 🙇 |
So far I only opened a related issue in the gb-mobile repository, but I'm hoping to open a PR today! So there's nothing to review (quite) yet @geriux . 🙂 |
With the 14.9 release, this issue should no longer be causing a crash for our users. We have not resolved the underlying issue though, we've just stopped it from causing a crash. Any time the crash would have occurred, we are now sending a non-crashing |
Thank you @mchowning! Noting that 14.9 was released on 2020-06-01 and this 90d graph will be a good one to watch over the next few weeks. Currently, in terms of crashes in that issue in Sentry, it has gone from over 500 events per day in May to only ~100 per day in the last few days. I see that wordpress-mobile/gutenberg-mobile#2348 was opened to track the non-crashing error, @mchowning should we close this issue in favor of the new one with a link back to here for reference or do we need to watch both for the next few weeks to see what falls out? |
I don't think we need to keep this one open since there are no crashes in 14.9. I went ahead and added a comment linking to this issue in wordpress-mobile/gutenberg-mobile#2348, so I'll go ahead and close this. |
Sentry Issue:
https://sentry.io/share/issue/c467f624ddc244c593cf6442ae7d3cc2/https://sentry.io/share/issue/91a4511e98264a9b97a16db7b5486a36/ (broken link fixed 1/29/20)One way to reproduce the issue in comments below.
The text was updated successfully, but these errors were encountered: