Skip to content
Strata v1.2.6

2026-05-13: Fix Tauri Prod — Wrong DB Path and Wrong Version

Fix: Tauri Prod — Wrong DB Path and Wrong Version

Section titled “Fix: Tauri Prod — Wrong DB Path and Wrong Version”

1. Seeded demo data instead of real production data

Section titled “1. Seeded demo data instead of real production data”

npm run tauri:prod builds and opens Strata.app. The app showed seeded demo data instead of the user’s real assets.

Root cause: Two separate database files, neither pointing to the same location:

  • Docker prod (npm run docker:prod): backend/.data/strata.db ← real data
  • Tauri prod (.app): ~/Library/Application Support/Strata/strata.db ← created fresh → seeded

The user expects tauri:prod and docker:prod to share the same strata.db — the intended workflow is: run web app → close → open desktop app → see the same data.

2. Version displays 1.1.0-2-gc6c9ce4-dirty

Section titled “2. Version displays 1.1.0-2-gc6c9ce4-dirty”

Should display 1.1.0. Root cause:

  • tauri-build.sh does not set VERSION_OVERRIDE, unlike docker:prod
  • git describe --tags --dirty --always returns the full string with commit count and dirty suffix
  • src-tauri/build.rs calls version.mjs --json directly (no VERSION_OVERRIDE)
  • Git tree is dirty: front/.astro/types.d.ts + src-tauri/Cargo.lock are modified
#ConventionStatus
1Doc updateDesktopApp.md needs updating; plan doc saved
2All 4 test gatesInfra/Rust change — Convention 9 applies; unit/e2e not affected
3Self-reviewAll referenced files verified
4Endpoint coverageNo new endpoints
5Bug-to-TestBuild script bug — verified by running the script
6Seed isolationN/A
7Transaction invariantsN/A
8Plan historyThis file saved to docs/src/content/docs/plans/
9Infra test gateMust run ./scripts/tauri-build.sh && open Strata.app to verify
10Env compatibilityNo new tools
11Do-no-harm baselineDocumented current state above
12Execution SummaryAppended after verification
13Doc Grep Rulegrep -r 'Application Support' docs/src/ — DesktopApp.md updated

Fix 1: Share DB between Docker prod and Tauri prod

Section titled “Fix 1: Share DB between Docker prod and Tauri prod”

Change data_dir() in src-tauri/src/lib.rs: Remove the dev/prod branch — always use <repo>/backend/.data/, same as the dev build and Docker:

repo/backend/.data/
// Before (prod branch):
fn data_dir() -> std::path::PathBuf {
if is_dev_build() {
} else {
// ~/Library/Application Support/Strata/
}
}
// After (unified):
fn data_dir() -> std::path::PathBuf {
// Both dev and prod Tauri builds use backend/.data/
// This matches Docker dev (strata-dev.db) and Docker prod (strata.db)
let manifest = std::path::Path::new(env!("CARGO_MANIFEST_DIR"));
let repo_root = manifest.parent().expect("CARGO_MANIFEST_DIR has no parent");
repo_root.join("backend").join(".data")
}

Remove the now-unused dirs crate:

  • src-tauri/Cargo.toml: remove dirs = "6"
  • src-tauri/build.rs: no change needed (dirs not used there)

Add VERSION_OVERRIDE to scripts/tauri-build.sh (mirrors docker:prod behavior):

Terminal window
# After the root npm install, before any build steps:
export VERSION_OVERRIDE="$(git describe --tags --abbrev=0 2>/dev/null)"

Add cargo:rerun-if-env-changed to src-tauri/build.rs:

println!("cargo:rerun-if-env-changed=VERSION_OVERRIDE");

This ensures cargo reruns build.rs when VERSION_OVERRIDE changes (otherwise cached).

FileChange
src-tauri/src/lib.rsSimplify data_dir() — always return backend/.data/
src-tauri/Cargo.tomlRemove dirs = "6" dependency
scripts/tauri-build.shAdd export VERSION_OVERRIDE before build steps
src-tauri/build.rsAdd cargo:rerun-if-env-changed=VERSION_OVERRIDE
docs/src/content/docs/DesktopApp.mdUpdate DB path docs — prod now uses backend/.data/
  1. npm run tauri:prod opens app showing real production assets (from backend/.data/strata.db)
  2. Version displays 1.1.0 (or latest clean tag) — no -dirty, no commit count
  3. File → Reveal Data Folder opens backend/.data/ in both dev and prod Tauri builds
  4. DesktopApp.md updated to reflect shared DB path

Commit: 6558f43

  • src-tauri/src/lib.rs: Simplified data_dir() — removed prod branch pointing to ~/Library/Application Support/Strata/; both dev and prod now return backend/.data/
  • src-tauri/Cargo.toml: Removed dirs = "6" (no longer needed)
  • src-tauri/Cargo.lock: Auto-updated by cargo (dirs and its transitive deps removed)
  • scripts/tauri-build.sh: Added export VERSION_OVERRIDE="$(git describe --tags --abbrev=0 2>/dev/null || true)" after root npm install
  • src-tauri/build.rs: Added cargo:rerun-if-env-changed=VERSION_OVERRIDE
  • docs/src/content/docs/DesktopApp.md: Updated all DB path references; architecture diagram updated

None. All changes implemented exactly as planned.

GateResult
Backend unit⏭ not affected
Backend e2e⏭ not affected
Frontend unit⏭ not affected
Frontend e2e⏭ not affected
Infra (tauri-build.sh)✅ full build succeeded; version shows 1.1.0 (production); Strata.app produced
  • The -dirty in the version string came from front/.astro/types.d.ts and src-tauri/Cargo.lock being modified in the working tree — VERSION_OVERRIDE bypasses all git describe output cleanly.
  • dirs crate was the only external dependency added solely for the ~/Library/Application Support/ prod path; removing it reduces the dependency surface.