# Bug in Desktop App - File Cleared Itself

I'm currently studying for a final exam and I messed up my markdown by accidentally pasting the string "(In Notebook)" before the space between the leading ## and the title. When I clicked on this to correct it I was linked to an empty search (because TA thought it was a tag), and when I went back to the main page my document was gone. The file still exists in the Finder but it's empty. What the heck happened?
Thankfully I had a backup of this document in my Apple Notes app (but without the annotations the Archive version had...) but it's scary that a document can just disappear like that due to malformatted tags. I still have The Archive open, so I can force it to generate whatever logs could help debug this issue. For the time being I'm going to move to Notes until I'm done studying for my exam.

• edited February 22

Upon further inspection, it seems the original file has been completely deleted? I can't actually find it anywhere in my Finder or in the Trash. No record of this file ever existing seems to be on my laptop, unless there's something in the logs from TA

• I found the relevant lines in the Console log and was able to retrieve a partial copy of the lost document also from the Console. The relevant document here is 202302201505

Welcome to The Archive?, ¿202102180950 Acknowledgements?]), requestVersion: Req.(6)), appendix: State.ResultAppendix(notes: []), editedNotes: [])) @ W:1

2023-02-22 20:11:46.819 DEBUG - > . . SelectingNotes([¿202302151637 GBI Overview?]) @ W:1

2023-02-22 20:11:46.820 DEBUG - > . . . ChangingSelectedNotes([¿202302151637 GBI Overview?]) @ W:1

2023-02-22 20:11:46.821 DEBUG - > . . . DisplayingNote(¿202302151637 GBI Overview?) @ W:1

