Repository navigation
Conversation
Both `fetchAllDirectories` methods in `FSNotesCore/Business/Project.swift` and `FSNotesCore/Business/Storage.swift` now prefetch `.isDirectoryKey` and `.isPackageKey` and skip non-directories before evaluating exclusions, so `skipDescendants()` is only called on directories and packages. Valid directories are collected directly in that single pass up to `maxDirs` (preserving the hidden-directory check in `Project.swift`), removing the second pass. Fixes glushchenko#2054
This branch has not been deployed
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.
Motivation
Nested subfolders can disappear from the sidebar after restarting FSNotes, even though their notes remain indexed and searchable. Subfolders created during a session show up immediately but vanish on the next launch.
Project.fetchAllDirectories()andStorage.fetchAllDirectories(url:)calledfileEnumerator.skipDescendants()whenever an item matched the excluded extensions or path filters, including regular files like.mdor.png. CallingskipDescendants()on a non-directory makesFileManager.DirectoryEnumeratorskip the rest of the parent directory, dropping subsequent subdirectories and their subtrees.Summary
Both
fetchAllDirectoriesmethods inFSNotesCore/Business/Project.swiftandFSNotesCore/Business/Storage.swiftnow prefetch.isDirectoryKeyand.isPackageKeyand skip non-directories before evaluating exclusions, soskipDescendants()is only called on directories and packages. Valid directories are collected directly in that single pass up tomaxDirs(preserving the hidden-directory check inProject.swift), removing the second pass.How it was tested
No local test run is recorded for the fsnotes Project: change to
FSNotesCore/Business/Project.swiftandFSNotesCore/Business/Storage.swift.Fixes #2054