Repository navigation
Fix(vault): a system folder that is a link no longer hides the rest of the root - #71
Merged
Merged
Conversation
…f the root In a root-mode vault, ListNotes hides the system folders at the vault root. It did that with filepath.SkipDir whatever the entry was. WalkDir reports a link as a non-directory, and SkipDir on a non-directory skips the rest of its parent, so a linked `archive` dropped every root note and folder sorted after it. A remapped folder did the same under its own name, and so did a plain file with a hidden name. A linked `Aside` took nearly the whole vault with it. The walk now passes over the entry and carries on. The entry itself stays hidden. ListFolders, the task scan and its fingerprint already did this. The bug goes back to the first server, and anything built on the listing, like the link rewrite when a note or folder is renamed, missed the same notes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a root-mode vault, a system folder that is a symbolic link made
ListNotesdrop every root entry sorted after it. A remapped folder did the same under its own name, and so did a plain file carrying a hidden name. Released servers all have this.The walk hid the entry with
filepath.SkipDir.WalkDirreports a link as a non-directory, andSkipDiron a non-directory skips the rest of the parent, which here is the vault root. It now returnsnil, asListFolders, the task scan and its fingerprint already do. The entry stays hidden, andlinkedSystemFoldersis untouched.Tests, in
internal/vault/destination_links_test.go:quick,archive,trashand the assets folder as links, plus anarchiveremapped toHeldand atrashremapped toAside, keep the rest of the root listed. Hidden names come from the settings, not from a literal.quickkeeps the rest of the root listed.Held.mdis not listed as an inbox note.All three fail on
main, and all three fail again ifSkipDiris put back. The third also fails if the hide check is removed.go vet ./...andgo test ./...pass locally. This was tested at theListNoteslevel, not through a running server.Not changed here: the archive's own walk still reports that
Held.mdlink, underarchiveand flagged as a link, because its folder root is not a directory. That predates this change and is left for a separate look.