[PR #1304] [MERGED] Fix remote message delete tracker cleanup #5025

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/refactor-issue-1247-storage-delete-cleanup


📝 Commits (2)

  • b161a53 Fix remote message delete tracker cleanup
  • 0dd4b7e Merge remote-tracking branch 'upstream/refactor' into fix/refactor-issue-1247-storage-delete-cleanup

📊 Changes

2 files changed (+147 additions, -60 deletions)

View changed files

📝 src-tauri/src/commands/storage/commands/entities.rs (+17 -15)
📝 src-tauri/src/http_dispatch.rs (+130 -45)

📄 Description

Linked issue

Closes #1247

Why this change

  • Remote /api/invoke storage_delete had drifted from embedded Tauri storage_delete for message records, so deleting a message through the remote runtime could leave tracker snapshots and stale chats.gameState behind.

What changed

  • Exposed the embedded storage-delete owner as a shared delete_entity helper.
  • Routed HTTP storage_delete through that helper instead of maintaining a second generic delete implementation.
  • Added dispatcher regression coverage for remote message deletion cleanup and a non-message negative control.

Refactor impact

Primary owner:

  • Rust storage / remote runtime

Impact areas reviewed:

  • Remote runtime /api/invoke
  • Embedded Tauri storage commands
  • Tracker snapshot cleanup
  • Chat gameState synchronization

Boundary notes:

  • The HTTP dispatcher now calls the storage command owner for delete semantics, so embedded and remote delete paths cannot drift on protected records, chat cascades, media cleanup, message tracker cleanup, or forced connection deletion.

Pressure points touched:

  • src-tauri/src/commands/storage/commands/entities.rs
  • src-tauri/src/http_dispatch.rs

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 proof: cargo test dispatch_storage_delete failed before the fix because snapshot-message-2 survived remote message deletion, then passed after the fix with the message cleanup test and non-message negative control.
  • Codex proof: pnpm check passed after rebasing onto current upstream/refactor; it ran architecture, frontend typecheck, Rust workspace check, and docs checks.
  • Codex proof: node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json passed with a storage/cross-entrypoint risk matrix.
  • Manual verification not required for the core claim; this is backend/runtime storage semantics covered by the dispatcher harness.

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: no visible UI changed. The proof is the Rust dispatcher harness for remote runtime storage deletion.


🔄 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/1304 **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-1247-storage-delete-cleanup` --- ### 📝 Commits (2) - [`b161a53`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b161a53763022afe6b5527a93faf6f7bd41d936b) Fix remote message delete tracker cleanup - [`0dd4b7e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0dd4b7e374a88017da161f2227c99fbc3b37168f) Merge remote-tracking branch 'upstream/refactor' into fix/refactor-issue-1247-storage-delete-cleanup ### 📊 Changes **2 files changed** (+147 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/commands/entities.rs` (+17 -15) 📝 `src-tauri/src/http_dispatch.rs` (+130 -45) </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 Closes #1247 ## Why this change - Remote `/api/invoke` `storage_delete` had drifted from embedded Tauri `storage_delete` for message records, so deleting a message through the remote runtime could leave tracker snapshots and stale `chats.gameState` behind. ## What changed - Exposed the embedded storage-delete owner as a shared `delete_entity` helper. - Routed HTTP `storage_delete` through that helper instead of maintaining a second generic delete implementation. - Added dispatcher regression coverage for remote message deletion cleanup and a non-message negative control. ## Refactor impact Primary owner: - Rust storage / remote runtime Impact areas reviewed: - Remote runtime `/api/invoke` - Embedded Tauri storage commands - Tracker snapshot cleanup - Chat `gameState` synchronization Boundary notes: - The HTTP dispatcher now calls the storage command owner for delete semantics, so embedded and remote delete paths cannot drift on protected records, chat cascades, media cleanup, message tracker cleanup, or forced connection deletion. Pressure points touched: - `src-tauri/src/commands/storage/commands/entities.rs` - `src-tauri/src/http_dispatch.rs` ## 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 proof: `cargo test dispatch_storage_delete` failed before the fix because `snapshot-message-2` survived remote message deletion, then passed after the fix with the message cleanup test and non-message negative control. - Codex proof: `pnpm check` passed after rebasing onto current `upstream/refactor`; it ran architecture, frontend typecheck, Rust workspace check, and docs checks. - Codex proof: `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` passed with a storage/cross-entrypoint risk matrix. - Manual verification not required for the core claim; this is backend/runtime storage semantics covered by the dispatcher harness. ## 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: no visible UI changed. The proof is the Rust dispatcher harness for remote runtime storage deletion. --- <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:34 +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#5025
No description provided.