Incomplete sync of currently edited text in mobile apps (iOS)

Hi everyone, I don’t have exact steps to reproduce this issue but see it fairly regularly so thought I’d start a thread and either get pointers on using the official Sync correctly or indeed have this bug fixed.

Steps to reproduce

Edit any note, for example Daily note, from iOS client - iPhone or iPad.

I typed:

[ ] Excalibur #movies #toWatch

Switch away from the app.

Expected result

Desktop app gets the changes synced including the line I was editing in my active note on the mobile device.

So, I expect this in the desktop app:

[ ] Excalibur #movies #toWatch

Actual result

Even though mobile phone has correct (full) line of text I was editing, I quite often get partial result of the same line synced onto desktop, like:

[ ] Excalibur #movi

Or sometimes just

[ ] Excalibu

This does not happen for every change and mostly works just fine. But I get this issue regularly enough (a few times a week) when creating new notes from mobile devices.

Environment

  • Operating system: macOS 12.1 on MacBook and latest copy of Obsidian (1.0.5) on iOS 15.0 (iPhone 11 Pro and iPad Pro 11" 1st Gen).
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v0.13.19
    Installer version: v0.13.14
    Login status: logged in
    Catalyst license: supporter
    Insider build toggle: on
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: ITS Theme
    Snippets enabled: 2
    Safe mode: off
    Plugins installed: 16
    Plugins enabled: 12
    1: Dataview
    2: Calendar
    3: Advanced Tables
    4: Natural Language Dates
    5: Outliner
    6: Readwise Official
    7: Timeline
    8: Tracker
    9: Style Settings
    10: TagFolder
    11: Kanban
    12: Note Refactor

Additional information

POSSIBLY IMPORTANT: I can see how mobile device submits only partial line as part of Sync History. So I can see when the note was previous copy, then the copy updated by mobile device (with partial line of text), then history of other edits and syncs made on desktop.

what happens if you want?

Obsidian doesn’t sync in the background.

If iPhone syncs the node and considers itself fully synced, I want the same content (fully synced line) to appear on desktop.

I don’t expect sync to happen in background, but if I made a quick edit and switched away - expected behaviour is either I’m not synced at all (my current line does not show on desktop until I activate app on iPhone and it finishes the sync) or that it’s fully synced (switching to another app on iPhone still allows the current note/edit sync in Obsidian to complete in background).

Are you saying that the iphone says fully synched but it’s not?

I am trying to undestand if this is a simple matter of you closing the app while the app has synched only part of your modification and you just need to keep the app open until the rest is also sent.

I’m not checking sync status this often, unfortunately. Usual rule of thumb - if I see a daily note on my iPhone, I assume it’s synced. In the Sync History it just shows as a normal sync update made from the phone - nothing suggests it was broken or incomplete.

I wouldn’t even report this if it was a usual “note not synced first, but is synced eventually” situation. But it does appear as data corruption - sometimes I don’t notice that a change made from mobile was synced incorrectly until much later.

So either partially unsuccessful sync should be recognised by the mobile app when it’s reactivated or sync operation must finish completely - but never sync the partial line.

Ps: I actually never realised that partial syncs were in the note Sync History. It’s going to be useful both for recovering corrupted data and maybe for reporting it in the future?

I will try and reproduce this.

Happened on both mobile and WiFi links so don’t think it’s about connectivity - most likely just something about how I switch away and back.

Thanks!

I think there is a big misunderstanding. There are no partial syncs.
Sync doesn’t work neither by word nor by line. Every X amount of time a snapshot of the file is taken and uploaded. If that snapshot happens to be when you are in the middle of the line, so be it. Assuming Obsidian is still open, another snapshot will be taken at a later time and the full line will be there.

Right. Thank you for your clarifications about sync process.So it seems to be something related to switching away from the app.

I can reproduce part of the problem now:

  1. Make my changes
  2. Quickly switch away to another app
  3. Wait 30sec or so (latest changes not showing on desktop)
  4. Activate app again

It shows the following in mobile app sync log:

Null is not an object (evaluating ‘this.socket.send’) Daily/2022-01-5.md

In many cases it recovers and completes the sync. But I scrolled back and can see that exactly the same Null is not an object error happened earlier today when the note was actually corrupted because only part of it synced.

Are saying that sometimes even if the mobile app is reopened the desktop doesn’t get the updated/final version?

Yes, I’m saying that after certain cases of switching away from the app (and seems related to these Null Object errors), the mobile app does not notice the error or attempt to resync.

But on desktop this looks like a successful update from iPhone, except the line of text is corrupted.

So after app gets active and restarts sync, it doesn’t retransmit the last (partially failed) sync.

This sound like a problem.

Could you please send me the sync log starting from where the error occurs, all the way until the end where it says Fully synced? That would help me understand what the internal states are that lead to the file being ignored later on.

The error itself seems to just be a manifestation of a disconnection that happened while the app was backgrounded. The fact that later re-establishment of connection doesn’t sync that file anymore is more of a problem here, and I can’t really tell without the rest of the log.

Will get the logs sent now.

To clarify: specifically that part that failed to sync from the mobile device doesn’t get re-sent. Any further collaboration on the same note file happens just fine.

Apologies for the delay. Not as immediately reproducible issue as I thought - still happens once a week or so - I will share logs whenever I notice this again.