I’ve mentioned this before here, but I want to raise it again, as this issue keeps biting me (badly)…
In DT, it is rather easy to create an item that only exists “within” a tag. This happens to me when I’ve clicked on a tag to browse some stuff, then (stupidly) right-click and choose “New Rich Text” or similar while still looking at the tag. Yes, I shouldn’t do this, but it’s far too easy to do. I’m sure I’m not the only one.
Trouble is, this is a time-bomb. In most cases, its safe to delete a tag since the tagged items will still exist in the database (in some group or other). Except, of course, when you have one of those items that accidentally only exists in the tag. Result: lost data when you innocently delete the tag.
Worse, there is no way I can find to easily detect this. So we have a situation that is easy to get into, hard to detect, and can result in lost data. In my book, that’s a prefect storm.
So, I have a suggestion. There is already a search/smart group term “Item is/is not Tagged”. How about adding a new one “Item is/is not Grouped”? (Or, in search syntax, “item:grouped”). If I understand the tag/group model correctly, this should be trivial, since its almost identical to the tagged test.
With this simple addition, its easy to create a search/smart group that detects items that are tagged but not grouped (“item:tagged item:!grouped”). Which is exactly the set of items that are in danger of being deleted with a tag.
… and I really like that 3.x does this, it makes the tags and groups much more robust.
There are still a few holes though. For example, I can right-click on an item in a tag, choose “Duplicate To…” and then choose a destination tag from the “recents” list, which creates a brand-new item that’s only in the target tag (nothing appears in the Inbox in this case, I checked).
I’d still like the “Grouped” search option I mentioned though, since (a) this can catch the edge case like the above and (b) it helps to cleanup 2.x databases where it was far easier to create these “tag only” items.
Ok I sat down and carefully went through all ways I could find that seem to create an item that only exists in a tag. I found three ways to do this, two of which look like they could be bugs. Rather than just show screen shots, I did all the testing in a small database, which is attached. See the README document in the database root for information on the test procedure I used, and my analysis of the results. Hope this helps.