2023-02-22 20:11:46.821 DEBUG - > . . . . ChangingDisplayedContent.note(NoteContents(¿202302151637 GBI Overview?, 0 B, selection: TextSelection(location=0, length=0), scrolledTo: 3.0, url: file:///Users/workaccount/Documents/Notes%20(The%20Archive)/202302151637%20GBI%20Overview.txt)) @ W:1

2023-02-22 20:11:46.822 DEBUG - 📝 Replacing note text for ¿202302151637 GBI Overview?
2023-02-22 20:11:46.824 DEBUG - > . . . . CompletingDisplayingNote() @ W:1

2023-02-22 20:11:46.825 DEBUG - > . . . . DisplayingHighlightedTerms() @ W:1

2023-02-22 20:11:46.825 DEBUG - > . . . ScrollingToHighlight() @ W:1

2023-02-22 20:11:46.826 DEBUG - > . . . . CompletingScroll() @ W:1

2023-02-22 20:11:46.826 DEBUG - > . . . ChangingOmnibarContent(omnibarContent: .select(202302151637 GBI Overview)) @ W:1

2023-02-22 20:11:46.826 DEBUG - > . . . . CompletingChangingOmnibarContent() @ W:1

2023-02-22 20:11:46.827 DEBUG - > . . . CompletingNoteSelection() @ W:1

2023-02-22 20:11:46.828 DEBUG - > . . RestoringSearchHistory(search: State.PendingSearch(query: Query(""), reason: .userInitiated, requestVersion: Req.(6), offerSuggestion: false)) @ W:1

2023-02-22 20:11:52.386 DEBUG - > RevealingFilesInFinder(identifiers: NonEmptySet([¿202302151637 GBI Overview?]))

2023-02-22 20:11:52.492 DEBUG - > . CompletingPendingFileInteraction()

Specifically this seems to be the line that caused a silent deletion of my notebook:
I have no idea what caused this as I don't recall ever clicking "delete" or doing anything of the sort.

2023-02-22 20:12:10.512 DEBUG - > DeletingNotes(identifiers: NonEmptySet([¿202302201505?]), isRequiringConfirmation: false) @ W:1

2023-02-22 20:12:10.514 DEBUG - > . RemovingFiles(identifiers: NonEmptySet([¿202302201505?]))

2023-02-22 20:12:10.520 DEBUG - > . . CompletingFileRemoval(bulkFileRemoval: BulkFileRemoval(identifiers=NonEmptySet([¿202302201505?]), uuid=7B687EAC-81C0-4325-A81D-85783F683C35))

2023-02-22 20:12:10.520 DEBUG - > . Thunk(body: (Function))

2023-02-22 20:12:10.521 DEBUG - > . . CompletingNoteDeletion(identifiers: NonEmptySet([¿202302201505?])) @ W:1

2023-02-22 20:12:10.521 DEBUG - > . . . RemovingNotesFromWorkspace(identifiers: NonEmptySet([¿202302201505?])) @ W:1

2023-02-22 20:12:10.554 DEBUG - /Users/workaccount/Documents/Notes (The Archive)/202302201505.txt (42023166) changed: isFile, renamed

2023-02-22 20:12:10.554 DEBUG - remove(url: file:///Users/workaccount/Documents/Notes%20(The%20Archive)/202302201505.txt)

2023-02-22 20:12:10.554 DEBUG - Swallowing expected deletion of file:///Users/workaccount/Documents/Notes%20(The%20Archive)/202302201505.txt

2023-02-22 20:12:14.428 DEBUG - > SelectingNotes([¿202302151138?]) @ W:1

2023-02-22 20:12:14.428 DEBUG - > . ChangingSelectedNotes([¿202302151138?]) @ W:1

2023-02-22 20:12:14.429 DEBUG - > . DisplayingNote(¿202302151138?) @ W:1

2023-02-22 20:12:14.430 DEBUG - > . . ChangingDisplayedContent.note(NoteContents(¿202302151138?, 0 B, selection: TextSelection(location=0, length=0), scrolledTo: 0.0, url: file:///Users/workaccount/Documents/Notes%20(The%20Archive)/202302151138.txt)) @ W:1

2023-02-22 20:12:14.430 DEBUG - 📝 Replacing note text for ¿202302151138?

2023-02-22 20:12:14.431 DEBUG - > . . . SavingNoteScrollOffset(identifier: ¿202302151637 GBI Overview?, scrollOffset: 0.0)

2023-02-22 20:12:14.432 DEBUG - > . . . . CompletingScrollOffsetChange(scrollOffsetChange: State.ScrollOffsetChange(identifier: ¿202302151637 GBI Overview?, scrollOffset: 0.0, uuid: 949B33FC-1BF5-466C-AE3F-DC25CD77BBB2))

2023-02-22 20:12:14.434 DEBUG - > . . CompletingDisplayingNote() @ W:1

2023-02-22 20:12:14.434 DEBUG - > . . PushingToNavigationHistory(identifier: ¿202302151138?, workspaceContents: State.WorkspaceContents(searchResults:

• I was able to recover most of the file from the Console logs. I posted a full console dump of what seems to have caused the issue, but it got held for review.

• edited February 22

It seems the file dump was complete and occured just after the deletion of the original file. Here you can see the line that when clicked (in order to correct it) caused the problem initially:

It is supposed to read "## (In Notebook) Klassenterme"

• @hudmarc If you haven't already, please update to the latest 1.7.11 on the "cutting edge" channel. This sounds like a similar issue to https://forum.zettelkasten.de/discussion/2361/files-with-foreign-content-hiccups-in-the-archive

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

• edited February 23

This sounds similar to my problem. The document that had the issue happen in is full of special characters, and I haven't had a similar issue in any other documents.

Also, can you see the log I posted on your end? It still doesn't show up for me.

• Also, can you see the log I posted on your end? It still doesn't show up for me.

Went through the mod queue, it's now restored. thanks!

If you have the time -- could you try to reproduce the problem with a document full of special characters in a controlled way? I could not reproduce the issue of the linked discussion from @ralfzosel on my end, so more details by more users would help. If not: Thanks either way for reporting!

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

• It's really disturbing that with this app you're always in danger of losing your input. On the other hand, it's generally the best zettelkasten app I've found so far.

So my solution (or actually it's not a solution, it's a workaround) is to regularly run git and a little Python script that does some consistency checks (like e.g. looking for empty files and files with names that start with UID but don't have that number in their title).