Under what conditions does Obsidian-Sync overwrite new changes? (specially on android)

What I’m trying to do

I’m trying to understand under what conditions obsidian-sync overwrites/forgets new changes.

I use a plugin to append text to my notes, for example “cook food”. This plugin uses this.app.vault.modify(file, text) to append text to notes.

But I have noticed that sometimes, on my phone, the following happens:

  1. Beforehand I was not using my phone. I was using my laptop and I added some text to my daily note on my laptop.
  2. I turn on my phone. Open obsidian, I open my daily note, I run the command that appends “cook food”.
  3. The line “cook food” is appended to the bottom of the daily note. I can see it.
  4. Around five seconds have passed by now.
  5. Obsidian syncs. The text I added through my laptop appears. The line “cook food” is gone with no trace of it, even in version history.

Which leads me back to the question. Do you guys know under what conditions edits (specially those done just before syncing, and those done on mobile-android) disappear? Is this the current expected behavior?

It would be incredibly helpful to know that, so that I can do quick edits on the fly without worrying.

Thank you. :purple_heart:

Things I have tried

Googling. Reading Troubleshooting, this is not a matter of “creating a note on two devices”. So I don’t see anything relevant. Reading Limitations.

As far as I know, Obsidian should be trying to merge the 2 versions of the file. I always wait for Sync to update before changing a file because it’s merging is sometimes bad, but usually the problem is duplicated text, not missing text.

I think it’s not in the version history because it never synced. But it should be available on the phone in Settings > File Recovery.