Create FwLite data directories at FwLiteWeb startup#2417
Conversation
FwLiteWeb never created its project or auth-cache directories, unlike the MAUI host (FwLiteMauiKernel). That was harmless while the paths defaulted to the working directory, but a host can point LcmCrdt:ProjectPath and Auth:CacheFileName at a per-user location that doesn't exist yet. When it does, a missing directory makes project listing (Directory.EnumerateFiles), project creation (SQLite open), and MSAL cache init all throw. Create both directories up front in SetupAppServer so every host — not just the one passing the path — is covered. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughFwLiteWebServer.cs now creates required data directories (LCM project path and MSAL auth cache file directory) at startup, before the HTTP request pipeline is configured, via a new private helper called from SetupAppServer. ChangesStartup directory creation
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
hahn-kev
left a comment
There was a problem hiding this comment.
while we're doing this should we also introduce a base data dir like we have in the maui kernel? That would certainly simplify configuration and setting paths that we're doing today.
Up to you, if we're happy with how it works today then I'm fine to merge this.
FwLiteWeb never created its project or auth-cache directories, unlike the MAUI host (
FwLiteMauiKernel). That was harmless while the paths defaulted to the working directory (always present), but a host can pointLcmCrdt:ProjectPath/Auth:CacheFileNameat a per-user location that doesn't exist yet — and can't create it itself. When the directory is missing, three things throw on a fresh install:CrdtProjectsService.ListProjects()callsDirectory.EnumerateFiles(ProjectPath, "*.sqlite")with no existence guard →DirectoryNotFoundException.ProjectPath; Microsoft.Data.Sqlite won't create parent dirs → "unable to open database file".MsalCacheHelper.CreateAsyncopens a lockfile in the cache dir.This creates both directories up front in
SetupAppServer, mirroring what the MAUI host already does. Doing it in the backend covers every host, not just the one passing the path.Addresses point 1 (the blocking finding) of the review on #2385: #2385 (comment) — the finding this PR unblocks stems from #2385 pointing FW Lite's data at
~/.platform.bible/extensions/lexicon/(closes #2351).Test plan
dotnet build FwLiteWeb/FwLiteWeb.csprojsucceeds (no new warnings)--LcmCrdt:ProjectPath/--Auth:CacheFileNamepointed at a non-existent per-user dir, FwLiteWeb starts, lists/creates projects, and signs in without aDirectoryNotFoundException🤖 Generated with Claude Code
Devin review: https://app.devin.ai/review/sillsdev/languageforge-lexbox/pull/2417