-
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
Crash when drawing the editor on devices running Android 8 #8828
Comments
Possibly related to wordpress-mobile/AztecEditor-Android#729 and wordpress-mobile/AztecEditor-Android#516 |
There's a report in 1812801-zen that seems to match up with this crash report in Fabric. The user's device is a Samsung SM-J400M and it's running on Android 8.0. The app crashes when they attempt to use voice dictation after uploading more than three photos at a time. @jkmassel: Is there any extra info from the user that'd be useful for troubleshooting this further? |
Another potential report in 1861204-zen. We had the user update to the most recent version and the problem persists. Android device name: HUAWEI GRACE |
reference: 5a76a4fa8cb3c2fa634286c6-fabric reference: 5af4233111e9fa0aa513dfa0-fabric marked as high priority as it's happening ~35 times/day and affecting ~800 users Combining stats for the last 30 days for 5a76a4fa8cb3c2fa634286c6-fabric and 5af4233111e9fa0aa513dfa0-fabric: Crashed ~90 times a day or 2844 times for 809 users in the past 30 days Feb 14 - Mar 14, 2019. Crashes are trending up for 11.9 in 5af4233111e9fa0aa513dfa0-fabric. |
I can confirm it's related to Unfortunately, it's a bug in the OS which was introduced in Android 8.0 and was fixed in Android 9.0 (https://android-review.googlesource.com/c/platform/frameworks/base/+/634929). wordpress-mobile/AztecEditor-Android#516 contains steps how to reproduce the issue. All these crashes seems related - it also seems the crash is not specific to Huawei phones. It's specific to Android 8.0 and 8.1. If we sum up all these crashes, it's definitely our #1. I can think of 3 options we have, but none of them is great.
Wdyt @daniloercoli ? |
from 1861204-zen "It's not when trying to open a specific post, but instead when trying to view the list of posts" |
It seems the issue is not only happening when opening the editor @malinajirka. Also when accessing the posts lists, accordingly to the report ^ above. |
Are we able to detect the current Android version in code, and use a different path for that? I think either of those two solutions could be applied judiciously, perhaps as a setting? I'd imagine we could detect if a user crashed in the editor on Android 8, and prompt them on next launch to enable "compatibility mode" or whatever we want to call it that fixes the issue in v8. Then, if they later upgrade to v9, we silently disable it? Typically for a simple bug we might not go to all this trouble, but it seems quite widespread. WDYT @malinajirka / @daniloercoli ? |
I've checked the ticket and I haven't found any indication it's the same crash. I might be missing something. cc @daniloercoli
Yes.
I'll try to measure the performance impact if we turn off the hardware acceleration - it's definitely the easiest and the only not-so-hacky solution. The option 2 should be considered as a last resort solution which might not be even worth it. Especially since we don't have feature flags and we won't be able to disable the "fix" if something goes wrong - which can easily happen on custom roms. We'll definitely need to consult it with other Android devs to consider the risks. I'm not sure we can somehow detect the app crashed.
However, we know it'll crash under certain circumstances on Android 8. So if we come up with a solution, we can just enable it by default on Android 8. |
Yes I think this is a good idea. Take a look at
I guess we can turn off the hardware acceleration when we detect the crash happened on Android 8. Just store a property, and disable the HW acceleration at next startup when the prop is true and Android == 8. I'm not sure about prompt the user about it, since it will be hard to explain where to go to enable the Compatibility mode, and why it's required. Maybe we can show a prompt "Compatibility mode enabled", explain why in the message, and give some info about how to turn it off in App settings. Where we should add a toggle for it. |
Extension on the above idea – given that we know how the bug is triggered, is it possible to examine the contents of a post to determine whether or not the crash will happen when the post is placed in the editor? That'd allow us to avoid that initial crash by preemptively putting Aztec in compatibility mode. WDYT? |
@jkmassel I've looked into it and I wasn't able to come up with a solution. It's definitely a good idea and I'm not saying it's not possible to somehow do it. The code which contains the bug is just really complicated + it's buried in the Android OS so we don't have access to the data. I spent a bit more time exploring the options I mentioned earlier Disable HW acceleration
IMHO disabling hw acceleration is not worth it. The bug occurs just on certain posts under specific circumstances and even if we disable it just for users who are experiencing the issue, the performance hit will affect all their posts. Copy-paste method Even though I don't like it, I give up for now. Maybe I'll come up with some more ideas how to work around it. I still hope this bug is not present in Gutenberg and it'll become less critical in the near future. |
30-day impact: ~52 times a day |
I think at this point trying this is totally worth it! I recall using this same technique back when programming for PalmOS, we can certainly do that here and see what we can find. |
90-day impact: ~84 per day https://sentry.io/share/issue/9f844f6ec25f410481e73c996cc6410f/ |
Unassigning myself from this for now, as I'll be focused on other work in the near future. For anyone who may pick this up, my rough idea of next steps is to see if UI/Application Exerciser Monkey could reproduce the crash "route(s)". I've left this unexplored, and had only considered this approach as a last resort, conditioned on a relatively low time-cost in configuring that tool. |
Found some similar issues in Sentry and merged them and here is a new count after the merge: 90-day impact: ~133 per day https://sentry.io/share/issue/9f844f6ec25f410481e73c996cc6410f/ |
I think that's a definitely a possibility @designsimply - would defer the call to @hypest @daniloercoli at this point, I think if my memory doesn't fail much, @daniloercoli came up with that same approach to workaround this or other issues before, but it was kind of difficult to make the switch back then, maybe it's easier now that Gutenberg is more developed on mobile |
Thanks! I will review this again with @daniloercoli at the Oct 14-18 Groundskeeping rotation. |
I totally agree, and this sounds like a very sensible way to mitigate the issue. |
Hey @designsimply - looking at https://sentry.io/share/issue/9f844f6ec25f410481e73c996cc6410f/ it seems that the problem is not limited to Huawei devices, but on devices running Android 8.X. Would be good to update the description of the issue with these new details. Unfortunately i don't see a reliable way to fix this issue once and for all, since the problem is deep inside the Android platform in version
We're already pushing users to the new Gutenberg mobile editor (since late August), by enabling it when a post with blocks is opened in the app. So GB mobile should be used more than before and this crash should go down shortly. Possible solutions:
I propose to just keep an eye on this crash without doing anything special at the moment:
If you think that is better to propose a fix we can go down by disabling HW acceleration on a per-post basis. I'm open to other suggestions though. |
I updated the first sentence to reflect the issue is not limited to only Huawei devices but is limited to devices running Android 8.x (and we might have started seeing the other devices when I merged Sentry issues on 2019-08-15).
Sentry should show 90 days back overall—the graph at right only shows 30, the numbers at the top and overall crashes recorded are 90. Looking at the numbers again, it looks like there are more crashes recorded for less people compared to the last time I checked. 90-day impact: ~200 per day https://sentry.io/share/issue/9f844f6ec25f410481e73c996cc6410f/ I agree the first solution you proposed is the best route if we don't see the numbers go down
I also checked the Statistics section of the Google Play Console for WPAndroid and found that on 2019-10-13 Android 8.0 are down 8.7% compared to the same day one month prior 2019-09-13 which is a check to show Android 8.0 usage for our app is indeed trending down (as expected and as you noted), and we should review the overall percentage of Android 8 users on our app (is that number ok to post publicly?) and use that to help determine whether to implement the solution to disable HW acceleration only on posts affected by this crash. |
90-day impact: ~211 per day https://sentry.io/share/issue/9f844f6ec25f410481e73c996cc6410f/
|
Consider closing with #10620 as the accepted solution. |
Fixed in #10620. See the PR for details -> |
Sentry Issue: WORDPRESS-ANDROID-2D14 |
It appears we're getting a crash specific to Android devices with Android 8.x, prevalently Huawei devices.
The relevant bits of the stack trace:
It seems likely that this is related to #8827 – both are platform-specific Android 8 issues.
reference: 5a76a4fa8cb3c2fa634286c6-fabric
reference: 5af4233111e9fa0aa513dfa0-fabric
marked as high priority as it's happening ~35 times/day and affecting ~800 users
The text was updated successfully, but these errors were encountered: