Closed mzorz closed 3 years ago
I've been able to reproduce this one only a couple of times after the latest changes (I'd say 2 times out of 30 or 40 tries), with the following steps:
Going back and then opening the same block once more will give no trouble this second time.
(*) most of the times I did this frantically, I'd get the following crash on debug builds (see reasoning for this debug crash here):
2021-04-27 11:52:30.521 30979-30979/org.wordpress.android E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.wordpress.android, PID: 30979
java.lang.RuntimeException: Debug build crash: Post had changes that needed to be saved when exiting the editor, but there was an autosave pending. This can occur when the user makes changes just before exiting the editor and the autosave debouncer does not have time to fire. This only crashes on debug builds.
at org.wordpress.android.ui.posts.EditPostActivity.lambda$updateAndSavePostAsyncOnEditorExit$36$EditPostActivity(EditPostActivity.java:1740)
at org.wordpress.android.ui.posts.-$$Lambda$EditPostActivity$vJjst50aiDHnVjIfebXhKtN150Y.onPostUpdatedFromUI(Unknown Source:6)
at org.wordpress.android.ui.posts.EditPostActivity.lambda$updateAndSavePostAsync$35(EditPostActivity.java:1705)
at org.wordpress.android.ui.posts.-$$Lambda$EditPostActivity$iPAmveF4zvMghUZtc2nvk10nj_8.invoke(Unknown Source:6)
at org.wordpress.android.ui.posts.EditPostRepository$updateAsync$1.invokeSuspend(EditPostRepository.kt:128)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7660)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
2021-04-27 11:52:30.523 1798-32241/? I/DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
2021-04-27 11:52:30.523 1798-6493/? W/ActivityTaskManager: Force finishing activity org.wordpress.android/.ui.posts.EditPostActivity
At one point when I also was able to reproduce (and only once), I got this other line in the logcat:
2021-04-27 14:26:42.682 742-16693/org.wordpress.android E/WordPress-EDITOR: Impossible to save the post, we weren't able to update it.
Not sure if this is related though.
So basically, this is I think something related to:
Given how difficult it is to reproduce, and given there's no actual loss of data (it will work next time you edit the block), while the Dialog may be a bit misleading, I'm inclined to think we can close this one and open if / when we hear reports about it. Another option would be to edit the Limited Story Editing Dialog:
Current: (see here)
This story was edited on a different device and the ability to edit certain objects may be limited.
Proposed change:
This story may have been edited on a different device and the ability to edit certain objects may be limited.
Interested in hearing your thoughts @aforcier 🙏
I think given this analysis we can probably just leave this as-is, close this issue, and reopen if we hear any reports. 👍 🤝
During testing of https://github.com/Automattic/stories-android/pull/663, it happened to me several times that creating a Story then trying to edit it would offer the "Limited Story Editing" dialog, which only happens when a Story frame could not be found in Prefs or when the original background image used cannot be accessed at the time it was attempted to be loaded. The code that pre-checks this is in the
areAllStorySlidesEditable()
method in the various forms ofisValidSlide()
which can be found here.For example:
The problem here is it says it couldn't be loaded so it assumes this was not created on this handset (which is not true).
Also oftentimes, just trying again once more will work, so I wonder if this is a timing issue that the ContentResolver doesn't have the URL available at that moment.