[PR #2508] [MERGED] Fix storage cache append merge #5627

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/storage-cache-append-friendship


📝 Commits (6)

  • f3a1b1d fix storage get id lookup cache
  • 8a11748 Merge projected storage list cache stamp
  • 3323802 Fix storage clippy single match
  • bc97677 Harden storage read cache stamps
  • d0a0897 Retry unstable storage id index builds
  • fdf0fa1 Fix storage cache append merge

📊 Changes

1 file changed (+886 additions, -40 deletions)

View changed files

📝 src-tauri/crates/storage/src/lib.rs (+886 -40)

📄 Description

Linked issue

Closes #2497
Closes #2498
Related to #2493

Why this change

  • Storage id lookups and projected-list reads need #2505's narrower cache/index behavior on top of the already-merged #2504 append fast path.
  • Without the merge fix, clean-cache appends could extend cached rows while leaving the new id lookup indexes stale or incomplete.

What changed

  • Rebases the storage cache stamp/id-index work onto current refactor, which already includes the chat append fast path.
  • Keeps #2504's append helpers and #2505's id-index/read-index invalidation model together.
  • Invalidates disk id indexes when append writes land and updates clean cached collection row_indices_by_id entries for appended rows.
  • Extends the clean cached append regression test so appended rows must be readable through get(id).

Refactor impact

Primary owner:

Rust storage

Impact areas reviewed:

  • src-tauri/crates/storage/src/lib.rs
  • Disk-backed collection reads by id
  • Projected collection list cache invalidation
  • Atomic collection update conflict checks
  • Clean cached append path for messages and message-swipes
  • Message swipe create path that uses append fast path

Boundary notes:

  • Change stays inside the Rust storage capability crate.
  • No React, TypeScript engine, shared API, Tauri command registration, or remote-runtime routing boundaries changed.

Pressure points touched:

  • Rust storage crate collection persistence/cache internals.
  • No ModeSurface, GameSurface, shared mode UI, src-tauri/src/lib.rs command registration, or import modules touched.

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 fmt --manifest-path src-tauri/crates/storage/Cargo.toml -- --check passed.
  • git diff --check passed.
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage passed: 56 tests.
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-engine message_swipes --lib passed: 37 tests.
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passed.
  • pnpm check passed.
  • Durable test rationale: clean-cache appends plus id-index lookups can silently miss freshly appended rows after #2504 and #2505 are combined; storage tests already cover the append owner; the added assertion is narrow and proves appended rows remain readable by id.

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:

  • Rust storage cache/append merge fix only; no new user-discoverable feature, setting, mode, panel, import path, agent, media capability, or advanced tool.

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-only change; no visible UI behavior changed.


🔄 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/2508 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/6/2026 **Status:** ✅ Merged **Merged:** 6/6/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/storage-cache-append-friendship` --- ### 📝 Commits (6) - [`f3a1b1d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f3a1b1da2c75b3e87de963c06da26bf04fc2b6cf) fix storage get id lookup cache - [`8a11748`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8a117486bd0f08703fb79f33e3ef8ebe5dea8c18) Merge projected storage list cache stamp - [`3323802`](https://github.com/Pasta-Devs/Marinara-Engine/commit/33238026e0b204bc517af4280ec369e2a90a1f2a) Fix storage clippy single match - [`bc97677`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bc9767772779e94c5527752c34865259548e781c) Harden storage read cache stamps - [`d0a0897`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d0a089772e088ab90b10b8bd06f1a01713718240) Retry unstable storage id index builds - [`fdf0fa1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fdf0fa18ba5e8979ccef38cf79480dd9c002cf1b) Fix storage cache append merge ### 📊 Changes **1 file changed** (+886 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/crates/storage/src/lib.rs` (+886 -40) </details> ### 📄 Description ## Linked issue Closes #2497 Closes #2498 Related to #2493 ## Why this change - Storage id lookups and projected-list reads need #2505's narrower cache/index behavior on top of the already-merged #2504 append fast path. - Without the merge fix, clean-cache appends could extend cached rows while leaving the new id lookup indexes stale or incomplete. ## What changed - Rebases the storage cache stamp/id-index work onto current `refactor`, which already includes the chat append fast path. - Keeps #2504's append helpers and #2505's id-index/read-index invalidation model together. - Invalidates disk id indexes when append writes land and updates clean cached collection `row_indices_by_id` entries for appended rows. - Extends the clean cached append regression test so appended rows must be readable through `get(id)`. ## Refactor impact Primary owner: Rust storage Impact areas reviewed: - `src-tauri/crates/storage/src/lib.rs` - Disk-backed collection reads by id - Projected collection list cache invalidation - Atomic collection update conflict checks - Clean cached append path for `messages` and `message-swipes` - Message swipe create path that uses append fast path Boundary notes: - Change stays inside the Rust storage capability crate. - No React, TypeScript engine, shared API, Tauri command registration, or remote-runtime routing boundaries changed. Pressure points touched: - Rust storage crate collection persistence/cache internals. - No `ModeSurface`, `GameSurface`, shared mode UI, `src-tauri/src/lib.rs` command registration, or import modules touched. ## 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 - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `cargo fmt --manifest-path src-tauri/crates/storage/Cargo.toml -- --check` passed. - `git diff --check` passed. - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage` passed: 56 tests. - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-engine message_swipes --lib` passed: 37 tests. - `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passed. - `pnpm check` passed. - Durable test rationale: clean-cache appends plus id-index lookups can silently miss freshly appended rows after #2504 and #2505 are combined; storage tests already cover the append owner; the added assertion is narrow and proves appended rows remain readable by id. ## 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: - Rust storage cache/append merge fix only; no new user-discoverable feature, setting, mode, panel, import path, agent, media capability, or advanced tool. ## 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 ## UI evidence N/A. Rust storage-only change; no visible UI behavior changed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:17:56 +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#5627
No description provided.