sillsdev / sillsdev/languageforge-lexbox
Consolidate FwLiteWeb data paths behind a single BaseDataDir
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9
- Forks
- 8
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 49
Description
Problem
FwLiteWeb configures its on-disk locations as independent settings — LcmCrdt:ProjectPath and Auth:CacheFileName are set separately by callers (e.g. the Platform.Bible extension's launchFwLite in platform.bible-extension/src/main.ts). Nothing ties them together, so a caller can point them at different locations without anything catching it. #2417 added EnsureDataDirectoriesExist to FwLiteWebServer.cs to create both directories at startup, but that's a workaround for the missing-directory symptom, not the underlying inconsistency.
FwLiteMauiKernel already solves this with a single BaseDataDir (FwLiteMauiConfig.cs), from which ProjectPath, AuthCacheFilePath, FailedSyncOutputPath, LocalResourceCachePath, and log paths are all derived. FwLiteWeb should follow the same pattern.
Raised as a non-blocking suggestion on #2417: https://github.com/sillsdev/languageforge-lexbox/pull/2417#pullrequestreview-4641535206
Proposed change
- Add a
BaseDataDir-style setting to FwLiteWeb's config (newFwLiteWebConfigor similar), mirroringFwLiteMauiConfig. - Derive
LcmCrdtConfig.ProjectPath,AuthConfig.CacheFileName, and (if applicable)CrdtConfig.FailedSyncOutputPathfrom it, instead of each being set independently. - Reduce
EnsureDataDirectoriesExistback to a singleDirectory.CreateDirectory(baseDataPath)call. - Update
platform.bible-extension/src/main.ts(launchFwLite) to pass one--FwLiteWeb:BaseDataDir=<dir>flag instead of the two separateLcmCrdt:ProjectPath/Auth:CacheFileNameflags.
Out of scope / watch for
- Must not break
appsettings.sdk.json's relative-path default (ProjectPath: "./fw-lite-projects") for local/dev SDK mode. - Check for any other consumers of
FwLiteWebbesides the Platform.Bible extension that setLcmCrdt:ProjectPath/Auth:CacheFileNamedirectly, to avoid a silent breaking change.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare FwLiteMauiConfig.cs with the FwLiteWeb configuration and FwLiteWebServer.cs, then inspect appsettings.sdk.json and launchFwLite in platform.bible-extension/src/main.ts. Done means FwLiteWeb derives its project, auth cache, and applicable failed-sync paths from one BaseDataDir, creates that base directory, preserves the relative SDK default, and no other direct consumers are missed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, typescript
- Domain
- backend, full-stack
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100