mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1895] [Issue]: remote storage writes bypass embedded connection and chat preset guards #918
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#918
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Xelvanis on GitHub (Jun 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1895
Originally assigned to: @Promansis on GitHub.
Summary
The remote
/api/invokestorage write path duplicates embedded storage command logic and misses side effects/guards for some entities. Connection writes can skip the single-default cleanup fordefaultForAgents, and remote chat preset updates can bypass the embedded guard that blocks mutating default presets.Expected behavior
Embedded Tauri storage commands and hostable
/api/invokestorage commands should enforce the same write behavior:defaultForAgents: trueshould clear other default agent connections in the same language/image scopeActual behavior
Static inspection shows the embedded path and remote path diverge:
storage_createcallsclear_other_default_agent_connectionsafter creatingconnectionsstorage_updaterouteschat-presetsthroughpatch_chat_presetand callsclear_other_default_agent_connectionsafter updatingconnectionsstorage_createcreatesconnectionsand masks secrets, but does not clear other default agent connectionsstorage_updatehandlesconnectionsdirectly throughconnection_secrets::patch_connectionand otherwise falls through to genericstate.storage.patch, with nochat-presetsdefault-preset guardSteps to reproduce
/api/invokepath.defaultForAgents: true.defaultForAgents: true.storage_updateon a defaultchat-presetsrecord with a patch that mutates protected default fields.Expected: remote behavior matches embedded behavior.
Actual from code inspection: the remote path can leave multiple default agent connections and can route default chat preset updates through the generic patch path.
Impact area
Environment
/api/invokeLogs, screenshots, or video
No runtime screenshot attached. Static evidence:
src-tauri/src/commands/storage/commands/entities.rs: embeddedstorage_create_innerclears other default agent connections forconnections.src-tauri/src/commands/storage/commands/entities.rs: embeddedstorage_update_innerrouteschat-presetsthroughpatch_chat_presetand clears other default agent connections after connection updates.src-tauri/src/http_dispatch.rs: remotestorage_createandstorage_updateduplicate the write path and do not call those embedded helpers.Regression notes
This is current refactor hostable-runtime drift. The matching
storage_listdrift is already tracked separately in #1885 and PR #1890; this issue covers write-path side effects and guards.Additional context
Suggested fix: route remote storage writes through shared command helpers or extract the embedded side-effect/guard logic into functions used by both embedded and remote dispatch. Add focused Rust coverage for:
defaultForAgentsfor the same scopestorage_updateTemplate check
@Xelvanis commented on GitHub (Jun 2, 2026):
Storage/data-access parity follow-up from current
origin/refactor:This appears fixed by #1906 on the current refactor branch.
src-tauri/src/http_dispatch.rsnow routes remotestorage_get,storage_create, andstorage_updatethrough the same storage entity helpers used by embedded Tauri commands, instead of keeping the older duplicated write path.Current local proof:
cargo test --manifest-path src-tauri/Cargo.toml dispatch_storage_defaultForAgentscleanup on create/update, and default chat preset mutation protection.I did not close this from the parity scan. It looks ready for maintainer closure or fixed-in-refactor marking unless there is separate runtime evidence still failing after #1906.