Skip to content
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

Gutenberg editor crash while selecting media and rotating #10700

Closed
hypest opened this issue Oct 25, 2019 · 4 comments
Closed

Gutenberg editor crash while selecting media and rotating #10700

hypest opened this issue Oct 25, 2019 · 4 comments
Assignees

Comments

@hypest
Copy link
Contributor

hypest commented Oct 25, 2019

Expected behavior

Should be able to select media (image or video) and rotate the device while in the process.

Actual behavior

App crashes if a rotation has occurred while picking an image/video.

Steps to reproduce the behavior

  1. Start a new Gutenberg post or open an existing one
  2. Add an image block or "edit" (pencil toolbar button) an existing one
  3. Select "Choose from device" or "WordPress Media Library". A media picker comes up.
  4. Rotate the device
  5. Select an image from the picker
  6. 💥 the app crashes

Stacktrace:

2019-10-25 13:02:49.032 7940-7940/? E/WindowManager: android.view.WindowLeaked: Activity org.wordpress.android.ui.posts.EditPostActivity has leaked window DecorView@515a25a[EditPostActivity] that was originally added here
        at android.view.ViewRootImpl.<init>(ViewRootImpl.java:511)
        at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:346)
        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
        at android.app.Dialog.show(Dialog.java:329)
        at com.facebook.react.views.modal.ReactModalHostView.showOrUpdate(ReactModalHostView.java:266)
        at com.facebook.react.views.modal.ReactModalHostManager.onAfterUpdateTransaction(ReactModalHostManager.java:108)
        at com.facebook.react.views.modal.ReactModalHostManager.onAfterUpdateTransaction(ReactModalHostManager.java:29)
        at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:47)
        at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:268)
        at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:198)
        at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:838)
        at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:952)
        at com.facebook.react.uimanager.UIViewOperationQueue.access$2200(UIViewOperationQueue.java:44)
        at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1012)
        at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
        at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:172)
        at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:84)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:947)
        at android.view.Choreographer.doCallbacks(Choreographer.java:761)
        at android.view.Choreographer.doFrame(Choreographer.java:693)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6718)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
2019-10-25 13:02:49.210 632-1187/? D/SurfaceFlinger: duplicate layer name: changing org.wordpress.android/org.wordpress.android.ui.posts.EditPostActivity to org.wordpress.android/org.wordpress.android.ui.posts.EditPostActivity#1
2019-10-25 13:02:49.362 7940-7940/? D/AndroidRuntime: Shutting down VM
    
    
    --------- beginning of crash
2019-10-25 13:02:49.362 7940-7940/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.wordpress.android, PID: 7940
    java.lang.IllegalArgumentException: View=DecorView@515a25a[EditPostActivity] not attached to window manager
        at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:485)
        at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:394)
        at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:124)
        at android.app.Dialog.dismissDialog(Dialog.java:375)
        at android.app.Dialog.dismiss(Dialog.java:358)
        at com.facebook.react.views.modal.ReactModalHostView.dismiss(ReactModalHostView.java:138)
        at com.facebook.react.views.modal.ReactModalHostView.onDropInstance(ReactModalHostView.java:130)
        at com.facebook.react.views.modal.ReactModalHostManager.onDropViewInstance(ReactModalHostManager.java:57)
        at com.facebook.react.views.modal.ReactModalHostManager.onDropViewInstance(ReactModalHostManager.java:29)
        at com.facebook.react.uimanager.NativeViewHierarchyManager.dropView(NativeViewHierarchyManager.java:622)
        at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:491)
        at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:228)
        at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:844)
        at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:952)
        at com.facebook.react.uimanager.UIViewOperationQueue.access$2200(UIViewOperationQueue.java:44)
        at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1012)
        at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
        at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:172)
        at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:84)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:947)
        at android.view.Choreographer.doCallbacks(Choreographer.java:761)
        at android.view.Choreographer.doFrame(Choreographer.java:693)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6718)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Tested on [device], Android [version], WPAndroid [version]

Tested on Pixel 2XL, Android 9, WPAndroid v13.4

@designsimply
Copy link
Contributor

Note: we need to take another pass at this and build on the work done so far in #10383.

@hypest
Copy link
Contributor Author

hypest commented Feb 28, 2020

Assigning to @mkevins since there's already a Draft PR ongoing.

@designsimply
Copy link
Contributor

I tried the testing steps today using WPAndroid 14.7-rc-3 and didn't see a crash. 🎉

@mkevins, I noticed #10383 shipped in 14.6. Would you say this issue is ok to close now?

@mkevins
Copy link
Contributor

mkevins commented May 3, 2020

Thanks for following up and testing this one @designsimply 😃 . I think we can close this one, since it looks like #10383 fixed this rotation crash as well 🎉 .

@mkevins mkevins closed this as completed May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants