Closed gglobalstep closed 3 years ago
Screenshots from the attachment:
Moving to WordPress-Android
for further investigation because this appears to be an issue in the Posts List or the publishing mechanism and does not appear to be an issue directly related to the editor.
Good find! Tested and confirmed using the steps provided, except I also saw some crashes. (5m11s)
Tested with WPAndroid 14.9-rc-1 on Pixel 3 Android 10.
Note: the crash I saw is being tracked at https://github.com/wordpress-mobile/WordPress-Android/issues/11992 actually this one WORDPRESS-ANDROID-C15. h/t @ashiagr for pointing me in the right direction!
After getting the page stuck in Queue, like in @designsimply's video or in Local Draft state (after app restart) trying to open it while another page is being uploaded results in a crash. replaceMediaFileWithUrlInGutenbergPost
hints that it might be something related to Gutenberg. Summoning @hypest for second opinion.
Process: org.wordpress.android, PID: 11562
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.wordpress.android/org.wordpress.android.ui.posts.EditPostActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.google.gson.JsonElement.getAsString()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.google.gson.JsonElement.getAsString()' on a null object reference
at org.wordpress.android.ui.posts.mediauploadcompletionprocessors.ImageBlockProcessor.processBlockJsonAttributes(ImageBlockProcessor.java:34)
at org.wordpress.android.ui.posts.mediauploadcompletionprocessors.BlockProcessor.processBlock(BlockProcessor.java:91)
at org.wordpress.android.ui.posts.mediauploadcompletionprocessors.MediaUploadCompletionProcessor.processBlock(MediaUploadCompletionProcessor.java:78)
at org.wordpress.android.ui.posts.mediauploadcompletionprocessors.MediaUploadCompletionProcessor.processContent(MediaUploadCompletionProcessor.java:59)
at org.wordpress.android.ui.posts.mediauploadcompletionprocessors.MediaUploadCompletionProcessor.processContent(MediaUploadCompletionProcessor.java:60)
at org.wordpress.android.ui.posts.PostUtils.replaceMediaFileWithUrlInGutenbergPost(PostUtils.java:429)
at org.wordpress.android.ui.uploads.MediaUploadReadyProcessor.replaceMediaFileWithUrlInPost(MediaUploadReadyProcessor.java:25)
at org.wordpress.android.ui.uploads.UploadService.updatePostWithMediaUrl(UploadService.java:611)
at org.wordpress.android.ui.uploads.UploadService.updatePostWithCurrentlyCompletedUploads(UploadService.java:459)
at org.wordpress.android.ui.posts.EditPostActivity.lambda$oKXGGak0_lNLvZhk4qsl8ml6C7w(Unknown Source:0)
at org.wordpress.android.ui.posts.-$$Lambda$EditPostActivity$oKXGGak0_lNLvZhk4qsl8ml6C7w.invoke(Unknown Source:2)
at org.wordpress.android.ui.posts.EditPostRepository.replace(EditPostRepository.kt:135)
at org.wordpress.android.ui.posts.EditPostActivity.initializePostObject(EditPostActivity.java:700)
at org.wordpress.android.ui.posts.EditPostActivity.onCreate(EditPostActivity.java:487)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)Ā
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)Ā
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)Ā
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)Ā
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)Ā
at android.os.Handler.dispatchMessage(Handler.java:107)Ā
at android.os.Looper.loop(Looper.java:214)Ā
at android.app.ActivityThread.main(ActivityThread.java:7356)Ā
at java.lang.reflect.Method.invoke(Native Method)Ā
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)Ā
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)Ā
Thanks for the ping @khaykov , block editor related code seems indeed involved. š @mkevins , can you help with investigating this one? Also, to help share the knowledge, can you look into this @marecar3 too and collaborate with Matt? Thanks!
Yes indeed! There's a separate issue to track the NPE in processors, and I've found at least one cause. I'm checking for others, and will have a PR soon.
Awesome job on the details for reproducing @gglobalstep and @khaykov ! I've drafted a PR for the NPEs here: https://github.com/wordpress-mobile/WordPress-Android/pull/12114 and I have a theory why the ids are null. Since the templates don't assign an id (the image is not really on the site in the media library, nor is it a local one, so it really can't have an id), the processors were choking during their DFS for the local id replacement. The PR referenced above will abort when id is null, which should be safe, as that will not modify the contents for the given block.
I was looking into this one, after some code speculation I tried to replicate it. I confirm that following the steps in @designsimply video I can replicate it with 14.9 version, but cannot replicate it anymore with current develop. Hey Sheri, maybe I'm just missing something, but can you confirm this is still an issue? Thanks š
I can replicate it with 14.9 version, but cannot replicate it anymore with current develop
Just to be sure, can you also try with latest production version (v16.0) as well @develric? To check if it is a release version issue or not. Thanks!
Hey @hypest , I tried again with released production version v16.0 (for completeness I used this release apk since I'm not reached yet from the 16.0 google play version, but I guess should be the same, correct?). I confirm I cannot reproduce the issue. Would be good if someone else can confirm it so we can decide if this is still an issue or not. Thanks š
I've tried to reproduce this via the 16.2 release branch apk, and was unable to reproduce it following the described steps. I believe this has been solved, and I think the issue can be closed. I wasn't able to see the sentry data referenced here (404). :wave: :smile: @designsimply , do you know if there is still a working link to the issue?
I looked but couldn't find a working link! Closing since it was tested several times and no one was able to replicate the bug. š
Environment: Android: Samsung Galaxy s9 (v10), Samsung Galaxy S7 (v8), Samsung Galaxy Tab A (v9). Build WPAndroid [version]: v14.9
Steps To Reproduce:
Install and launch the application.
Scenario 1 (PUBLISHED TAB):
Observe that after sometime randomly an error message "We couldn't upload this media. and didn't publish the page." is displayed for the page and it disappears after sometime.
Scenario 2 (DRAFTS TAB):
Observe that after sometime randomly an error message "We couldn't complete this action." is displayed for the page and it disappears after sometime.
Actual Result: After brief amount of time while uploading, randomly these error messages flashes for a while for following tabs: a. "We couldn't upload this media. and didn't publish the page." for PUBLISHED tab. b. "We couldn't complete this action." gets displayed for DRAFTS tab.
Expected Result: Application should any error messages when pages are getting saved in drafts or getting published.
Attachment: #2289.zip