[PR #1294] [MERGED] Fix invalid remote runtime URL fallback #5019

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1294
Author: @cha1latte
Created: 5/26/2026
Status: ✅ Merged
Merged: 5/26/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/refactor-issue-1246-invalid-remote-url


📝 Commits (2)

  • 813c7cc Fix invalid remote runtime URL fallback
  • 7b51309 Assert malformed runtime URL skips fetch

📊 Changes

2 files changed (+64 additions, -2 deletions)

View changed files

📝 src/shared/api/remote-runtime.ts (+5 -2)
➕ src/shared/api/tauri-client.test.ts (+59 -0)

📄 Description

Linked issue

Fixes #1246

Why this change

  • A malformed configured Remote Runtime URL was treated the same as no remote URL, so supported shared Tauri commands could fall back to embedded/local Tauri instead of failing closed.

What changed

  • Preserve the distinction between blank remote runtime config and malformed configured remote runtime config.
  • Throw a 400 ApiError with invalid_remote_runtime_url when parsing a configured Remote Runtime URL fails.
  • Add focused regression coverage for blank embedded fallback, valid remote routing, and malformed configured URL fail-closed behavior.

Refactor impact

Primary owner:

Shared API / remote runtime routing.

Impact areas reviewed:

  • Shared Tauri client command routing.
  • Remote runtime target parsing.
  • Storage-backed invokeTauri command behavior.

Boundary notes:

  • Blank Remote Runtime URL still uses embedded Tauri.
  • Valid Remote Runtime URL still routes supported commands to /api/invoke.
  • Malformed configured Remote Runtime URL now rejects before embedded/local fallback.

Pressure points touched:

  • src/shared/api/remote-runtime.ts
  • src/shared/api/tauri-client.test.ts

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

  • Codex reproduced the original failure with pnpm exec vitest run src/shared/api/tauri-client.test.ts: before the fix, the malformed configured URL case resolved through the embedded Tauri mock instead of rejecting.
  • Codex verified the fixed behavior with pnpm exec vitest run src/shared/api/tauri-client.test.ts: 3 tests passed.
  • Edge cases covered by the targeted test:
    • Blank Remote Runtime URL still falls back to embedded Tauri for storage_list.
    • Valid Remote Runtime URL still routes supported storage_list to remote fetch.
    • Malformed configured Remote Runtime URL rejects with invalid_remote_runtime_url and does not call embedded invoke.
  • Codex ran pnpm check; it passed check:architecture, check:frontend, check:rust, and check:docs.
  • Codex ran the Marinara proof gate against scratch/bugfix-verification.json; it passed.
  • Evidence: Issue #1246 targeted verification
  • Raw targeted output: https://gist.githubusercontent.com/cha1latte/cf9909136c6c35d8009c9420588dbd3b/raw/5c9c260093c2bec21547915f3499d45496185b34/issue-1246-targeted-after.txt

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No docs or release metadata changes are needed for this narrow shared API routing fix.

UI evidence

N/A: this is shared runtime routing behavior, not a visible UI change. Non-UI verification evidence is embedded above.


🔄 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/1294 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/26/2026 **Status:** ✅ Merged **Merged:** 5/26/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/refactor-issue-1246-invalid-remote-url` --- ### 📝 Commits (2) - [`813c7cc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/813c7cc46974f5359345f9e73a4da45ff1235644) Fix invalid remote runtime URL fallback - [`7b51309`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7b513095929334a621a6667eb43464b8195206dc) Assert malformed runtime URL skips fetch ### 📊 Changes **2 files changed** (+64 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/shared/api/remote-runtime.ts` (+5 -2) ➕ `src/shared/api/tauri-client.test.ts` (+59 -0) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Fixes #1246 ## Why this change - A malformed configured Remote Runtime URL was treated the same as no remote URL, so supported shared Tauri commands could fall back to embedded/local Tauri instead of failing closed. ## What changed - Preserve the distinction between blank remote runtime config and malformed configured remote runtime config. - Throw a 400 `ApiError` with `invalid_remote_runtime_url` when parsing a configured Remote Runtime URL fails. - Add focused regression coverage for blank embedded fallback, valid remote routing, and malformed configured URL fail-closed behavior. ## Refactor impact Primary owner: Shared API / remote runtime routing. Impact areas reviewed: - Shared Tauri client command routing. - Remote runtime target parsing. - Storage-backed `invokeTauri` command behavior. Boundary notes: - Blank Remote Runtime URL still uses embedded Tauri. - Valid Remote Runtime URL still routes supported commands to `/api/invoke`. - Malformed configured Remote Runtime URL now rejects before embedded/local fallback. Pressure points touched: - `src/shared/api/remote-runtime.ts` - `src/shared/api/tauri-client.test.ts` ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> - [ ] `pnpm check` passes locally - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes - Codex reproduced the original failure with `pnpm exec vitest run src/shared/api/tauri-client.test.ts`: before the fix, the malformed configured URL case resolved through the embedded Tauri mock instead of rejecting. - Codex verified the fixed behavior with `pnpm exec vitest run src/shared/api/tauri-client.test.ts`: 3 tests passed. - Edge cases covered by the targeted test: - Blank Remote Runtime URL still falls back to embedded Tauri for `storage_list`. - Valid Remote Runtime URL still routes supported `storage_list` to remote fetch. - Malformed configured Remote Runtime URL rejects with `invalid_remote_runtime_url` and does not call embedded invoke. - Codex ran `pnpm check`; it passed `check:architecture`, `check:frontend`, `check:rust`, and `check:docs`. - Codex ran the Marinara proof gate against `scratch/bugfix-verification.json`; it passed. - Evidence: ![Issue #1246 targeted verification](https://gist.githubusercontent.com/cha1latte/cf9909136c6c35d8009c9420588dbd3b/raw/83be64bd1314da0be6ad7546ad11b34084195d5a/issue-1246-targeted-after.svg) - Raw targeted output: https://gist.githubusercontent.com/cha1latte/cf9909136c6c35d8009c9420588dbd3b/raw/5c9c260093c2bec21547915f3499d45496185b34/issue-1246-targeted-after.txt ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims No docs or release metadata changes are needed for this narrow shared API routing fix. ## UI evidence N/A: this is shared runtime routing behavior, not a visible UI change. Non-UI verification evidence is embedded above. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:12: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#5019
No description provided.