Editing document on unavailable network drive leads to inconsistent file view

Steps to reproduce

  1. Set up a vault on a network drive (SMB) on Mac OS
  2. Create new document, type great idea with details into it
  3. Close Macbook to put it to sleep
  4. Open Macbook after sleep
  5. Don’t wait until wifi/network reconnect
  6. Type something in document
  7. “cannot access document” - pane is closed, all data is lost - at least that’s what it looks like: file disappears from pane and file list view.
  8. Cry because you just typed a great book outline that’s all gone now

Expected result

Instead of 7. I would expect a warning and the pane to remain open with the buffered content (which was just visible/editable).

I would expect Obsidian to try to re-read the file list if there was some network issue. This might be hard to detect, but there should be some update between the file list shown and actual files on disk.

Actual result

All data of the note was lost, or so I thought. After investigating the actual file system, it looks like the file was still there (I saved it. Not sure what would have happened if it wasn’t saved?). Restarting Obsidian made it re-appear.

Environment

  • Operating system: Mac OS 10.13.6
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v0.14.15
    Installer version: v0.13.31
    Operating system: Darwin Kernel Version 17.7.0: Fri Oct 30 13:34:27 PDT 2020; root:xnu-4570.71.82.8~1/RELEASE_X86_64 17.7.0
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: none
    Snippets enabled: 0
    Safe mode: off
    Plugins installed: 3
    Plugins enabled: 3
    1: Dataview
    2: Sliding Panes (Andy’s Mode)
    3: Tasks

RECOMMENDATIONS:
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the help vault or disable community plugins.


Additional information

N/A

This doesn’t look like a bug. It seems that the network location was not available and hence “the files were gone” and then the files are back once the network location was available again.

Since obsidian saves the content every 2 seconds, that’s the most you can loose 2 seconds worth of content. There is also the internal file recovery to cover problems on write.

It is very unlikely that we are going to implement some sort of middle buffering to handle spotty network locations. Feel free to open FR for this.

The content was there in the end, but I almost got a heart attack thinking it was gone.

I think the bug here is that it doesn’t show the file in the list even when the network connection is back.

I can open other documents, but the one that “disappeared” cannot be found in search or file list.

I didn’t know what else to try in terms of “re-loading”, so I finally restarted Obsidian and the file reappeared. I think that shouldn’t be necessary and to me this sounds like a bug (basically “forgetting” about the file)