Home / GitHub Page

Android (background) sync interval

Hi,

I have been searching for a Google Keep alternative for a while and finally came to Joplin which works absolutely great.

I have however one question about the android application.
In the settings there is an option for the sync interval. Does this mean it also syncs in the background?

Example: When i edit a note in windows on day 1 and let it sync (encrypted) to dropbox. Then don’t open Joplin on android for a few days. Will it still have the edited note as offline due to background sync? So when on for example day 4 i don’t have an internet connection and i open Joplin i can still continue the work in the edited note?

Thanks in advance

4 Likes

Anyone who can shed some light on this?

Currently the mobile app doesn’t sync when it’s not open. When you open it, it will sync as long as it stays open.

Thank you for your reply.

I hope there are plan to eventually have an option to let it background sync when changes happen so you always have the most recent files even when there is no internet.

3 Likes

Please add background syncing. I find it annoying to have to open the app to keep my notes up to date.

1 Like

It’s a limit of react native and the new Android Doze and App Sleep API. But if you find a way, please let us know.

will it be possible to have joplin sync when you open the app to “kinda give it background sync”?

1 Like

Will this work? I would like to have a way for Joplin to sync automatically

It might. @laurent can we trigger a sync when we bring the app to the foreground?

1 Like

Hmm, but it means we don’t respect the sync interval anymore. Like if someone has 1h as sync interval and opens the app every 5 min they’ll get a lot of unwanted syncs.

The sync interval is useless on mobile anyway, because it doesn’t sync in the background.

If it weren’t, I’d agree with you.

Isn’t there at least an option to prevent screen from turning off while the sync is running?

Why useless? It’s respected while the app is running. So if you have set it to 10 min it would do this:

  • Open the app after 4 min: nothing happen
  • Open 3 min later: nothing happen
  • Open 4 min later: sync

Of course it would be much better if it could run in the background. It might be possible but in general background tasks are unreliable, with mobile manufacturers randomly killing background services as they please, so getting a RN app working in this hostile env is likely to be difficult.

Hmm, ok. In that case setting it to 1 minute might be similar to syncing when opening/bringing it to the foreground.

I have set it to 10 minutes, but it usually never syncs when I open it again after an hour. I’ll have to investigate this in more detail.

I think in general there are 2 sync issues on mobile:

  • no background sync
  • device goes to sleep during sync
1 Like

My point exactly. When I make a lot of changes and want to make sure they are downloaded to my phone, I basically have to babysit it, opening joplin and tapping periodically until it finishes. Last time I had 500 changed sync items, it took quite a while.

1 Like

React Native doesn’t support long timers so timing is done based on PoorManIntervals, which creates timers that activate based on user activity (specifically, based on the Redux actions). So if you open the app and do nothing, sync won’t happen.

Maybe the solution would be to also make the timers activate based on when the user opens the application (it just means calling the “update()” method). Or maybe it’s a different issue and for some reason the PoorManIntervals class doesn’t work properly.