[PR #2021] [MERGED] Fix message swipe sidecar storage regression #5393

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2021
Author: @Xelvanis
Created: 6/3/2026
Status: ✅ Merged
Merged: 6/3/2026
Merged by: @Xelvanis

Base: refactor ← Head: fix/message-swipe-sidecar-regression


📝 Commits (5)

  • 0f29b93 Add message swipe sidecar storage
  • ba0a944 Address message swipe sidecar review feedback
  • b83f2a7 Preserve legacy sidecar message id matching
  • 7af1515 Fix legacy sidecar full swipe reads
  • f56efb2 Fix sidecar search active extra materialization

📊 Changes

17 files changed (+2973 additions, -172 deletions)

View changed files

📝 src-tauri/crates/storage/src/lib.rs (+295 -15)
📝 src-tauri/src/commands/storage.rs (+2 -0)
📝 src-tauri/src/commands/storage/admin.rs (+1 -0)
📝 src-tauri/src/commands/storage/chats.rs (+170 -79)
📝 src-tauri/src/commands/storage/commands/entities.rs (+551 -58)
📝 src-tauri/src/commands/storage/contracts.rs (+9 -0)
📝 src-tauri/src/commands/storage/exports.rs (+8 -2)
📝 src-tauri/src/commands/storage/game_state_snapshots.rs (+3 -4)
📝 src-tauri/src/commands/storage/imports/bulk_imports.rs (+5 -2)
📝 src-tauri/src/commands/storage/imports/marinara_rollback.rs (+7 -0)
📝 src-tauri/src/commands/storage/imports/rollback.rs (+7 -0)
➕ src-tauri/src/commands/storage/message_swipes.rs (+1624 -0)
📝 src-tauri/src/commands/storage/profile.rs (+265 -0)
📝 src-tauri/src/commands/storage/profile/legacy.rs (+6 -1)
📝 src-tauri/src/commands/storage/shared.rs (+1 -0)
📝 src-tauri/src/http_dispatch.rs (+2 -0)
📝 src-tauri/src/state.rs (+17 -11)

📄 Description

Linked issue

Closes #1923

Why this change

  • Message swipe persistence had drifted between embedded message rows and the intended sidecar storage model.
  • The stale PR history mixed this work with changes that have already landed separately, so this replacement PR keeps the review focused on the regression: swipe-specific payloads belong in message-swipes sidecars while reads/search/imports still expose legacy-compatible active swipe data.

What changed

  • Added sidecar storage handling for message swipes, including startup migration from embedded message.swipes rows.
  • Routed message create/update/delete, bulk chat deletion, imports, profile import/export, and rollback cleanup through sidecar-aware helpers.
  • Preserved projected read/search behavior: sidecar text can be searched without returning unrequested swipes, and active swipe extra materializes when requested.
  • Added regression coverage for startup compaction, projected message reads, sidecar search, ST bulk imports, and parent/sidecar cleanup.

Refactor impact

Primary owner:

Rust storage

Impact areas reviewed:

  • Chat message swipe commands
  • Generic storage create/read/update/delete commands
  • Startup storage migration
  • Profile import/export
  • ST bulk import rollback and rendered-message behavior
  • HTTP dispatch storage reads

Boundary notes:

  • Stays in src-tauri Rust storage and command routing.
  • No React, engine, or shared API boundary changes.
  • Uses existing storage atomic update helpers instead of adding UI guards or broad fallbacks.

Pressure points touched:

  • src-tauri/src/state.rs startup migration ordering
  • src-tauri/src/http_dispatch.rs storage command dispatch coverage
  • src-tauri/src/commands/storage/imports/* import and rollback paths

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 nextest run --manifest-path src-tauri/Cargo.toml --workspace - 480 passed locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace - passed locally
  • cargo clippy --manifest-path src-tauri/Cargo.toml --workspace --all-targets -- -D warnings - passed locally
  • pnpm check:architecture - passed locally
  • git diff --check - passed locally

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:

  • Regression/compatibility fix for existing message swipe storage behavior; no new 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

Docs/release notes: no repo-defined release note source applies here, and no user-facing docs changed.

UI evidence

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

Summary by CodeRabbit

  • Bug Fixes
    • Fixed message alternative handling in exports, imports, and chat operations
    • Improved consistency of message variants across profile imports and chat branching

🔄 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/2021 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/3/2026 **Status:** ✅ Merged **Merged:** 6/3/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `fix/message-swipe-sidecar-regression` --- ### 📝 Commits (5) - [`0f29b93`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0f29b933ad2bdd1fb5ac2734a2488a7bb7fae370) Add message swipe sidecar storage - [`ba0a944`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ba0a944f995fc0ccc844ad3afaba65c37b31bf29) Address message swipe sidecar review feedback - [`b83f2a7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b83f2a71bcaa8d9dc890a89e81725502bbf63384) Preserve legacy sidecar message id matching - [`7af1515`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7af15155d27ceb2d03f9f3a00549f7cfdd85e91c) Fix legacy sidecar full swipe reads - [`f56efb2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f56efb20640baeafd8769370fbee6106e062fb8c) Fix sidecar search active extra materialization ### 📊 Changes **17 files changed** (+2973 additions, -172 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/crates/storage/src/lib.rs` (+295 -15) 📝 `src-tauri/src/commands/storage.rs` (+2 -0) 📝 `src-tauri/src/commands/storage/admin.rs` (+1 -0) 📝 `src-tauri/src/commands/storage/chats.rs` (+170 -79) 📝 `src-tauri/src/commands/storage/commands/entities.rs` (+551 -58) 📝 `src-tauri/src/commands/storage/contracts.rs` (+9 -0) 📝 `src-tauri/src/commands/storage/exports.rs` (+8 -2) 📝 `src-tauri/src/commands/storage/game_state_snapshots.rs` (+3 -4) 📝 `src-tauri/src/commands/storage/imports/bulk_imports.rs` (+5 -2) 📝 `src-tauri/src/commands/storage/imports/marinara_rollback.rs` (+7 -0) 📝 `src-tauri/src/commands/storage/imports/rollback.rs` (+7 -0) ➕ `src-tauri/src/commands/storage/message_swipes.rs` (+1624 -0) 📝 `src-tauri/src/commands/storage/profile.rs` (+265 -0) 📝 `src-tauri/src/commands/storage/profile/legacy.rs` (+6 -1) 📝 `src-tauri/src/commands/storage/shared.rs` (+1 -0) 📝 `src-tauri/src/http_dispatch.rs` (+2 -0) 📝 `src-tauri/src/state.rs` (+17 -11) </details> ### 📄 Description ## Linked issue Closes #1923 ## Why this change - Message swipe persistence had drifted between embedded message rows and the intended sidecar storage model. - The stale PR history mixed this work with changes that have already landed separately, so this replacement PR keeps the review focused on the regression: swipe-specific payloads belong in `message-swipes` sidecars while reads/search/imports still expose legacy-compatible active swipe data. ## What changed - Added sidecar storage handling for message swipes, including startup migration from embedded `message.swipes` rows. - Routed message create/update/delete, bulk chat deletion, imports, profile import/export, and rollback cleanup through sidecar-aware helpers. - Preserved projected read/search behavior: sidecar text can be searched without returning unrequested swipes, and active swipe `extra` materializes when requested. - Added regression coverage for startup compaction, projected message reads, sidecar search, ST bulk imports, and parent/sidecar cleanup. ## Refactor impact Primary owner: Rust storage Impact areas reviewed: - Chat message swipe commands - Generic storage create/read/update/delete commands - Startup storage migration - Profile import/export - ST bulk import rollback and rendered-message behavior - HTTP dispatch storage reads Boundary notes: - Stays in `src-tauri` Rust storage and command routing. - No React, engine, or shared API boundary changes. - Uses existing storage atomic update helpers instead of adding UI guards or broad fallbacks. Pressure points touched: - `src-tauri/src/state.rs` startup migration ordering - `src-tauri/src/http_dispatch.rs` storage command dispatch coverage - `src-tauri/src/commands/storage/imports/*` import and rollback paths ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [x] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `cargo nextest run --manifest-path src-tauri/Cargo.toml --workspace` - 480 passed locally - `cargo check --manifest-path src-tauri/Cargo.toml --workspace` - passed locally - `cargo clippy --manifest-path src-tauri/Cargo.toml --workspace --all-targets -- -D warnings` - passed locally - `pnpm check:architecture` - passed locally - `git diff --check` - passed locally ## 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. - [x] 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: - Regression/compatibility fix for existing message swipe storage behavior; no new discoverable feature or workflow. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims Docs/release notes: no repo-defined release note source applies here, and no user-facing docs changed. ## UI evidence N/A - Rust storage behavior only; no visible UI changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed message alternative handling in exports, imports, and chat operations * Improved consistency of message variants across profile imports and chat branching <!-- 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-22 04:15:54 +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#5393
No description provided.