wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.92k stars 1.3k forks source link

IllegalViewOperationException: Unable to execute operation dispatchViewManagerCommand on view with tag: 159, since the view does... #10491

Closed sentry-io[bot] closed 3 years ago

sentry-io[bot] commented 4 years ago

Sentry Issue: WORDPRESS-ANDROID-1TS

IllegalViewOperationException: Unable to execute operation dispatchViewManagerCommand on view with tag: 159, since the view does not exists
    at com.facebook.react.uimanager.UIImplementation.assertViewExists(UIImplementation.java:867)
    at com.facebook.react.uimanager.UIImplementation.dispatchViewManagerCommand(UIImplementation.java:747)
    at com.facebook.react.uimanager.UIManagerModule.dispatchCommand(UIManagerModule.java:660)
    at com.facebook.react.uimanager.UIManagerModule.dispatchViewManagerCommand(UIManagerModule.java:655)
    at java.lang.reflect.Method.invoke(Method.java)
...
(9 additional frame(s) were not displayed)

Unable to execute operation dispatchViewManagerCommand on view with tag: 159, since the view does not exists
JavonDavis commented 4 years ago

@daniloercoli do you think this is related to #8838 ?

designsimply commented 4 years ago

90-day impact: ~23 per day Users affected in the last 90 days: 1600 https://sentry.io/share/issue/132814a30e254edf9689f79eb92fb9c7/

daniloercoli commented 4 years ago

Yes, it sounds pretty similar to me. Hope we will get the ability to include testing steps, otherwise could be a bit hard to reproduce the problem.

(Note: we should try to repro the problem by rotating the device while a modal view is on the screen. it may trigger this error on Android)

designsimply commented 4 years ago

90-day impact: ~32 per day Users affected in the last 90 days: 2200 https://sentry.io/share/issue/132814a30e254edf9689f79eb92fb9c7/

designsimply commented 4 years ago

90-day impact: ~41 per day Users affected in the last 90 days: 2500 https://sentry.io/share/issue/132814a30e254edf9689f79eb92fb9c7/

malinajirka commented 4 years ago

I was able to reproduce this bug on both emulator and my hw device.

gb-critical-crash

  1. Create a new post
  2. Add an image block
  3. Click on the "bin" on the image block
  4. Boom

Emulator API 28 Pixel 3 API 29

maxme commented 4 years ago

Looks similar to https://github.com/wordpress-mobile/WordPress-Android/issues/8838

malinajirka commented 4 years ago

Full error stack trace in case it'd be useful https://justpaste.it/57ypn

daniloercoli commented 4 years ago

I can reproduce the problem on other blocks too. I think the culprit is on the first "empty" block we show on empty editor. Sometime the problem doesn't happen on the 1st removal of the block, but the 2nd time.

Steps to repro - Case A

Steps to repro - Case B

designsimply commented 4 years ago

Ditto. I was able to see the editor stop after removing any "empty" block once or twice and when that happens in the app I see the "WordPress keep stopping" error pop up:

Screenshot_20191113-111333

Tested with WPAndroid 13.6-rc-3 on Pixel 3 Android 10.

marecar3 commented 4 years ago

Hey @designsimply it seems that it's very similar to: https://github.com/wordpress-mobile/gutenberg-mobile/issues/1549

designsimply commented 4 years ago

Yes! It does! I'll close https://github.com/wordpress-mobile/gutenberg-mobile/issues/1549 in favor of this issue. Thank you @marecar3!

mkevins commented 4 years ago

I just encountered this while testing the gutenberg-mobile release/1.17 branch via WordPress-Android develop, and also reproduced on the demo app, and on gutenberg-mobile develop.

I think @daniloercoli is correct:

I think the culprit is on the first "empty" block we show on empty editor.

It may have something to do with when an empty paragraph block is replaced by the new block from the appender. There's a subtle pattern about which blocks can "trigger" the bug:

Steps:

  1. Add empty paragraph block
  2. Add SOME_NEW_BLOCK
  3. Tap trash can on SOME_NEW_BLOCK

Results:

SOME_NEW_BLOCK Result Result after tapping inner EditText
Paragraph :heavy_check_mark:
Heading :heavy_check_mark:
Image :boom: :heavy_check_mark:
Video :boom: :heavy_check_mark:
List :heavy_check_mark:
Quote :heavy_check_mark:
Code :heavy_check_mark:
More :boom:
Page Break :boom:
Separator :boom:
Media & Text :boom: :heavy_check_mark:
Group :boom:
Spacer :boom:

