Make Obsidian Sync work in background (on Mobile)

already allowed - but it does not show any background activity (shows 0 min). Something else must be keeping it from running in the background

2 Likes

another try:

  1. run OB, then back to [Home screen]
  2. press the [recent apps] key, then rencent Apps including OB shows
  3. lock the OB App by long press the OB icon in the [recent apps ] screen, thus OB app will not be automatically killed by Android.
    Hope this work.

This would be a great addition for iOS - enabling background refresh. I know other Electron based apps (like Slack) allow for background refresh. Having this in a future iOS release would be excellent.

6 Likes

+1 to this, lack of background sync makes the Android app kind of unusable for me (or at least, not worth the effort at the moment)

3 Likes

Same for iOS. Without background sync, it renders the iOS mostly useless when migrating to it the first time. I have ~12k notes from Evernote that I’ve migrated, and I can’t even use iOS until it has completed syncing the first time.

I had to use a work around which was to use selective sync and chose all but one or two folders of notes to sync the first time. Even then, it was several hundred notes and I had to sit and keep my phone alive for the sync process to complete. Then once done, I had to chose to sync the next folder, and repeat the process of syncing and keeping my mobile phone alive.

It made for an annoying number of days, and I’m nowhere near finished.

2 Likes

Unfortunately, iOS background syncing can’t happen the way we hope until changes happen in the underlying OS.

iOS is extremely protective of background data and battery drain.

You can use some features of iOS to sync a little data, but the dream of having the app aways fully synced in the background is currently out of reach.

More discussion here: ios - Periodic background synchronization - Stack Overflow

2 Likes

You probably did that already but for other people with the same issues:
You can disable screen auto lock, turn down brightness, connect to charger and just leave it running over night.

Do you know how long Obsidian on iOS stays active when exiting the app? I’m wondering if it can finish syncing last edits or will quit immediately, leaving last edits unsynced.
I had the situation several times: Made an edit, switched apps right away and edits didn’t sync through to Mac.
Interestingly, when I opened Obsidian on iOS again, the changes didn’t sync for some minutes, only when I did additional edits.

I do not, sorry.

iCloud-based sync should be independent of the app being open, but Obsidian Sync should be dependent on Apple’s iOS constraints:

1 Like

So, I tried it a couple of times. When I make an edit on iOS and leave the Obsidian app (not closing it but going to homescreen), the very latest edits aren‘t synced (ca. the last second of edits.)

When I open Obsidian again and check sync log, I see following error message:

2022-04-22 11:00 - null is not an object (evaluating ‘this.socket.send’) filename.md

After opening the Obsidian app again, it takes ca. 30 seconds for Obsidian to connect to server and uploading the last edits.

If this is a common bug, I can imagine this 30 second delay may lead to many sync conflicts.
If there was a way to keep Obsidian active in iOS background for another 3 seconds after leaving the app to upload the last edits, that would also solve the issue. Idk if that’s possible at all with iOS’ restrictions.

1 Like

Any chance this gets implemented soonish?
This really keeps me from using obsidian more on my tablet and phone

In the absence of background sync, one potential improvement would be to display the sync indicator at the top of every note.

Currently you have to swipe from right to see it:

RPReplay_Final1659735152

However, for example, in another note app I have, the sync status is always visible:

RPReplay_Final1659735068 (1)

This way, you could at least easily see when the sync has completed, before you close the app.

6 Likes

YES.

2 Likes

Does Obsidian do this, or is it just something it could do?

2 Likes

+1 as well :slight_smile:

To avoid iOS-caused sync conflicts, Obsidian only needs to be able to sync the last 2 seconds of text edits after having been backgrounded.
Currently it stops syncing the moment you exit the app.
I wish the devs could investigate if that can be done.

Obsidian needing to download the latest syncs after opening is less of an issue imho.

+1 for the permanently visible sync status indicator on iOS

2 Likes

OMG, I just noticed the “Prevent device sleep” setting on mobile: “Prevents the device from going to sleep when there are still files to be synced.” !!!

I don’t see it announced in the forum or documented in Help. I have no idea how long it’s been there, but I’ve enabled the heck out of it now.

EDIT: Hmm, maybe this only works when Obsidian is in the foreground? I’m hoping it at least requests the little extra time that iOS apps can request to finish things when they are closed. I’ll leave it on and see how it goes.

3 Likes

I don’t see the background refresh setting at all in the system preferences panel (ipad os). I think we could get more from it.

I think maybe the setting has helped somewhat, but it’s hard to tell (and it’s taken time to unlearn the waiting habits I developed to compensate for how Sync works on iOS). But Sync still occasionally suffers from red icon, and/or doesn’t sync if I close too fast. I feel like it’s less of a problem than it used to be, but also that improvements started before I turned on the setting. So, :woman_shrugging:t2:

it’s in settings/sync, “prevent device sleep”. That’s the only setting