[PR #6439] [CLOSED] Fix client update recovery and Windows launcher readiness #7180

Closed
opened 2026-10-23 04:17:16 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6439
Author: @SirAdoni
Created: 9/20/2026
Status: ❌ Closed

Base: staging ← Head: contrib/e25-update-recovery


📝 Commits (1)

  • 92af760 fix(startup): recover client updates and Windows launchers

📊 Changes

19 files changed (+419 additions, -25 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/client/scripts/build.mjs (+1 -0)
📝 packages/client/src/lib/app-update-prompt.ts (+50 -3)
📝 packages/client/src/lib/runtime-build.ts (+3 -1)
📝 packages/server/src/config/client-static-config.ts (+4 -1)
📝 packages/server/src/db/file-backed-store.ts (+12 -1)
➕ packages/server/src/db/writer-host-identity.ts (+35 -0)
📝 scripts/dev.mjs (+1 -1)
➕ scripts/open-when-ready.cmd (+32 -0)
➕ scripts/pnpm.cmd (+12 -0)
➕ scripts/regressions/app-update-prompt.regression.ts (+58 -0)
➕ scripts/regressions/launcher/open-when-ready.regression.mjs (+23 -0)
➕ scripts/regressions/runtime-build-metadata.regression.ts (+7 -0)
➕ scripts/regressions/start-local-pnpm-shim.regression.mjs (+90 -0)
📝 scripts/regressions/static-cache-headers.regression.ts (+7 -0)
📝 scripts/regressions/storage-writer-lock.regression.ts (+61 -15)
📝 scripts/run-mari.mjs (+1 -0)
📝 start-local.bat (+10 -1)
📝 start.bat (+10 -2)

📄 Description

Linked issue

Closes #6434

Why this change

The update toast can remain visible when Refresh resolves without navigation, and a running server can return the SPA page instead of newly built hashed assets. Windows launchers also need to handle nested pnpm commands when only Corepack or npx is available and wait for server readiness before opening the browser.

What changed

  • Dismiss the update toast when Refresh is clicked, coalesce repeated clicks and provide a bounded full-page fallback after failed, timed-out or no-op service-worker refreshes.
  • Resolve production static files at request time so new hashed assets can be served after a rebuild; retain cache headers and metadata fallback for archive builds without Git information.
  • Add a local pnpm shim after runner selection, preserving exit codes and existing install policy. Add browser readiness polling and hide background helper windows.
  • Persist the local writer-host identity outside campaign storage on Windows and distinguish a stale lease from the current process when a PID is reused. Preserve writer namespace and lease safety checks.
  • Add an Unreleased entry and focused regression proofs.

Validation

Passed full corepack pnpm check using repository-pinned pnpm 10.34.5, plus update-prompt, runtime metadata, static cache headers, launcher readiness, pnpm shim and writer-lock regressions. The shim proof covers actual nested Corepack execution and simulated npx dispatch/exit propagation; it does not claim a real downloaded npx installation. Privacy review and git diff --check passed.

Launcher tests use isolated fixtures. No live campaign lock was deleted, no running user server was restarted and no provider requests were made. Temporary Windows skill materialization was restored and is excluded from the change.

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Verify Refresh from a real installed service-worker update, including repeated clicks and a failed activation.
  • Verify a Windows archive install with Corepack and an npx-only fallback, nested build commands and delayed startup.
  • Verify multi-process writer safety and restart recovery without modifying active campaign locks.
  • Complete required CI and CodeRabbit review before merge. This AI-assisted PR remains draft.

Docs and release impact

Reviewed README, Android README, CONTRIBUTING, CHANGELOG, CONFIGURATION, TROUBLESHOOTING and FAQ together. Existing install/update guidance remains applicable; the Unreleased changelog records the fixes. No version or translated documentation changes.

  • No further docs changes needed
  • Updated docs as needed
  • Translated docs updated or follow-up opened where applicable
  • Version/release files updated if applicable

UI evidence (if applicable)

Generic regression fixtures only. Private screenshots, campaign data, credentials and personal paths are excluded.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/6439 **Author:** [@SirAdoni](https://github.com/SirAdoni) **Created:** 9/20/2026 **Status:** ❌ Closed **Base:** `staging` ← **Head:** `contrib/e25-update-recovery` --- ### 📝 Commits (1) - [`92af760`](https://github.com/Pasta-Devs/Marinara-Engine/commit/92af760992b001d03ec31ab11760c553bf28767a) fix(startup): recover client updates and Windows launchers ### 📊 Changes **19 files changed** (+419 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/client/scripts/build.mjs` (+1 -0) 📝 `packages/client/src/lib/app-update-prompt.ts` (+50 -3) 📝 `packages/client/src/lib/runtime-build.ts` (+3 -1) 📝 `packages/server/src/config/client-static-config.ts` (+4 -1) 📝 `packages/server/src/db/file-backed-store.ts` (+12 -1) ➕ `packages/server/src/db/writer-host-identity.ts` (+35 -0) 📝 `scripts/dev.mjs` (+1 -1) ➕ `scripts/open-when-ready.cmd` (+32 -0) ➕ `scripts/pnpm.cmd` (+12 -0) ➕ `scripts/regressions/app-update-prompt.regression.ts` (+58 -0) ➕ `scripts/regressions/launcher/open-when-ready.regression.mjs` (+23 -0) ➕ `scripts/regressions/runtime-build-metadata.regression.ts` (+7 -0) ➕ `scripts/regressions/start-local-pnpm-shim.regression.mjs` (+90 -0) 📝 `scripts/regressions/static-cache-headers.regression.ts` (+7 -0) 📝 `scripts/regressions/storage-writer-lock.regression.ts` (+61 -15) 📝 `scripts/run-mari.mjs` (+1 -0) 📝 `start-local.bat` (+10 -1) 📝 `start.bat` (+10 -2) </details> ### 📄 Description ## Linked issue Closes #6434 ## Why this change The update toast can remain visible when Refresh resolves without navigation, and a running server can return the SPA page instead of newly built hashed assets. Windows launchers also need to handle nested pnpm commands when only Corepack or npx is available and wait for server readiness before opening the browser. ## What changed - Dismiss the update toast when Refresh is clicked, coalesce repeated clicks and provide a bounded full-page fallback after failed, timed-out or no-op service-worker refreshes. - Resolve production static files at request time so new hashed assets can be served after a rebuild; retain cache headers and metadata fallback for archive builds without Git information. - Add a local pnpm shim after runner selection, preserving exit codes and existing install policy. Add browser readiness polling and hide background helper windows. - Persist the local writer-host identity outside campaign storage on Windows and distinguish a stale lease from the current process when a PID is reused. Preserve writer namespace and lease safety checks. - Add an Unreleased entry and focused regression proofs. ## Validation Passed full `corepack pnpm check` using repository-pinned pnpm 10.34.5, plus update-prompt, runtime metadata, static cache headers, launcher readiness, pnpm shim and writer-lock regressions. The shim proof covers actual nested Corepack execution and simulated npx dispatch/exit propagation; it does not claim a real downloaded npx installation. Privacy review and git diff --check passed. Launcher tests use isolated fixtures. No live campaign lock was deleted, no running user server was restarted and no provider requests were made. Temporary Windows skill materialization was restored and is excluded from the change. - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - [ ] Verify Refresh from a real installed service-worker update, including repeated clicks and a failed activation. - [ ] Verify a Windows archive install with Corepack and an npx-only fallback, nested build commands and delayed startup. - [ ] Verify multi-process writer safety and restart recovery without modifying active campaign locks. - [ ] Complete required CI and CodeRabbit review before merge. This AI-assisted PR remains draft. ## Docs and release impact Reviewed README, Android README, CONTRIBUTING, CHANGELOG, CONFIGURATION, TROUBLESHOOTING and FAQ together. Existing install/update guidance remains applicable; the Unreleased changelog records the fixes. No version or translated documentation changes. - [ ] No further docs changes needed - [ ] Updated docs as needed - [ ] Translated docs updated or follow-up opened where applicable - [ ] Version/release files updated if applicable ## UI evidence (if applicable) Generic regression fixtures only. Private screenshots, campaign data, credentials and personal paths are excluded. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:17:16 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7180
No description provided.