I’m getting a weird behavior while typing in DEVONthink in Markdown files that are indexed. By way of background, I am indexing a folder of markdown files that are stored in Dropbox. I initially had them stored elsewhere, but wanted to run various automation tasks on them via both Shortcuts (iOS) and Keyboard Maestro (macOS), and putting them in Dropbox opened up several possibilities.
The glitches happen while I’m typing, and having words or sentences I just typed suddenly disappear. It almost seems like I’m “getting out ahead” of the sync while I type, and when either Dropbox or DEVONthink syncs, it is syncing my document back to a state from a second or two earlier. Hopefully that makes sense, although it is just a guess. Perhaps there’s something else going on here, and my guess is wrong. I thought perhaps it was some sort of autocorrect glitch, or an issue with Dropbox, but I switched over to typing in BBEdit about an hour ago, and haven’t noticed this in BBEdit, working on the same files. (I prefer typing in DEVONthink for some of the other features, or I’d just switch to BBedit).
I did read the Help section on “Indexing and Sync,” thinking that perhaps I don’t need to sync the documents since they are in Dropbox, but I do use DEVONthink to Go with some frequency.
Does this still happen after disabling Dropbox sync and all automations tasks (no matter whether smart rules, Hazel, folder actions or Keyboard Maestro etc.)?
Regarding the automation tasks, they aren’t ones that run constantly so I’d be surprised if they’re behind this:
I have ones in Shortcuts and Keyboard Maestro that take text input and either file to a predefined folder, or append to my daily work note or personal note, but these require triggering by me (i.e., they don’t run in the background).
I have two that, at 11:50 PM each night, take my personal and work daily notes, duplicate them, rename the duplicates with the current date, and move the renamed duplicates to a “daily notes” folder. (This lets my daily note always have the same ID/link, making for easier automation).
But if disabling Dropbox sync doesn’t fix it, I’ll try disabling all other automations.
I do, yes. I have an always-on Mac that runs some automation, both related to DEVONthink and not, so I keep DEVONthink running on it, such as to process the one that runs at 11:50 PM each night. I guess I could probably set up a Keyboard Maestro macro to quit DEVONthink at the end of each workday (in case I forget), then launch in advance of 11:50 PM, and quit it again a while after that. I think I might try quitting that instance first, and see how it goes. Thanks for the sugggestion!
I meant to report back in on this, but I had been traveling with just my iPad. Before I left, I worked for a couple of hours after remotely quitting DEVONthink on the other Mac, and the glitches went away. So it’s a small sample, but I suspect that was the cause (changes syncing back and forth and conflicting?). Since this seemed to do the trick, I set up a time-based Keyboard Maestro macro to quit DEVONthink on my desktop Mac, but as I think about it, I could probably create a macro to quit it on the desktop Mac when I open it on my MacBook, and then reopen it on the desktop when I quit on the MacBook.
To test Christian’s theory, I needed to shut down DEVONthink on the Mac that I didn’t have physical access to for the immediate future. It’s not the most elegant solution, but although I don’t have any remote access software on the other computer, my Keyboard Maestro macros sync between Macs. So I made a Keyboard Maestro macro with an “if” condition being the name of that other Mac. The action in Keyboard Maestro was to shut down DEVONthink. And then I just made a time trigger of a couple minutes ahead of the current time for that action to run. At the set time, that Mac passed the “if” test, then ran the action to shut down DEVONthink. Hopefully that makes sense.
(Technically, I haven’t been able to see that Mac in person yet to confirm that this all worked, but it was just after running that macro that my glitches went away)
Does the second Mac perform any automation on these files (e.g. via DEVONthink or Hazel)? In case of indexed Dropbox items it’s up to Dropbox to transfer the actual files to avoid conflicts (e.g. unnecessary duplicates caused by cloud app)
Not except at set times late at night to duplicate, rename, and move to an archive folder, and then clear the daily notes (one personal, one work) so they start the day blank. This is done via a Keyboard Maestro time of day trigger. And then I have a couple of automations via Shortcuts that only run when I manually trigger them (to prompt for text to append to a daily note).
I’ve finally tested this, and things work without any glitches if I quit Dropbox. And, as mentioned earlier, it also works without glitches if I don’t have DEVONthink running on the remote machine.*
So it sounds like I need to do one of two things:
not have DEVONthink running on the remote machine (not ideal, due to automation that runs late at night on that machine, but I can work around that with scheduled quitting and relaunching of the app using Keyboard Maestro)
not use Dropbox sync on the folder in question. Like an idiot, I tried to use Dropbox’s selective sync feature to not sync that folder, but it competely removed the local folder, which broke everything. I could move all of this out of Dropbox, but again, I have some automation using the Shortcuts app which only works on Dropbox files.
I’m probably overlooking a better solution, but right now I’ve just set up Keyboard Maestro to launch DEVONthink on the remote machine late at night, just before the automation runs, and then quit it 20 minutes later.
I use the term “remote machine” just for explanation purposes. This machine isn’t always remote, as it is located at my usual work location, but it is always on, whereas the other machine is a MacBook that isn’t always on.
So, I may have misinterpretted what you wrote, but do you have your DEVONthink databases (macOS Packages) in a Dropbox folder and then Dropbox syncs those files to/from their server? If so, sounds like an incorrect setup of DEVONthink with Dropbox syncing.
No, just the sync store in Dropbox, with the database itself in a non-synced directory elsewhere on the Mac. But although the database isn’t in Dropbox, the contents are text files that are indexed, and the indexed folder is in Dropbox. Hopefully that makes sense. I believe I’m using this how it was explained in one of the help documents explaining the difference between indexing and importing (" A common example is people using a cloud service like Dropbox and indexing folders in the local Dropbox folders.")
It’s most likely a race condition caused by the uncertain order of Dropbox sync, DEVONthink’s sync and filesystem events (which are triggered by the Dropbox.app when synchronizing your local changes to the remote machine).
Disabling filesystem events on the remove machine via a hidden preference (see appendix of help) might therefore also fix this issue. Other possible options are to use imported items or indexed items not located in a Dropbox folder or to increase DEVONthink’s sync interval to make this less likely/frequently or to synchronize only on demand.
Thank you for the suggestions. For various automation reasons, I need the indexed files in the Dropbox folder, and I didn’t want to muck around too much with system-level stuff, so my easy (for me) solution was to automate the shut-down of DEVONthink on the remote machine whenever I Iaunch DEVONthink on the MacBook Pro. It’s on a launch/quit schedule via Keyboard Maestro, but I’ve also set up one piece of automation on each of the two machines:
I have a Keyboard Maestro trigger set up on the MacBook Pro, which, if I open DEVONthink, places a simple text file in a particular Dropbox folder.
Keyboard Maestro on the remote machine has a trigger that, if a file appears in that Dropbox folder (i.e., synced over from the MacBook to the desktop Mac), quits DEVONthink on the remote machine.
It’s only been one day, but so far, so good. I appreciate all the help figuring out what was happening on this one.