Piwigo / Piwigo-Android

Piwigo Native Android App
GNU General Public License v3.0
140 stars 43 forks source link

Crash on malformed JSON #180

Closed ramack closed 4 years ago

ramack commented 4 years ago

Describe the bug and how to reproduce

APP_VERSION_CODE=102
APP_VERSION_NAME=1.0.2
USER_COMMENT=null
SHARED_PREFERENCES=default.acra.legacyAlreadyConvertedTo4.8.0=true
    default.acra.legacyAlreadyConvertedToJson=true
    default.acra.lastVersionNr=102
ANDROID_VERSION=9
CUSTOM_DATA=
STACK_TRACE=com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
    at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1568)
    at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1409)
    at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:593)
    at com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:207)
    at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:39)
    at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:27)
    at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:225)
    at retrofit2.OkHttpCall.execute(OkHttpCall.java:188)
    at retrofit2.adapter.rxjava.CallExecuteOnSubscribe.call(CallExecuteOnSubscribe.java:40)
    at retrofit2.adapter.rxjava.CallExecuteOnSubscribe.call(CallExecuteOnSubscribe.java:24)
    at rx.Observable.unsafeSubscribe(Observable.java:10256)
    at rx.internal.operators.OperatorSubscribeOn$SubscribeOnSubscriber.call(OperatorSubscribeOn.java:100)
    at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:230)
    at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:459)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:764)
Valou447 commented 4 years ago

This happens when you enter an invalid address which is returning nothing wanted, but is likely to cause no crash as it is caught and explained in the Details dialog..

For example, "https://netflix.com" returns such response.

ramack commented 4 years ago

So this is not a real crash I'd say, just a user pushing "REPORT" in the details after entering an invalid URL... #182 will make it more clear.

If none objects, I propose to close this one here in a few days.

ramack commented 4 years ago

wait: maybe in that report ACRA mail we should (beside #182) additionally transmit the URL that the user tried, to be able to add more "guessing" of piwigo URLs, similar to

ramack commented 4 years ago

additional things done in 7adb857010ac52bfeb268eb59354e204b6da82ba