Sync can mean many things

hi
I have a specific question about sync for taskpaper, but I guess also foldingtext.

If I have either open on my L, laptop and my D, desktop. If I make a change on L does it appear on D?

Or is there conflict? (If the latter, then I tend to not think of this as a “sync”…)

Said another way: must I be sure to close the app on L in order to reliably open it on D in order to see the changes?

I recognize that there are two ways: iCloud drive (if bought on the app store) and dropbox (if bought directly)

Again…interested in both TaskPaper and FoldingText. It’s outlining that I want, not to-do…but in any fashion, I need sync. Thinking of migrating away from WorkFlowy.

thanks
Ray

TaskPaper should work as you suggest (and I think FoldingText too, though I haven’t tested it as recently). But to be sure… both apps have a trial period, I would test yourself for your particular use case.

Let me explain how it works in TaskPaper. It’s not “true” sync, where conflicts are automatically merged. But if it’s just a single user working on multiple computers it should work assuming the sync process is faster then your computer switching/file editing process. And I think generally it should be.

  1. When you open a TaskPaper document and make changes it will soon autosave those changes to the file that you’ve opened. So the changes are saved even if you don’t explicitly save … and as a result the new content starts syncing over Dropbox, iCloud, etc. (this is all default behavior provided by macOS frameworks when the “autosaveInPlace” flag is set)

  2. macOS has some support for automatically reloading a document when it’s file is modified and when the document has been modified since it’s last autosave. When this reload happens you will loose the undo stack, but generally the new content modified content is loaded into the document.

Thanks. That was fast!

You don’t own FoldingText any more do you… Can’t remember.

Ray

FoldingText is still a “Hog Bay Software” app, but I’m not working on development. Instead @mutahhir (who also helped me created it) is doing all of the FoldingText work. He also has a full time job, so the updates won’t be “full time”, but he’s made some good progress, including adding the recent outline sidebar view.

What happens on the rare occasion there is a conflict? Last write wins? I’m guessing it’s the same as other auto-saving OS X apps, but I couldn’t find any details.

I’m curious because Todo.taskpaper implements Dropbox sync in a similar fashion. Currently when there is a conflict, behavior is undefined but syncing should should be paused. My goal is to:

  1. Try to resolve the conflicts automatically
  2. Failing that, pause sync and alert the user
  3. Provide some type of interface for manually resolving conflicts (3-way merge already seems to be built into CodeMirror, but it might just be the user choosing which version they wish to keep)

Most of this is system (on macOS side anyway) defined behavior, in particular NSDocument behavior. I’m describing what I think (after just doing a few tests) happens. But don’t consider this to be the authoritative answer.

I think there are three cases to consider when a file is modified at the same time that it’s open:

  1. The document doesn’t have any unsaved changes. This is the good case… the document just loads in the new content and you are good to go.

  2. The document has unsaved changes. In this case you’ll get a notification that says something like “File has changed, you have unsaved changes, would you like to revert to saved version, or overwrite saved version with your changes”.

  3. The document don’t have any unsaved changes, but there’s a conflict because the sync system (Dropbox, iCloud, etc) has detected another saved version of the same document. (So you successfully save on two devices, and then the conflict happens when the system seems that you’ve modified both document “at the same time”). In this case it seems like if your file is saved to iCloud then NSDocument will show an alert showing you the two different versions and allowing you to pick the winner. On the other hand if you do the same thing on Dropbox, it automatically marks one version as a conflict (and saves it to a new file) and keeps you editing the non conflict version.

I hope that helps some.

Jesse

1 Like