[PR #1906] [MERGED] Fix remote storage write guard parity #5341

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1906
Author: @Promansis
Created: 6/2/2026
Status: ✅ Merged
Merged: 6/2/2026
Merged by: @Promansis

Base: refactor ← Head: fix-1895-remote-storage-write-guards


📝 Commits (2)

  • d86f260 Fix remote storage write guard parity
  • 062f4e5 Merge remote-tracking branch 'upstream/refactor' into resolve-pr-1906

📊 Changes

2 files changed (+118 additions, -91 deletions)

View changed files

📝 src-tauri/src/commands/storage/commands/entities.rs (+2 -7)
📝 src-tauri/src/http_dispatch.rs (+116 -84)

📄 Description

Linked issue

Closes #1895

Why this change

  • Remote /api/invoke storage writes had drifted from the embedded Tauri storage command behavior.
  • Remote connection create/update could leave multiple defaultForAgents connections in the same language/image scope.
  • Remote chat preset updates could bypass the embedded guard that rejects protected default-preset field mutations.

What changed

  • Reused the embedded storage entity helpers for remote storage_get, storage_create, and storage_update dispatch.
  • Exposed the existing storage entity inner helpers within the crate so HTTP dispatch does not duplicate storage write behavior.
  • Added focused remote dispatcher coverage for connection default cleanup on create/update and default chat preset mutation rejection.

Refactor impact

Primary owner:

Rust storage and remote runtime.

Impact areas reviewed:

  • src-tauri/src/commands/storage/commands/entities.rs
  • src-tauri/src/http_dispatch.rs
  • Connection default-agent cleanup
  • Chat preset protected/default update guard
  • Remote /api/invoke storage routing

Boundary notes:

  • Remote runtime dispatch now delegates to the Rust storage command owner instead of duplicating create/update/get behavior.
  • No React, engine, or shared API wrapper changes were needed.
  • No new remote command names or allowlist entries were added.

Pressure points touched:

  • Remote runtime /api/invoke storage command dispatch in src-tauri/src/http_dispatch.rs.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • cargo test --manifest-path src-tauri/Cargo.toml http_dispatch::tests::dispatch_storage
  • cargo check --manifest-path src-tauri/Cargo.toml

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Internal remote runtime/storage bugfix only; no new user-discoverable feature or workflow.

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

UI evidence

N/A. Rust storage/runtime behavior only; no visible UI changes.


🔄 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/1906 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix-1895-remote-storage-write-guards` --- ### 📝 Commits (2) - [`d86f260`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d86f2605b68f51aace383192ab8ef8a440b7b4e1) Fix remote storage write guard parity - [`062f4e5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/062f4e5f988d8b7e984816171642b913a22592d3) Merge remote-tracking branch 'upstream/refactor' into resolve-pr-1906 ### 📊 Changes **2 files changed** (+118 additions, -91 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/commands/entities.rs` (+2 -7) 📝 `src-tauri/src/http_dispatch.rs` (+116 -84) </details> ### 📄 Description ## Linked issue Closes #1895 ## Why this change - Remote `/api/invoke` storage writes had drifted from the embedded Tauri storage command behavior. - Remote connection create/update could leave multiple `defaultForAgents` connections in the same language/image scope. - Remote chat preset updates could bypass the embedded guard that rejects protected default-preset field mutations. ## What changed - Reused the embedded storage entity helpers for remote `storage_get`, `storage_create`, and `storage_update` dispatch. - Exposed the existing storage entity inner helpers within the crate so HTTP dispatch does not duplicate storage write behavior. - Added focused remote dispatcher coverage for connection default cleanup on create/update and default chat preset mutation rejection. ## Refactor impact Primary owner: Rust storage and remote runtime. Impact areas reviewed: - `src-tauri/src/commands/storage/commands/entities.rs` - `src-tauri/src/http_dispatch.rs` - Connection default-agent cleanup - Chat preset protected/default update guard - Remote `/api/invoke` storage routing Boundary notes: - Remote runtime dispatch now delegates to the Rust storage command owner instead of duplicating create/update/get behavior. - No React, engine, or shared API wrapper changes were needed. - No new remote command names or allowlist entries were added. Pressure points touched: - Remote runtime `/api/invoke` storage command dispatch in `src-tauri/src/http_dispatch.rs`. ## Validation - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `cargo test --manifest-path src-tauri/Cargo.toml http_dispatch::tests::dispatch_storage` - `cargo check --manifest-path src-tauri/Cargo.toml` ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [ ] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Internal remote runtime/storage bugfix only; no new user-discoverable feature or workflow. ## 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 ## UI evidence N/A. Rust storage/runtime behavior only; no visible UI changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:24 +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#5341
No description provided.