2026-05-17: Fix tauri-install loader marker race
Problem
Section titled “Problem”npm run tauri:install could fail with:
❌ Post-install check failed: loader readiness marker missing in desktop log.Expected: Backend ready — navigating to bundled frontendeven when startup actually completed.
Root cause
Section titled “Root cause”Post-install validation in scripts/tauri-install.sh had race-prone marker logic:
- initial one-shot check read marker too early (before it was logged), causing false failure
- first patch switched to polling, but started scanning from the current end-of-file line
- if marker was already logged before waiter began, polling ignored it and still false-failed
- Extract reusable log-wait helpers (
scripts/lib/tauri-install-checks.sh). - Add TDD regression script reproducing delayed and pre-existing marker cases.
- Pass deterministic
log_lines_beforesnapshot captured before app launch into marker waiter. - Keep strict marker-only readiness requirement.
- Re-run full quality gates +
npm run tauri:install.
AGENTS.md checklist
Section titled “AGENTS.md checklist”| # | Convention | Check |
|---|---|---|
| 1 | Documentation parity | ✅ Plan + release notes updates |
| 2 | 4 test gates | ✅ Executed |
| 3 | Plan self-review | ✅ This file |
| 4 | Endpoint + Bruno + Swagger | ✅ N/A |
| 5 | Bug-to-Test | ✅ Added automated shell regression test |
| 6 | Seed isolation | ✅ N/A |
| 7 | Transaction invariants | ✅ N/A |
| 8 | Plan history before implementation | ✅ This file |
| 9 | Infra test gate | ✅ npm run tauri:install |
| 10 | Environment compatibility | ✅ macOS assumptions unchanged |
| 11 | Do-no-harm baseline | ✅ Failure reproduced before fix, success after |
| 12 | Execution summary | ✅ Appended below |
| 13 | Doc grep rule | ✅ No path/command renames |
| 14 | Semver release + notes | ✅ Completed in release section/commits |
Execution Summary
Section titled “Execution Summary”Commit: d2a62fb, a2e68e6
Actual changes
Section titled “Actual changes”- Added
scripts/lib/tauri-install-checks.shwith:new_logs_since_linewait_for_log_marker(log_path, timeout, marker, from_line)
- Updated
scripts/tauri-install.sh:- capture
log_lines_beforebefore launching app - pass snapshot into marker wait
- retain strict marker requirement and timeout diagnostics
- capture
- Added
scripts/test-tauri-install-marker-wait.shregression script with two scenarios:- delayed marker appears after waiter starts
- marker already present when waiter starts
Deviations from plan
Section titled “Deviations from plan”- None.
Test results
Section titled “Test results”| Gate | Result |
|---|---|
| Backend unit | ✅ cd backend && npm run test:cov |
| Backend e2e | ✅ cd backend && npm run test:e2e |
| Frontend unit | ✅ cd front && npx vitest run --coverage |
| Frontend e2e | ✅ cd front && npm run test:e2e |
| Docs build | ✅ cd docs && npm run build |
| Desktop install/runtime | ✅ npm run tauri:install |
| Script regression | ✅ bash scripts/test-tauri-install-marker-wait.sh |
Key discoveries
Section titled “Key discoveries”- Marker polling must use a launch-time log snapshot (
log_lines_before) to avoid both early-read and already-emitted-marker races.