stefan-niedermann / nextcloud-deck

📋 Android client for nextcloud deck app
https://play.google.com/store/apps/details?id=it.niedermann.nextcloud.deck.play
GNU General Public License v3.0
500 stars 53 forks source link

Crash on account selection (new installation from fdroid) #1428

Open SublimeProphets opened 1 year ago

SublimeProphets commented 1 year ago

Steps to reproduce

  1. Installation of latest version 1.21.6. from fdroid (nextcloud app 3.23.0 already installed and configured since a long time)
  2. app starts up normal
  3. hit button "account selection"
  4. choose an account
  5. allow access to account (android notification accepted)
  6. wild crash appears

Expected behaviour

Should work i guess, not sure what to expect afterwards, probably some decks ;-)

Actual behaviour

Crashes with following error response

App Version: 1.21.6
App Version Code: 1021006
Server App Version: 1.7.3
App Flavor: fdroid

Files App Version Code: 30230090

---

OS Version: 4.9.332-perf+(gms-edfd6a4e)
OS API Level: 30
Device: FP3
Manufacturer: Fairphone
Model (and Product): FP3 (FP3)

---

it.niedermann.nextcloud.deck.exceptions.TraceableException: Sorry, a wild error appeared!

⚠️ If you want to tell us about the following issue, please make sure to censor sensitive data beforehand! ⚠️

Failed to run traceable code with arguments:
{"participant":{"primaryKey":"admin","uid":"admin","displayname":"admin","type":0},"type":0,"boardId":3,"permissionEdit":null,"permissionShare":null,"permissionManage":null,"owner":false,"id":1}
Cause: JsonNull
    at it.niedermann.nextcloud.deck.api.JsonToEntityParser.parseAcl(JsonToEntityParser.java:378)
    at it.niedermann.nextcloud.deck.api.JsonToEntityParser.lambda$parseBoard$8(JsonToEntityParser.java:327)
    at it.niedermann.nextcloud.deck.api.JsonToEntityParser$$ExternalSyntheticLambda12.run(Unknown Source:6)
    at it.niedermann.nextcloud.deck.exceptions.TraceableException.makeTraceableIfFails(TraceableException.java:13)
    at it.niedermann.nextcloud.deck.api.JsonToEntityParser.parseBoard(JsonToEntityParser.java:285)
    at it.niedermann.nextcloud.deck.api.JsonToEntityParser.parseJsonObject(JsonToEntityParser.java:51)
    at it.niedermann.nextcloud.deck.api.NextcloudArrayDeserializer.deserialize(NextcloudArrayDeserializer.java:36)
    at it.niedermann.nextcloud.deck.api.NextcloudArrayDeserializer.deserialize(NextcloudArrayDeserializer.java:18)
    at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:76)
    at com.google.gson.Gson.fromJson(Gson.java:1214)
    at com.google.gson.Gson.fromJson(Gson.java:1124)
    at com.google.gson.Gson.fromJson(Gson.java:1094)
    at com.nextcloud.android.sso.api.NextcloudAPI.convertStreamToTargetEntity(NextcloudAPI.java:159)
    at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$com-nextcloud-android-sso-api-NextcloudAPI(NextcloudAPI.java:130)
    at com.nextcloud.android.sso.api.NextcloudAPI$$ExternalSyntheticLambda0.subscribe(Unknown Source:6)
    at io.reactivex.internal.operators.observable.ObservableFromPublisher.subscribeActual(ObservableFromPublisher.java:31)
    at io.reactivex.Observable.subscribe(Observable.java:12284)
    at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
    at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:38)
    at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:26)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    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:923)
Caused by: java.lang.UnsupportedOperationException: JsonNull
    at com.google.gson.JsonElement.getAsBoolean(JsonElement.java:162)
    at it.niedermann.nextcloud.deck.api.JsonToEntityParser.lambda$parseAcl$9(JsonToEntityParser.java:386)
    at it.niedermann.nextcloud.deck.api.JsonToEntityParser$$ExternalSyntheticLambda15.run(Unknown Source:4)
    at it.niedermann.nextcloud.deck.exceptions.TraceableException.makeTraceableIfFails(TraceableException.java:13)
    ... 24 more

Stock or custom OS?

Android 11 Stock

Using a reverse proxy?

Yes

Additional information

Initially about 1 year ago with only one nextcloud account on my android it did NOT work as well... Many updates and with clean reinstallation still won't work.

Versions

Smartphone (please complete the following information):

stefan-niedermann commented 1 year ago

Hmm, looks like the Deck server app has some incorrect behavior and responds woth null in your case.

We will check this and maybe can workaround this bug.

In the meantime would you please try creating a blank new user and try importing this to the Deck Android app? Make sure to clear the storage of the Deck Android app first as explained in the FAQ.

SublimeProphets commented 1 year ago

Hi @stefan-niedermann Sorry for the delay till my test, had very busy days.

Updated Nextcloud Android to 3.24.1 and tried it again with a new, blank user. This actually worked as expected and login was easily possible without any failure.

Then i tried it with an older user with access to a single but extensive Deck-borad - this worked too!

But when I want to use my my main account with 10 decks and 400+ cards, i still provides me with the same error as described before.