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
503 stars 53 forks source link

duplicated cards after offline mode #1503

Open raQai opened 1 year ago

raQai commented 1 year ago

Please use GitHub reactions πŸ‘ to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!

Describe the bug

Cards are being duplicated after coming back online when previously in offline mode. This sometimes happens multiple times resulting in 5+ copies of the same item. This happened for me with every combination of background sync and etag configuration.

Steps to reproduce the behavior:

  1. Open board
  2. Enable Airplane mode
  3. Create a new card
  4. Close the app
  5. Disable Airplane mode
  6. Open board (optional: manually sync the view)

Expected behavior

The created card (3.) should only be visible once.

Screenshots

-

Versions

Smartphone (please complete the following information):

Stacktrace

raQai commented 1 year ago

FYI: This happens a lot with an unstable connection (e.g. traveling by train). This is not tied to the Airplane mode but it can be used to consistently reproduce this.

Goldmaster commented 10 months ago

I have this issue as well. It also happens when your nextcloud instance is offline.

I do get this error due to the nextcloud instance being offline as my computer is turned off.

App Version: 1.23.4
App Version Code: 1023004
Server App Version: 1.12.0
App Flavor: fdroid

Files App Version Code: 30270090 (PROD)

---

OS Version: 4.14.113-23326020(G973FXXUEGULB)
OS API Level: 31
Device: beyond1
Manufacturer: samsung
Model (and Product): SM-G973F (beyond1lteeea)

---

com.nextcloud.android.sso.exceptions.NextcloudHttpRequestFailedException: HTTP request failed with HTTP status-code: 530
    at com.nextcloud.android.sso.api.AidlNetworkRequest.performNetworkRequestV2(AidlNetworkRequest.java:197)
    at com.nextcloud.android.sso.api.NextcloudAPI.performNetworkRequestV2(NextcloudAPI.java:180)
    at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$0$com-nextcloud-android-sso-api-NextcloudAPI(NextcloudAPI.java:122)
    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:920)
Caused by: java.lang.IllegalStateException: error code: 1033

    at com.nextcloud.android.sso.InputStreamBinder.processRequestV2(InputStreamBinder.java:454)
    at com.nextcloud.android.sso.InputStreamBinder.performNextcloudRequestAndBodyStreamV2(InputStreamBinder.java:127)
    at com.nextcloud.android.sso.InputStreamBinder.performNextcloudRequestV2(InputStreamBinder.java:110)
    at com.nextcloud.android.sso.aidl.IInputStreamService$Stub.onTransact(IInputStreamService.java:110)
    at android.os.Binder.execTransactInternal(Binder.java:1215)
    at android.os.Binder.execTransact(Binder.java:1179)

Screenshot showing card waiting to sync

michel-thomas commented 8 months ago

I also have a user with this problem. No known connection issue, but cards are duplicated several times (36 for the last card created today).

Nothing in server logs.

desperateCoder commented 2 weeks ago

Hi, and sorry for the (huge) delay! As we develop this app in our free time, life doesn't always give us room for this app.

But anyway, i managed to look into this and I think I might have found a solution.

Here's an updated version of the app: ─=≑Σ((( γ€β—•Ω„Νœβ—•)぀ APK Download

The app will install beside your real one (same icon, but with a "DEV" label on it). You'll need to connect your account, let it do the initial sync, then you can just work with it like with the real thing.

Please provide some feedback, if it changed anything for you.

Thanks in advance, have a nice weekend!

raQai commented 2 weeks ago

Hi @desperateCoder , no worries about the delay. I know that most open source projects are maintained by devs in their free time. All I could do, was to provide as much information as possible so your time is not wasted. If I had the time to walk through the code, I could have tried to provide a fix myself. So thanks a lot for the update!

Back to topic: I installed the APK locally and tried to reproduce the issue. Seems like the fix is working. At least I could not reproduce my test case described above.

desperateCoder commented 2 weeks ago

@raQai nice, thanks for the fast feedback! I'll try it myself for a while and if everything keeps working, we'll release it in near future.

Thanks for your report and the testing! ❀️