lambdasoup / watchlater

Android app for adding videos to your Watch Later list
https://github.com/lambdasoup/watchlater
GNU General Public License v3.0
15 stars 1 forks source link

Responses from YouTube API may fail in unexpected ways #25

Closed strooooke closed 8 years ago

strooooke commented 8 years ago

Observed:

12-17 15:24:01.123 10900-11271/com.lambdasoup.watchlater D/Retrofit: ---> HTTP GET https://www.googleapis.com/youtube/v3/channels?part=contentDetails,snippet&maxResults=50&mine=true
12-17 15:24:01.123 10900-11271/com.lambdasoup.watchlater D/Retrofit: Authorization: Bearer XXXXXXXXXXXXXXXXX
12-17 15:24:01.123 10900-11271/com.lambdasoup.watchlater D/Retrofit: ---> END HTTP (no body)
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: <--- HTTP 200 https://www.googleapis.com/youtube/v3/channels?part=contentDetails,snippet&maxResults=50&mine=true (132ms)
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: OkHttp-Selected-Protocol: h2
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: expires: Thu, 17 Dec 2015 14:24:08 GMT
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: date: Thu, 17 Dec 2015 14:24:08 GMT
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: cache-control: private, max-age=300, must-revalidate, no-transform
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: etag: "kuL0kDMAqRo3pU7O0pwlO-Lfzp4/TjcejXDE4MTg8Poo7zs699673FI"
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: vary: Origin
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: vary: X-Origin
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: content-type: application/json; charset=UTF-8
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: x-content-type-options: nosniff
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: x-frame-options: SAMEORIGIN
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: x-xss-protection: 1; mode=block
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: content-length: 191
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: server: GSE
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: alternate-protocol: 443:quic,p=1
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: alt-svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: OkHttp-Sent-Millis: 1450362241124
12-17 15:24:01.256 10900-11271/com.lambdasoup.watchlater D/Retrofit: OkHttp-Received-Millis: 1450362241256
12-17 15:24:01.257 10900-11271/com.lambdasoup.watchlater D/Retrofit: {
                                                                      "kind": "youtube#channelListResponse",
                                                                      "etag": "\"kuL0kDMAqRo3pU7O0pwlO-Lfzp4/TjcejXDE4MTg8Poo7zs699673FI\"",
                                                                      "pageInfo": {
                                                                       "totalResults": 0,
                                                                       "resultsPerPage": 0
                                                                      },
                                                                      "items": []
                                                                     }
12-17 15:24:01.257 10900-11271/com.lambdasoup.watchlater D/Retrofit: <--- END HTTP (191-byte body)
12-17 15:24:01.264 10900-10900/com.lambdasoup.watchlater D/AndroidRuntime: Shutting down VM
12-17 15:24:01.264 10900-10900/com.lambdasoup.watchlater E/AndroidRuntime: FATAL EXCEPTION: main
                                                                           Process: com.lambdasoup.watchlater, PID: 10900
                                                                           java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
                                                                               at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
                                                                               at java.util.ArrayList.get(ArrayList.java:308)
                                                                               at com.lambdasoup.watchlater.AddActivity$3.success(AddActivity.java:473)
                                                                               at com.lambdasoup.watchlater.AddActivity$3.success(AddActivity.java:470)
                                                                               at retrofit.CallbackRunnable$1.run(CallbackRunnable.java:45)
                                                                               at android.os.Handler.handleCallback(Handler.java:739)
                                                                               at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                               at android.os.Looper.loop(Looper.java:148)
                                                                               at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                               at java.lang.reflect.Method.invoke(Native Method)
                                                                               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
strooooke commented 8 years ago

Depends on the used account - fails with test.2, works with test.1