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
487 stars 52 forks source link

Continued loading-symbol and device is currently offline after already synced. #757

Closed lightlike closed 3 years ago

lightlike commented 3 years 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 Deck-App continues to load after already finishing the sync of the current deck and shows an error (see below) after waiting for about a minute for the sync-symbol to dissapear.

This error has been happening for some time but this is the first time I found an error-message (Might have overlooked that before now)

To reproduce Issue is reproducible with an account from try.nextcloud.com:

Not tested as this is not my phone. But this only happens with this phone. Other phones with the same Server are ok.

Steps to reproduce the behavior:

  1. Open App
  2. Refresh by swiping down
  3. Current deck refreshes but continues showing the loading-symbol
  4. After waiting about a Minute the error is shown at the bottom of the screen

Expected behavior Should sync properly and stop loading after finished

Versions

Smartphone:

Are you using LDAP?

Stacktrace

App Version: 1.11.1
App Version Code: 1011001
App Flavor: fdroid

Deck Server Version: 1.2.2

Files App Version Code: 30140190

---

OS Version: 4.14.113-20009869(M315FXXU2ATJA)
OS API Level: 29
Device: m31
Manufacturer: samsung
Model (and Product): SM-M315F (m31nseea)

---

it.niedermann.nextcloud.deck.exceptions.OfflineException: Device is currently offline.
    at it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter.ensureInternetConnection(ServerAdapter.java:98)
    at it.niedermann.nextcloud.deck.persistence.sync.adapters.ServerAdapter.searchGroupMembers(ServerAdapter.java:175)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.AccessControlDataProvider.lambda$getAllFromServer$0$AccessControlDataProvider(AccessControlDataProvider.java:36)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.-$$Lambda$AccessControlDataProvider$tocdbS84sgfe8EN9HbqkUjJJ2eM.doWork(Unknown Source:8)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.util.AsyncUtil.awaitAsyncWork(AsyncUtil.java:14)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.AccessControlDataProvider.getAllFromServer(AccessControlDataProvider.java:33)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper.doSyncFor(SyncHelper.java:34)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.BoardDataProvider.goDeeper(BoardDataProvider.java:120)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.providers.BoardDataProvider.goDeeper(BoardDataProvider.java:22)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(SyncHelper.java:63)
    at it.niedermann.nextcloud.deck.persistence.sync.helpers.SyncHelper$1.onResponse(SyncHelper.java:34)
    at it.niedermann.nextcloud.deck.api.RequestHelper$ResponseConsumer.accept(RequestHelper.java:62)
    at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
    at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeOnObserver.onNext(ObservableSubscribeOn.java:58)
    at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:62)
    at io.reactivex.internal.operators.observable.ObservableFromPublisher$PublisherSubscriber.onNext(ObservableFromPublisher.java:56)
    at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$NextcloudAPI(NextcloudAPI.java:111)
    at com.nextcloud.android.sso.api.-$$Lambda$NextcloudAPI$HPzOdi9LOc_f-wA9GNnhc9LKQSM.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.ObservableMap.subscribeActual(ObservableMap.java:32)
    at io.reactivex.Observable.subscribe(Observable.java:12284)
    at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
    at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
    at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
    at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
    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:919)
desperateCoder commented 3 years ago

Hi @lightlike, thanks for your report!

This is weird. The offline exception happens only if:

Do you remember if your WiFi was enabled at this time? Any chance you lost Internet connection at that time?

@stefan-niedermann what versions of the server and Android Deck are needed for ETag support? (@lightlike we have lately enhanced the sync-time massively)

stefan-niedermann commented 3 years ago

what versions of the server and Android Deck are needed for ETag support?

Deck Server 1.2.2 & Deck Android 1.13.0

Deck Android 1.13.0 has already been released and is already available at F-Droid. You should update 🙂

However, the OfflineException should not occur. Maybe the connection has switched from wi-fi to mobile data during the sync and was offline for a very short time - this would explain the behavior.

I'd propose you update and when the issue does not occur again, we close it due to the lack of reproducibility. Since the sync should be much much quicker with Deck Android 1.13.0 the assumed scenario is way more unlikely to happen again 🤷‍♂️

lightlike commented 3 years ago

I do not imagine that this has something to do with mobile data, as this is almost always disable on that phone. There might be some wierd switching-stuff between modes in the background but I don't really see that.

I'll try the new version as soon as I can and write if that helps. (The sync is pretty quick as we see the cards change, but the loading continues even after syncing)

