Repository navigation
fix: list recipes when the collection is on a Windows network drive - #787
Merged
Merged
Conversation
On Windows a mapped network drive or share canonicalizes to a `\\?\UNC\…` path, and glob, which every cooklang-find walk uses, finds nothing under it (cooklang#783). Windows-only, through the admin share. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The base path goes through `std::fs::canonicalize`, which on Windows
returns a `\\?\` path. `glob`, which every cooklang-find walk uses,
returns nothing under one other than `\\?\C:\…`, so a collection on a
mapped network drive or share (`\\?\UNC\…`) showed an empty home page,
and search, in the server and `cook search`, found nothing, while a
recipe's URL still opened it.
`resolve_to_absolute_path` now drops the prefix with `dunce` where
Windows allows it, and keeps the absolute path as given where the
canonical one cannot be spelled without it (`\\?\Volume{…}`). Every
containment check canonicalizes both sides itself, so they still agree.
Fixes cooklang#783
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LeMyst
force-pushed
the
fix/783-windows-share-listing
branch
from
October 27, 2026 18:53
884d7e8 to
aea1e68
Compare
LeMyst
marked this pull request as ready for review
October 27, 2026 19:02
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.
Fixes #783.
Cause
resolve_to_absolute_path(used by the server and the CLI) runs the base path throughstd::fs::canonicalize, added in 85b91b0 ("fix: issue with . base path in server"). On Windows that returns a verbatim path. For a local disk it is\\?\C:\…, whichglobwalks fine. A mapped network drive or share comes back as\\?\UNC\server\share\…, and some virtual drives as\\?\Volume{…}\…; for those,globdeliberately returns no matches (check_windows_verbatim). Everycooklang-findwalk (build_tree,search) globs from the base path.So the home page, folders, search and
cook searchfind nothing, while/recipe/French/crepes.cookstill opens: that is a plain join and read, no walk. That matches the report, and it explains why older releases behave the same.Fix
resolve_to_absolute_pathnow spells the canonical path without\\?\where Windows allows it (dunce::simplified, already in the tree through other crates):\\?\C:\xbecomesC:\x\\?\UNC\nas\share\xbecomes\\nas\share\xWhere it can't be spelled that way (
\\?\Volume{…}), it keeps the absolute path as given. The containment checks (inside_collection, rename, new file, users file, shopping list output) canonicalize both sides themselves, so they still agree.private_pathsalready hides both spellings.Tests
Two Windows-only tests in
src/util/mod.rs. The second reaches a temp folder through the\\localhost\C$admin share, which canonicalizes like a mapped drive. The first commit carries only these tests, and its Windows run shows the bug without the fix:Confirmed by the reporter
The reporter confirmed that their recipe folder is on a mapped network drive (
N:mapped to\\SERVER\data\), andcook server -vlogs the base path as\\?\UNC\SERVER\data\Cooking Stuff\CookCLI: the case the share test reproduces.🤖 Generated with Claude Code