sillsdev / sillsdev/languageforge-lexbox

Consolidate FwLiteWeb data paths behind a single BaseDataDir

Open
#2,424 0 comments 0 reactions 0 assignees View on GitHub

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 (new FwLiteWebConfig or similar), mirroring FwLiteMauiConfig.
  • Derive LcmCrdtConfig.ProjectPath, AuthConfig.CacheFileName, and (if applicable) CrdtConfig.FailedSyncOutputPath from it, instead of each being set independently.
  • Reduce EnsureDataDirectoriesExist back to a single Directory.CreateDirectory(baseDataPath) call.
  • Update platform.bible-extension/src/main.ts (launchFwLite) to pass one --FwLiteWeb:BaseDataDir=<dir> flag instead of the two separate LcmCrdt:ProjectPath / Auth:CacheFileName flags.

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 FwLiteWeb besides the Platform.Bible extension that set LcmCrdt:ProjectPath / Auth:CacheFileName directly, to avoid a silent breaking change.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.