[PR #4958] [MERGED] fix: refresh stale staging clients and keep Termux awake #6553

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4958
Author: @SpicyMarinara
Created: 8/12/2026
Status: ✅ Merged
Merged: 8/12/2026
Merged by: @SpicyMarinara

Base: staging ← Head: agent/assigned-issues-4956-4957


📝 Commits (4)

  • 8ad6baa chore: start assigned issue sweep 4956-4957
  • 62612ab fix: refresh stale clients and keep Termux awake
  • 33eb03b fix: address CodeRabbit review feedback
  • 7c0e2a3 test: cover NovelAI connection export defaults

📊 Changes

9 files changed (+320 additions, -3 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 e2e/core-flows.e2e.ts (+174 -0)
📝 packages/client/src/App.tsx (+10 -2)
➕ packages/client/src/build-env.d.ts (+1 -0)
➕ packages/client/src/lib/runtime-build.ts (+21 -0)
📝 packages/client/vite.config.ts (+32 -0)
📝 scripts/regressions/assigned-issue-sweep.regression.ts (+28 -0)
📝 scripts/regressions/launcher-format-guard.regression.mjs (+28 -0)
📝 start-termux.sh (+24 -1)

📄 Description

Linked issues

Closes #4957
Closes #4956

Why this change

NovelAI default parameters already survive the current save, navigation, and import paths, but staging commits keep the same release version. A browser still running an older same-version bundle therefore could not detect that the server had moved to a newer commit and could keep exhibiting the pre-fix behavior.

Android may also suspend a backgrounded Termux process unless its wake lock is active, which makes the local Marinara server appear frozen until Termux is foregrounded again.

What changed

  • Embed the client build commit and compare it with /api/health so same-version staging updates clear stale browser runtime caches and reload once.
  • Preserve version-only compatibility for servers that do not expose build metadata.
  • Acquire a Termux wake lock immediately before starting the server and release it on launcher exit.
  • Add browser regressions covering NovelAI defaults after Save/persona navigation and connection JSON import.
  • Add focused runtime-build and launcher contract regressions.
  • Document both user-facing fixes under CHANGELOG.md Unreleased.

Validation

  • 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

Automated evidence

  • pnpm check
  • bash -n start-termux.sh
  • pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/assigned-issue-sweep.regression.ts
  • node scripts/regressions/launcher-format-guard.regression.mjs
  • pnpm exec playwright test -c playwright.config.ts e2e/core-flows.e2e.ts --project=desktop-chromium --grep 'NovelAI generation defaults survive' (2 passed)
  • Production build inspection confirmed the client bundle and server build metadata contain the same 12-character commit.

Manual verification still required

  • Manually verify a browser left open across two same-version staging commits reloads to the new build without looping.
  • Manually verify NovelAI settings persist after Save, persona navigation, reopening, export, and import in LibreWolf.
  • Manually verify a Termux-hosted client remains responsive while Android backgrounds Termux, and that stopping the launcher releases the wake lock.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] <paths> follow-up issue opened
  • Version/release files updated

No user-facing documentation page changed; CHANGELOG.md contains the release-note entries. No version metadata changed.

Summary by CodeRabbit

  • Bug Fixes

    • Same-version browser clients now refresh when the server build changes, reducing stale-session issues.
    • Termux-hosted servers keep Android awake while running and release the wake lock cleanly on shutdown.
    • Servers without build metadata remain compatible with version recovery.
  • Tests

    • Added coverage for NovelAI seed persistence and imported connection defaults.
    • Added regression checks for build mismatch handling and Termux wake-lock behavior.

🔄 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/4958 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/12/2026 **Status:** ✅ Merged **Merged:** 8/12/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/assigned-issues-4956-4957` --- ### 📝 Commits (4) - [`8ad6baa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8ad6baa438eead010c7dcb0c5993bb8eda3718a0) chore: start assigned issue sweep 4956-4957 - [`62612ab`](https://github.com/Pasta-Devs/Marinara-Engine/commit/62612ab65798127b2192e4df0c2c43183fc2effe) fix: refresh stale clients and keep Termux awake - [`33eb03b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/33eb03b34ac14ae9a9d13a1fe1862ed79371ebb1) fix: address CodeRabbit review feedback - [`7c0e2a3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7c0e2a39e8527d8072558d1013d173c5f5c2744d) test: cover NovelAI connection export defaults ### 📊 Changes **9 files changed** (+320 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `e2e/core-flows.e2e.ts` (+174 -0) 📝 `packages/client/src/App.tsx` (+10 -2) ➕ `packages/client/src/build-env.d.ts` (+1 -0) ➕ `packages/client/src/lib/runtime-build.ts` (+21 -0) 📝 `packages/client/vite.config.ts` (+32 -0) 📝 `scripts/regressions/assigned-issue-sweep.regression.ts` (+28 -0) 📝 `scripts/regressions/launcher-format-guard.regression.mjs` (+28 -0) 📝 `start-termux.sh` (+24 -1) </details> ### 📄 Description ## Linked issues Closes #4957 Closes #4956 ## Why this change NovelAI default parameters already survive the current save, navigation, and import paths, but staging commits keep the same release version. A browser still running an older same-version bundle therefore could not detect that the server had moved to a newer commit and could keep exhibiting the pre-fix behavior. Android may also suspend a backgrounded Termux process unless its wake lock is active, which makes the local Marinara server appear frozen until Termux is foregrounded again. ## What changed - Embed the client build commit and compare it with `/api/health` so same-version staging updates clear stale browser runtime caches and reload once. - Preserve version-only compatibility for servers that do not expose build metadata. - Acquire a Termux wake lock immediately before starting the server and release it on launcher exit. - Add browser regressions covering NovelAI defaults after Save/persona navigation and connection JSON import. - Add focused runtime-build and launcher contract regressions. - Document both user-facing fixes under `CHANGELOG.md` Unreleased. ## Validation - [ ] `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` ### Automated evidence - `pnpm check` - `bash -n start-termux.sh` - `pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/assigned-issue-sweep.regression.ts` - `node scripts/regressions/launcher-format-guard.regression.mjs` - `pnpm exec playwright test -c playwright.config.ts e2e/core-flows.e2e.ts --project=desktop-chromium --grep 'NovelAI generation defaults survive'` (2 passed) - Production build inspection confirmed the client bundle and server build metadata contain the same 12-character commit. ### Manual verification still required - Manually verify a browser left open across two same-version staging commits reloads to the new build without looping. - Manually verify NovelAI settings persist after Save, persona navigation, reopening, export, and import in LibreWolf. - Manually verify a Termux-hosted client remains responsive while Android backgrounds Termux, and that stopping the launcher releases the wake lock. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n] <paths>` follow-up issue opened - [ ] Version/release files updated No user-facing documentation page changed; `CHANGELOG.md` contains the release-note entries. No version metadata changed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Same-version browser clients now refresh when the server build changes, reducing stale-session issues. - Termux-hosted servers keep Android awake while running and release the wake lock cleanly on shutdown. - Servers without build metadata remain compatible with version recovery. - **Tests** - Added coverage for NovelAI seed persistence and imported connection defaults. - Added regression checks for build mismatch handling and Termux wake-lock behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:11:31 +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#6553
No description provided.