# [SOLVED] [BUG] Sync conflicts with 2 Macs editing the same file

edited February 2021

@ctietze - Not sure the right venue and format for this report.
I'm on 1.5.5 on both computers and this is not new but more prevalent now. It happens only if I have a note active in the editor window on two machines. Something I apparently do often.

Is this a bug or a feature?

Report
I am at my office computer working on a file 202007202002 Ecodharma - Ends And Means and it becomes time to take the puppy for a walk. Instead of returning to my office on returning I stop at the shop and continue editing 202007202002 Ecodharma - Ends And Means on my shop computer. So now 202007202002 Ecodharma - Ends And Means is open on two computers on my local network. It seems each is autosaving and Dropbox is reporting conflicts.

I end up, after only 10 minutes, within the note list and Finder:

Post edited by ctietze on

Will Simpson
“Read Poetry, Listen to Good Music, and Get Exercise”
kestrelcreek.com

• I've gotten this with TA and Dropbox as well, but usually it's only one file and one conflict. Makes sense it might have to do with both files being open at the same time on two machines. I hadn't thought of that.

I would imagine it's almost a feature rather than a bug, since TA automatically saves, but it makes sense it would freak Dropbox out. I suppose one solution is to either close TA when we switch machines or make sure no files are open?

• Each local instance of The Archive is supposed to let go of the file after you idle for a short while of 1--5 seconds max. Then subsequent updates of the file outside of the app will update the text you see in the app.

I suspect this part kind of works as intended, but then the "reading" machine at home still tries to update the file for some reason. It's probably just metadata, but that could suffice to create sync conflicts. I'll investigate.

@Will Could you reproduce this conflict production on a test note with 1+ conflict file, and then send me the files + the logs of The Archive for the day? The logs should indicate read and write operations including timestamps.

Author at Zettelkasten.de • https://christiantietze.de/

• edited August 2020

FYI folks: I found the issue and will be working on it. It was more complicated than I anticipated, so it didn't make it into v1.5.6 yesterday.

The underlying issue is that once you edit a note and leave it open, The Archive will go into "idle" mode after a couple of seconds to then accept external changes. When external changes happen, it will show the new content and register it as if you replaced the content yourself to allow Cmd-Z/Undo. The faulty behavior lies here: the undo-able editor update auto-saves the changes that were just read once again. The file on disk doesn't change, but the modification date does, and when you have two instances of The Archive look at the same file, each auto-saving right away in response to an external sync change, Dropbox will not be happy.

Getting all the edge cases right is a bit finicky, so it'll take a bit to fix.

Temporary quick fix for you: don't leave the same note open on 2 Macs in the meantime.

Post edited by ctietze on

Author at Zettelkasten.de • https://christiantietze.de/

• Thank you for the detailed explanation, @ctietze, and good luck squashing this bug.

If you like The Archive's "PrettyFunctional (Basic)" theme, consider upgrading to the "PrettyFunctional (Regular)" theme.

• Has version 1.5.6 been pulled as it is not appearing when I check for updates?

• @DavidWJ check in Preferences that you have Cutting Edge Release Channel selected.

Will Simpson
“Read Poetry, Listen to Good Music, and Get Exercise”
kestrelcreek.com

• @DavidWJ Sorry for the trouble! The update did indeed not appear on my machine as well, but wasn't sure if it's because of my development device or something else. Switching update channels back and forth should reset this.

Author at Zettelkasten.de • https://christiantietze.de/

• @ctietze & @Will Thank you both.

• FWIW one of the things I loved about TA was the fact that I wasn't getting conflicts, then suddenly I started getting conflicts. Some show up with "conflicted copy" in the filename, which I think is a Dropbox thing, some just add a number at the end of the file name, which is the Finder? Anyway, it's annoying, especially with the lack of any in-app diff feature, something I don't expect, um, anytime soon? I've just been deleting the earlier files because I haven't found actual content conflicts. And trying to remember to close out TA, which is probably best practice anyway.

• edited August 2020

For what it's worth, hitting Escape to quit editing a note for good should suffice.

After things got worse for you, they should get better, soon, too. Not wanting to excuse the regression, I can only say these timed interactions are surprisingly complex and thus hard to get right. (Because you also don't want not to autosave, for example.)

Author at Zettelkasten.de • https://christiantietze.de/

• Underlying problem is fixed with v1.6.0

Author at Zettelkasten.de • https://christiantietze.de/