Make Obsidian Sync work in background (on Mobile)

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

+1 on this! :smiley:

+1
Its annoying that this does not already work. Makes obsidian impossible to use on mobile

1 Like

Totally agree.

1 Like

Does Obsidian ios retain the entire vault in memory? I wonder if maintaining smaller vaults would reduce the frequency of ios kills

2 Likes

I believe this is the single most important feature for Obsidian Sync users.
I migrated to Obsidian Sync from a private Syncthing setup, and while the sync itself works really well, the fact that when I open Obsidian on mobile, after an already too-long startup time I need to wait for a full sync before it’s fully usable, is a huge pain.
A simple common flow like logging something in the daily note becomes extremely cumbersome, sometimes requiring more than a minute before I can type the single line that I wanted to log. Not to mention things like completing tasks etc from mobile.

7 Likes

Here is a little ‘hack’ to keep Obsidian backgrounded on iOS, which even enables background sync while your iPhone is unlocked. I still need to take the time to write this up and post it on the forum:

The idea in short:

  • take a short video (f.ex. a 1 sec screen recording), place it in your vault, play it, put it in picture in picture mode, and slide it off screen. It will stay there even if you watch other videos in between.
    On my iPhone 11, it remains active for many hours or all day.

  • alternative: create a some hours long empty mp3 file, add to vault, play it. That note needs to remain open, so pin it. Downside: when you play other sounds, it stops and Obsidian won’t be backgrounded anymore.

Let me know if you run into any issues!

3 Likes

When at home I use mainly Obsidian in my PC but on the go I use Obsidian in my Galaxy Tab. And specially when I’ve edited many files, it takes so long to update that it’s absolutely annoying.

Another solution would be to improve speed of Obsidian Sync, which is known to be slow.

1 Like