Bug Report: Dropbox Sync gets stuck on Android Mobile (often, but not all the time)

Operating system

Android

Joplin version

3.1.8

Sync target

Dropbox

What issue do you have?

The Android Joplin app seems to be stuck on Dropbox sync most of the time.

I've used the app for over a year now without any problems, but this issue seems to have started maybe a month or so ago and gotten worse since then.

When I start the app, it'll try to do a sync, but the sync seems to be stuck on an infinite spinner. I've waiting for as long as several hours once and nothing changed. If I click "Cancel", then the infinite spinner continues, but with the added message of "Canceling...". The only way to get out of this infinite loop is to quit the Joplin app. Though when I restart it, it enters the loop again.

The quizzical part is that sometimes, maybe once or twice a day, a successful sync does take place! When it does, it's fast and as expected, as there's not many items to sync.

Things I've tried that didn't work:
• Quitting and restarting Joplin
• Clearing the App Cache for the Joplin app.
• Restarting my phone.
• Tried different wifi/cell networks.

Why I don't think this is a Dropbox issue:
• I use the Joplin desktop apps (both Linux and Mac) and both can sync perfectly fine and quick with the same Dropbox source.
• I don't see any Dropbox sync related errors in the logs.
• Because the sync is sometimes successful, the auth and connection is certainly valid.

I've attached a screenshot of the sync screen - the little spinner on the bottom left is constantly spinning during this issue. I took a video of the issue happening but it's too big to attach to this post, but if anyone would like to see it, I can try to upload it somewhere and share a link.

I've also attached my mobile app logs. The issue most recently happened today, January 5th, at 11:26am PST and also again at 11:48 PST - hopefully that makes log sleuthing easier. I was able to get a successful sync after that.

Phone Version:
• Pixel 5
• Android 14

Joplin App Info:

Joplin Mobile 3.1.8 (prod, android)

Client ID: 427a713cd534450c815972b527e210a0
Sync Version: 3
Profile Version: 47
Keychain Supported: No

Revision: 41b251d67 (release-3.1)

Android API level: 34
WebView version: 131.0.6778.135
WebView package: com.google.android.webview
FTS enabled: 1
Hermes enabled: 1

Screenshots

Log file

mobile-log.log (811 KB)

I've been using Dropbox sync for the last 2-3 months and hit a stuck sync issue twice (both times were last year) and I'm also an Android user (I used OneDrive for months before that, and never had a stuck sync issue). What seems to resolve it for me when it gets stuck is to make an additional edit to the last note that I changed (eg. add a space), then exit out of the note, wait a few seconds (to ensure background save has completed) and then restart the app. Then the sync completed again and subsequent syncs after making other changes no longer get stuck.

Looking at the logs I could not find any indicators of an issue with Joplin when such errors occurred, so my guess is that when this happens, the dropbox api is stalling due to some kind of lock on a particular note, and making a further change to that note (or possibly any note, or a different note) seems to resolve it.

I recall a Dropbox API issue on iphone, that making the same api call twice would not work properly, and there was some workaround added to Joplin to make a call for a different file before repeating the call to the desired file in order the resolve whatever the issue was. I wonder if this stuck sync issue on Android is related to that underlying issue with Dropbox API