The pattern seems to be that the crash does not occur for blocks that have an EditText, and does occur for blocks that don't have an EditText. The exception is Media & Text. Interestingly, tapping trash icon on Media & Text crashes, but if you first tap the inner text within the Media & Text block (so the caret appears), then tap outside, the block can be deleted without a crash. Also, if I tap the caption (so the caret appears) on either an Image or Video block, the crash does not occur.

hypest commented 4 years ago

Awesome table @mkevins, thanks for being elaborate there!

FWIW, I tried some of those cases and confirmed your results. Also, I've confirmed that @marecar3's proposed fix (https://github.com/wordpress-mobile/WordPress-Android/pull/10800) fixes those cases 🎉

designsimply commented 4 years ago

Users affected in the last 90 days: 5200 https://sentry.io/share/issue/132814a30e254edf9689f79eb92fb9c7/

I can see the numbers of crashes diminishing in the Sentry Last 30 Days graph 🎉 but I am not sure at what point it's okay to close this issue.

Screen Shot 2019-12-18 at Dec 18 11 56 04 AM
malinajirka commented 4 years ago

I can confirm that this issue was most probably fixed in 13.8. I'm closing it for now, we can reopen it, if it appears again in version >=13.8.

malinajirka commented 4 years ago

It seems it still sometime crashes in 13.8. However, the frequency went down significantly. I'm reopening the issue for transparency, but I'd suggest checking the number of occurrences in version 13.8+13.9 in about 3 weeks and reconsider whether it's even worth fixing.

designsimply commented 4 years ago

Users affected in the last 90 days: 5400 https://sentry.io/share/issue/132814a30e254edf9689f79eb92fb9c7/

cameronvoell commented 4 years ago

Here is another graph showing the effect of https://github.com/wordpress-mobile/gutenberg-mobile/pull/1582 being released to the Play Store around November 30th. image

In other graphs, you can see that we're still getting around 40-50 crashes per day with a similar stack trace, but I can not reproduce it with the steps mentioned in this issue so far. image

I tried the steps outlined in this comment https://github.com/wordpress-mobile/WordPress-Android/issues/10491#issuecomment-554217851 with most of the blocks mentioned there, and could not get a crash.

I noticed the prior fix for the crash produced by the steps outlined above seemed a little unintuitive without background info (adding OS: 'native', to our platform.android.js/platform.ios.js files). Perhaps @marecar3 or @SergioEstevao can weigh in on how this PR: https://github.com/WordPress/gutenberg/pull/18539/files fixed the majority of these crashes before, and whether that provides any hints into how we can fix, or find steps for the remaining 40-50 crashes happening per day with a similar stack trace.

designsimply commented 4 years ago

Events in the last 90 days: 13,000 Users affected in the last 90 days: 5,700 https://sentry.io/share/issue/132814a30e254edf9689f79eb92fb9c7/

designsimply commented 4 years ago

268 events have been tracked for this crash in 14.6.1 since it was released 9d ago on Apr 22.

Number of users affected in the last 90d: 3,400 https://sentry.io/share/issue/132814a30e254edf9689f79eb92fb9c7/

designsimply commented 3 years ago

759 events have been tracked for this crash in 14.7 and 14.7.1 since they were released 15d and 4d ago respectively.

Events in the last 90d: 17,000 Events in the last 15d for 14.7: 487 Events in the last 4d for 14.7.1: 272 Users affected in the last 90d: 3,900 Note: several Redmi devices are affected but I'm not sure if it's a significant enough number https://sentry.io/share/issue/132814a30e254edf9689f79eb92fb9c7/

designsimply commented 3 years ago

Seeing an upward trend (not drastic but still) on this one in the last 90d, and the high volume of users affected is concerning.

Screen Shot 2020-05-19 at May 19 5 40 50 PM
Tug commented 3 years ago

We encountered that issue while testing. It's actually quite easy to reproduce: From a blank page, add columns, a header block inside one column. Remove header block after focusing it, then focus on the column and tap the cog icon. You should experience it.

I was also able to experience it while testing the homepage for the vesta template, here's a quick video

device-2020-12-11-215519 2020-12-11 22_24_00

lukewalczak commented 3 years ago

At first glance it's related to removing nested block based on RichText since I was not able to reproduce the crash via nesting and removing other blocks such as Code or Read More. Will continue the investigation

AliYar-Khan commented 2 years ago

this is happening again but I am using a native component ... while calling this UIManager.dispatchViewManagerCommand(this.handlerRef, "init", []); my app crashesh with same error