Skip to content

Pass stable data dir to FW Lite to survive extension version updates#2385

Merged
imnasnainaec merged 5 commits into
developfrom
pb-ext-stable-data-path
Jul 8, 2026
Merged

Pass stable data dir to FW Lite to survive extension version updates#2385
imnasnainaec merged 5 commits into
developfrom
pb-ext-stable-data-path

Conversation

@imnasnainaec

@imnasnainaec imnasnainaec commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Platform.Bible runs each extension version from a versioned cache directory, so FW Lite's default of storing projects and auth cache relative to its binary would orphan data on every update. Pass explicit paths rooted at ~/.platform.bible/extensions/lexicon/ to keep data stable across versions.

Closes #2351

Devin: https://app.devin.ai/review/sillsdev/languageforge-lexbox/pull/2385

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@imnasnainaec, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 22c98190-48f0-4b03-bb54-4b4cdb6503a6

📥 Commits

Reviewing files that changed from the base of the PR and between 9e5502d and 6eae32e.

📒 Files selected for processing (1)
  • platform.bible-extension/src/main.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pb-ext-stable-data-path

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hahn-kev hahn-kev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks correct to me

@imnasnainaec imnasnainaec force-pushed the pb-ext-stable-data-path branch from 0fb240f to db851ab Compare June 30, 2026 15:19
@imnasnainaec

This comment was marked as resolved.

imnasnainaec and others added 4 commits July 7, 2026 13:44
Platform.Bible runs each extension version from a versioned cache directory,
so FW Lite's default of storing projects and auth cache relative to its binary
would orphan data on every update. Pass explicit paths rooted at
~/.platform.bible/extensions/lexicon/ to keep data stable across versions.

Closes #2351

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Platform.Bible actively rejects require() calls for non-papi modules at
runtime. Replace fs/os/path imports with process.env globals (which are
Node.js globals, not requires) and remove the pre-launch mkdirSync (FW
Lite creates its own data directories). Also reverts the incorrect
webpack externals change that made the build succeed but not the runtime.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@imnasnainaec imnasnainaec force-pushed the pb-ext-stable-data-path branch from db851ab to b1875e5 Compare July 7, 2026 17:46
- Nest under a fw-lite subfolder so it doesn't share extensions/lexicon
  with Platform.Bible's own papi.storage user-data for this extension.
- Mirror dev vs. packaged app:// resolution (paranext-core's getAppDir)
  so `npm start` uses dev-appdata instead of the real per-user location.
- Throw on missing USERPROFILE instead of silently building a
  drive-relative path; drop the dead HOME fallback (win32 is already
  guaranteed by the time this runs).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@imnasnainaec imnasnainaec marked this pull request as ready for review July 7, 2026 21:26
@imnasnainaec imnasnainaec requested a review from hahn-kev July 7, 2026 21:26
@imnasnainaec imnasnainaec merged commit e3fddb3 into develop Jul 8, 2026
7 checks passed
@imnasnainaec imnasnainaec deleted the pb-ext-stable-data-path branch July 8, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FwLiteWeb state is binary-relative, so every Platform.Bible extension update would orphan it

2 participants