Automattic / stories-android

Loop concept app - WP Stories library
GNU General Public License v2.0
20 stars 6 forks source link

Crash when retrying saving an errored slide more than once #672

Closed mzorz closed 3 years ago

mzorz commented 3 years ago
2021-04-29 22:27:05.470 23371-23371/org.wordpress.android D/AndroidRuntime: Shutting down VM
2021-04-29 22:27:05.473 615-615/? E/SELinux: avc:  denied  { find } for pid=17308 uid=10246 name=tethering scontext=u:r:secure_ui_service_app:s0:c246,c256,c512,c768 tcontext=u:object_r:tethering_service:s0 tclass=service_manager permissive=0
2021-04-29 22:27:05.475 23371-23371/org.wordpress.android E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.wordpress.android, PID: 23371
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.get(ArrayList.java:437)
        at com.wordpress.stories.compose.ComposeLoopFrameActivity$saveStoryPostHook$1.run(ComposeLoopFrameActivity.kt:1202)
        at com.wordpress.stories.compose.SaveButton$showSavedAnimation$1.run(SaveButton.kt:52)
        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)

Steps to reproduce:

  1. apply this patch to force an error on video slides
  2. create a Story with 1 video slide at least
  3. observe it throws an error (see error notification and the snackbar on My Sites screen if on WPandroid)
  4. tap on the notification body, on the MANAGE quick action or on the MANAGE snackbar action
  5. observe the error resolution mode in Composer Activity appears
  6. tap the errored frame, tap on RETRY, and wait for it to error again
  7. tap on RETRY once more, observe the app crashes with the logs shown above.