Skip to content

Fix(vault): a system folder that is a link no longer hides the rest of the root - #71

Merged
adibhanna merged 1 commit into
mainfrom
claude/listnotes-linked-folder-4f1e0e
Nov 4, 2026
Merged

adibhanna merged 1 commit into
mainfrom
claude/listnotes-linked-folder-4f1e0e

Conversation

@adibhanna

Copy link
Copy Markdown
Contributor

In a root-mode vault, a system folder that is a symbolic link made ListNotes drop 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. WalkDir reports a link as a non-directory, and SkipDir on a non-directory skips the rest of the parent, which here is the vault root. It now returns nil, as ListFolders, the task scan and its fingerprint already do. The entry stays hidden, and linkedSystemFolders is untouched.

Tests, in internal/vault/destination_links_test.go:

  • quick, archive, trash and the assets folder as links, plus an archive remapped to Held and a trash remapped to Aside, keep the rest of the root listed. Hidden names come from the settings, not from a literal.
  • A plain file named quick keeps the rest of the root listed.
  • A linked system folder named Held.md is not listed as an inbox note.

All three fail on main, and all three fail again if SkipDir is put back. The third also fails if the hide check is removed. go vet ./... and go test ./... pass locally. This was tested at the ListNotes level, not through a running server.

Not changed here: the archive's own walk still reports that Held.md link, under archive and flagged as a link, because its folder root is not a directory. That predates this change and is left for a separate look.

…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.
@adibhanna
adibhanna merged commit a2532b8 into main Nov 4, 2026
10 checks passed
@adibhanna
adibhanna deleted the claude/listnotes-linked-folder-4f1e0e branch November 4, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant