Fletcher on 28 May, 2018 03:14 PM
First -- thanks for getting the Pro upgrade, and glad you like it!!
I have not heard from other users about issues with iCloud, but that doesn't mean it isn't happening.
Some background on the way iCloud works, in case you're unaware (most people aren't aware of the details). iCloud synchronization is handled by macOS/iOS, and happens "at its leisure." There is no way to control how quickly the synchronization occurs, or to know whether you are working on the most recent version of the document. One hopes that the synchronization occurs in a reasonable period of time, but there is no guarantee or even a definition as to what a reasonable time period is (at least that I'm aware of).
On a Mac (iPhone is slightly different, but mostly the same), Composer doesn't really have to do anything special when dealing with iCloud files. It reads/writes to a special folder and macOS handles synchronization. So there's not much I can do, even if I wanted to.
Dropbox, again on a Mac, is similar in that Composer reads/writes to a special folder. But the Dropbox sync process ensures that the sync occurs in a fairly quick period of time. Additionally, Dropbox provides a serial number for each version of each file, allowing one to be sure as to whether you currently have the most recent version or not.
My personal experience is that Dropbox is more reliable for files I work on "simultaneously" on multiple machines. iCloud is easier for files that belong to a specific application where I may or may not want to access those same files on a different device (including iOS), but I predominantly edit those files on a single device.
iCloud is much better than it used to be, but it is still not perfect.
Composer for iOS is currently in beta, and it supports both iCloud and Dropbox. Dropbox sync is definitely faster, because I control exactly when sync occurs and can ensure that the local file is up to date. I can't do the same with iCloud, though generally things have been kept in sync relatively quickly in my testing (on the order of 5-15 seconds???) That said, it took me a while to work out the bugs in my code that manages the Dropbox sync, but that seems to be working really well now.
One thing you can try is under the Advanced preferences -- check the box to update the file when changed by another program. This uses a separate routine to merge your current open file (even if you have unsaved changes) with any changes that occur to the file on disk. It may or may not help with iCloud conflicts that you describe, but can help ensure that your edits and external changes are merged to keep the file up to date. I've used this when editing a file on iPhone and Mac at the same time with good success. (Of course, editing the exact same point in the document on two devices at the same time will give an error, but you can work on separate lines rather easily.)
Hope this helps explain the situation, even if there isn't much I can do to change it.
PS> I am referring to the "older" form of iCloud sync where it only manages documents inside the iCloud folder. I have not tested the newer form that apparently manages your entire home directory (or maybe just the documents directory?) in iCloud, and will never enable that feature personally. It's way too risky for a sync process that is so opaque.
Thank you for your exceptionally helpful reply. I have a lot of Markdown
editors. I’m having iCloud sync problems with Ulysses, iA Writer and MMD.
Strangely never with Bear.
I actually don’t do any serious writing on iOS but like a nice experience
on my MacBook. After reading your email I will use Dropbox.
I had hoped iCloud had its problems behind it. I use Apple Notes a lot and
have never had an issue.
I love Apple but I’m disappointed. I use Google Docs and Google Sheets and
have never had a conflict. I might be happy using it for everything but I
write for my WordPress blog and Google Docs is not a good solution.
Thanks again for explaining the situation in a way I could understand and
for the great app.
Fletcher on 28 May, 2018 04:39 PM
I use Apple Notes as well, and it has worked great recently -- but early
on I ended up with a lot of duplicate notes.
I think Apple struggles with sync because of their "it just works"
philosophy being applied to a situation where it is impossible to know
with 100% certainty that all nodes have *succesfully* synchronized all
of their changes with a central server, or with all other nodes (because
of networking issues, one or more nodes being offline, etc.)
Throw in simultaneous conflicting edits on two or more nodes, and that
brings in more difficulties.
Dropbox' solution is effective but ugly -- if a collision occurs, fork
the file and let the user fix it at their convenience. (Although I
rarely see the Dropbox conflicted file issue any more, except when I was
developing my own sync code or if I do it on purpose).
iCloud went the route of flagging a conflict immediately, and requiring
the user to resolve the conflict immediately. This is not always
convenient, but avoids having multiple copies of the same file...
I've spent a ***lot*** of time over the years thinking about sync and
writing code to provide sync services for various situations. Composer
for iOS has Dropbox support built on some of this work (but Dropbox
makes the problem a bit easier with their versioning.) I've also got a
test project that provides real-time sync between multiple editors of
the same document (I started before Google docs but never got around to
polishing it for public use). I'm looking at adding something like this
to Composer for occasions where multiple people need to collaborate, but
it may be easier for some people to just fall back to Google docs in
that scenario.... We'll see.
Good luck, and definitely let me know if there is something specific you
think is broken in Composer.
PS> Certainly if there are ways I can improve Composer's interface with
iCloud I want to do that. But on the Mac I honestly don't think there
is anything I can do. iOS does require a couple of steps to tell the
system that I have made a change, but beyond ensuring those couple of
lines of code are done, there's not a lot I can do there either....