kevboh / longform

A plugin for Obsidian that helps you write and edit novels, screenplays, and other long projects.
Other
610 stars 30 forks source link

Problems with Sync between MacOs and iOs #220

Closed flechtwerkflechtwerk closed 6 months ago

flechtwerkflechtwerk commented 7 months ago

Problem

I often have problems syncing Longform between MacOs and iOs (iPhone) via Obsidian Sync: newly added scenes are reported as "new" on iPhone. If I add them, they loose their assigned place and get added to the bottom of the scene list.

To reproduce:

1) I create a new scene (or several) on Obsidian MacOS and put some text in it. 2) I drag the scene to its proper place in the list of scenes. 3) I wait for Obsidian to sync. 4) I open Obsidian on the iPhone and wait for it to sync. 5) Longform reports it has found a new file. 6) I add the new file and it ends up in the bottom of the list 7) I return to Obsidian Mac, the file stays at the bottom.

Things I tried to fix it:

After opening Obsidian on the iPhone and seeing the report for the new file, I tried to

1) reload without saving 2) quit and reopen Obsidian.

Sometimes this helps, but more often than not it doesn't. Strange thing is that when I open the index.md file in source view on the iPhone before adding the “new” file, I see its file name in the list in the right location.

Workaround:

I can restore the scene order with sync history of the index file, but this is of course cumbersome.

flechtwerkflechtwerk commented 7 months ago

I wanted to add that I have exactly the same problem when I sync between two Macs. So whenever I added a scene and switch to another device, I have to use Sync version history to restore the index.md file from the machine I created the scene in.

Spekoralisten commented 7 months ago

I have had the same problem from time to time, but have so far failed to see any pattern for when it happens. Syncing might very well be the issue.

vishae commented 7 months ago

I use Obsidian Sync and I've noticed this issue as well. If I've made changes to the scenes list on my Mac and then move to work on my iPad (or iPhone or another Mac), Longform would use the Index file of the iPad (pre-sync) as the latest version instead of the changes I made on my Mac. As mentioned by someone else earlier, you have to use Sync version history to restore the index file (and sometimes reload Obsidian).

arussbach commented 6 months ago

I have the same problem on PC and andoid. I might be completely wrong but I have a theory on what might be happening. I don't know how longform works exactly but here is what I suspect:

jgharding commented 6 months ago

Hi all,

I've the same issue,

I'm using Obsidian on Windows, Android and iOS. The Projects all worked fine on Windows and Android, but the next time I opened up Obsidian on iOS, they all completely vanished with no trace,

I then tried creating a new project on Windows, closed and then opened Obsidian again, and it had already vanished! So something is quite wrong...

kevboh commented 6 months ago

Unfortunately, this is a problem with Obsidian sync itself, and there's not a lot I can do about it until the team provides more API surface to let a plugin know when sync is updating a file vs. the user actually creating a new one. From Longform's perspective there is no difference between sync writing a file and you doing so. The best way to avoid issues is to wait until sync has totally finished before using Longform, as Longform won't update your index file (and thus won't cause sync conflicts) without interaction.

Also, if your projects are not visible in Longform but are there on disk in your vault, there is likely an issue with the frontmatter (properties) in your index file: open it with a text editor and see if it looks okay, or open the developer console in Obsidian and see if an error is printed there.