lightlike commented 3 years ago

Update did not help and I found another Galaxy Phone (Galaxy A20e) that has the same problem.

stefan-niedermann commented 3 years ago

Okay then, time to share a few more information with us (each hint will help to fix this problem):

  1. Does this happen on every sync (pull down to refresh)?
    • If not: Does the not-disappearing loading spinner and the OfflineException always occur together or does sometimes only one of the two issues occur?
  2. Please answer @desperateCoder question: Is the setting "Sync only on Wi-Fi" enabled or disabled?
  3. Tell us more about the environment
    • Are you connected to a stable Wi-Fi connections? Could a connection issue be the root cause, e. g. when you have a few walls between your phone and your access point?
    • Are you able to reproduce the issue when you are only on mobile data?
  4. Can you see any similar issues with the Notes app? (Requires this server app to work)

Please answer all questions for both smartphones

lightlike commented 3 years ago
  1. Yes. This happens every sync. We do not always get the error (it takes quite some time for the error to show up), but this behaviour always happens.
  2. Should be Sync on Wi-fi and mobile data. I also see no options to change that.
    • connection should be stable enought for this and the server is on the same network
    • I testet this right next to the WLAN-AP and that did not help.
    • I will not try the only mobile data as that costs money on that phone. (and that is not my money)
  3. Notes works fine

Further information:

desperateCoder commented 3 years ago

Yes. This happens every sync.

Ok? Wow. Never heard of something similar, thats more than weird.

I also see no options to change that.

In the side menu, where you can also switch the boards, there is an entry for Settings. No need to change anything for resolving this bug, but maybe you'll find some useful settings there :wink:

I will not try the only mobile data as that costs money on that phone

Totally fine.

So, to sum this up: we have a strange behavior and no clue, where and why this stuff happens. If you are willing to help us resolving this issue, I have some further questions:

Really, big thanks so far! You are communicating well and I have the feeling, that you aren't just complaining, but trying to help us getting things solved. Unfortunately this isn't always the case. Thanks!

lightlike commented 3 years ago

In the side menu, where you can also switch the boards, there is an entry for Settings. No need to change anything for resolving this bug, but maybe you'll find some useful settings there 😉

That makes sense. I only searched in the Android menues. Wi-fi-only takes the same amount of time. Except once where it worked quite quick. (this is so inconsistent :confused:)

desperateCoder commented 3 years ago

this is so inconsistent

If you are on Android Deck version >=1.13.0 the sync will selectively sync specific boards, which have changed. And since you stated that you host your Nextcloud instance in your own network, it may also depend on the performance of your server. So yes, it is inconsistent depending on various factors. Could you please verify, which version you are on right now? (side menu -> About)

  • I did some Android Development (Xamarin) before and I might be able to find the logs (with some google-help wink).
  • I can install some custom-versions on the device but that might take some time as the device is still in use.

I guess I'd go for the custom version. That way I can let the app just hard-die in case anything goes wrong, so we know where it really fails. If it takes some time, no problem at all! I'll start implementing your special version in a few minutes and post a link to it here.

desperateCoder commented 3 years ago

Here you go: APK Download ( ͡° ͜ʖ ͡°)

So IF it dies, it will exactly state, what went wrong. It is safe to install it, it won't have any effect on your current installation, so no worries. You'll end up with two deck apps on your phone, the one labeled with "dev" is this one.

lightlike commented 3 years ago

Seems that the device that I testet was still on 1.11.1. I'll get the new version tomorrow. I'll also install the dev-Version then and try getting something from that. But from what I have gathered today, the error will be annoying to reproduce.

stefan-niedermann commented 3 years ago

@lightlike do you have any new information for us with the latest version?

lightlike commented 3 years ago

Nope. Sorry I didn't have the time. It is currently very busy with University. I'll try getting you something in the next fiew days.

lightlike commented 3 years ago

Updates to Version 1.13:

stefan-niedermann commented 3 years ago

Thank you for the update!

I was unable to reproduce the exception at all

Since you haven't been able to reproduce the issue, i will close this issue. Just feel free to reopen it or create a new one in case you notice this error again 🙂

lightlike commented 3 years ago

Yea. Sorry I did not answer. :sweat_smile: The new Update seems to be a lot better but some times it seems linke something forgot to disable the loading Symbol. It works completely fine and as soon as you refresh the page (close and reopen) it seems to disappear. You do not even need to completely close the app.