Wordpress-android: IllegalArgumentException: [EditPostActivity] not attached to window manager

Created on 1 Oct 2020  路  6Comments  路  Source: wordpress-mobile/WordPress-Android

Sentry Url: https://sentry.io/share/issue/03fe12bff0a8429d936665b30910c200/
User Count: 200
Count: 246
First Release: org.wordpress.[email protected]+920
First Seen: 2020-09-17T11:37:04Z
Last Seen: 2020-10-01T07:54:50Z
24 Hours: 42
30 Days: 246

IllegalArgumentException: View=DecorView@ec8315a[EditPostActivity] not attached to window manager
     at org.wordpress.android.editor.gutenberg.GutenbergEditorFragment.hideSavingProgressDialog(GutenbergEditorFragment.java:935)
     at org.wordpress.android.ui.posts.EditPostActivity.lambda$updateAndSavePostAsyncOnEditorExit$16(EditPostActivity.java:1601)
     at org.wordpress.android.ui.posts.-$$Lambda$EditPostActivity$EdCXO7W5A5ZADiksnSdosr5m3QE.onPostUpdatedFromUI(null:6)
     at org.wordpress.android.ui.posts.EditPostActivity.lambda$updateAndSavePostAsync$15(EditPostActivity.java:1571)
     at org.wordpress.android.ui.posts.-$$Lambda$EditPostActivity$ZG_Jw9txlRYaZ-qVEi4LxIeTO28.invoke(null:6)
     at org.wordpress.android.ui.posts.EditPostRepository$updateAsync$1.invokeSuspend(EditPostRepository.kt:128)
...
(10 additional frame(s) were not displayed)
PostinEditing [Pri] Blocking [Type] Crash

Most helpful comment

I'm able to consistently reproduce the issue.

  1. Turn on "Don't keep activities" settings
  2. Optional: Add delay(2000) to this line https://github.com/wordpress-mobile/WordPress-Android/blob/3984a4f8d9aa7090d93dd79aa050c8358475a811/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostRepository.kt#L122
  3. Open editor
  4. Type something
  5. Click on the up arrow
  6. Press home button
  7. Wait 2 seconds
  8. Notice the crash in the logs

All 6 comments

This one has been growing steadily since September 17th (now 423 users / 584 events). @hypest I see a GutenbergEditorFragment at the top of the call stack there 鈽濓笍 . Any thoughts on this one?

Yeap, looks related to the recent work on saving the post on exit from the editor. @mchowning , please dive into this one.

I'm adding the "Blocking" priority label to this one since it's about a critical flow (editing and exiting the editor) and users count is in the hudrends.

I'm able to consistently reproduce the issue.

  1. Turn on "Don't keep activities" settings
  2. Optional: Add delay(2000) to this line https://github.com/wordpress-mobile/WordPress-Android/blob/3984a4f8d9aa7090d93dd79aa050c8358475a811/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostRepository.kt#L122
  3. Open editor
  4. Type something
  5. Click on the up arrow
  6. Press home button
  7. Wait 2 seconds
  8. Notice the crash in the logs

I believe we need to check isFinishing wherever we call hideSavingProgressDialog (this line causes the crash). We also need to hide the progress dialog in onDestroy - and probably re-show the dialog after a configuration change.

One thing worth considering is to take care of this within the GutenbergEditorFragment since it's the fragment that it's actually showing the dialog.

Sorry I can't finish it myself, but I need to go AFK for a few hours.

Thank you for the steps @malinajirka! Thank you for working on a fix @mchowning! @mchowning do you need a hand finding a reviewer and how would you feel about targeting 16.0 instead of 16.1 on this one (or sooner even)? I ask because the graph is showing an upward trend with decently high daily occurrences in a short span of time.

Events in the last 90d: 1,000
Users affected in the last 90d: 782
WORDPRESS-ANDROID-QZW: https://sentry.io/share/issue/03fe12bff0a8429d936665b30910c200/

image

I'm sorry, the PR slipped through my filters. I'll review it asap and target 16.0. I think there is too many code changes for 15.9, however, I'll discuss it with Lorenzo.

Was this page helpful?
0 / 5 - 0 ratings