Content of notes dissapear

Steps to reproduce

I open the same note in split views, one for editing one for preview. And suddenly the content disappears from the editing one. And when I click to edit the preview, it opens blank as the content from the original is already gone.

Expected result

I should be able to write and preview simultaneously without losing the content.

Actual result

Content lost, I had to undo constantly to gain it back.

Environment

  • Operating system: macOS High Sierra Version 10.13.6
  • Obsidian version: Obisidian v0.6.1
  • Using custom CSS: No, I don’t.

Additional information

1 Like

Thanks for the report, working on it!

1 Like

Don’t know if I should post it here or make another topic. It happened as I was reading the Obsidian Help folder. 8 notes contents were erased when I was switching between them with the editor and preview side by side. I noticed early when I tried to open a link and the note had nothing (I think I was in the editor mode only when first happened)

Environment

Operating system: Windows 10
Obsidian version: Obisidian v0.6.1
Using custom CSS: Gruvbox Theme

I have figured out the issue. It’s a case of a race condition between multiple panes open to the same file, trying to override each other.

Previously we’ve relied on a boolean flag to indicate whether the pane’s editor is loading, but I believe in the case of a race condition where data may be loaded twice, it would only set the boolean flag once, which causes the second load to overwrite.

I’ve changed the way data loading is detected, and is now guaranteed to only communicate across panes when changes are sourced from user-edits, rather than file loading.

After testing with @Bora it seems like my fix is effective. He was unable to reproduce the issue with my test release where before he could reproduce the issue quite easily.

As this is a serious issue, it will be released for v0.6.2 as soon as possible.
cc @mediapathic who has also experienced this.

3 Likes

Thank you @Licat , I’ve been writing some notes after our initial test and still no issue. Your fix is effective indeed. Both panes are working as they should be simultaneously, without content disappears or loosing connection between.

Glad this worked out, it was really distracting. :expressionless:

1 Like