[PR #2019] [MERGED] Fix projected storage cache reads #5391

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/2019
Author: @Promansis
Created: 6/3/2026
Status: ✅ Merged
Merged: 6/3/2026
Merged by: @Promansis

Base: refactor ← Head: fix/storage-projection-cache


📝 Commits (2)

  • e6bd899 Fix projected storage cache reads
  • 83ed9bc Fix pretty nested storage projection

📊 Changes

1 file changed (+189 additions, -12 deletions)

View changed files

📝 src-tauri/crates/storage/src/lib.rs (+189 -12)

📄 Description

Linked issue

Closes #2018

Why this change

  • Projected storage reads were fast until a clean full-row collection cache existed. After that, storage_get and storage_list projected from cached full rows instead of using the streaming projected readers that skip unrequested heavy fields.

What changed

  • Added a dirty-cache-only read helper for projected storage paths.
  • Kept dirty cached rows authoritative so unflushed writes remain visible.
  • Let clean-cache projected reads continue through disk streaming projection.
  • Fixed pretty JSON nested projection so dotted nested selections like extensions.avatarCrop work when clean-cache bypass exposes the streaming path.
  • Added focused Rust storage tests for clean-cache bypass and dirty-cache precedence.

Refactor impact

Primary owner:

Rust storage

Impact areas reviewed:

  • storage_get projected row reads
  • storage_list projected collection reads
  • projected filtered reads
  • projected message reads and message ID-only reads
  • dirty write cache behavior
  • pretty JSON nested projection

Boundary notes:

  • Change stays inside src-tauri/crates/storage; no React, engine, shared API, command registration, or remote-runtime boundary changes.

Pressure points touched:

  • Rust storage projection internals only.
  • 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 test --manifest-path src-tauri/Cargo.toml -p marinara-storage projected
  • cargo test --manifest-path src-tauri/Cargo.toml projected
  • cargo check --manifest-path src-tauri/Cargo.toml
  • pnpm check

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 Rust storage performance regression fix only; no new user-discoverable feature.

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

Not applicable; 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/2019 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/3/2026 **Status:** ✅ Merged **Merged:** 6/3/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/storage-projection-cache` --- ### 📝 Commits (2) - [`e6bd899`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e6bd89919edbe2bdd9afaeba95db798094ee3f97) Fix projected storage cache reads - [`83ed9bc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/83ed9bcda39fc8e591667e8e6e3109adc99b4bf5) Fix pretty nested storage projection ### 📊 Changes **1 file changed** (+189 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/crates/storage/src/lib.rs` (+189 -12) </details> ### 📄 Description ## Linked issue Closes #2018 ## Why this change - Projected storage reads were fast until a clean full-row collection cache existed. After that, `storage_get` and `storage_list` projected from cached full rows instead of using the streaming projected readers that skip unrequested heavy fields. ## What changed - Added a dirty-cache-only read helper for projected storage paths. - Kept dirty cached rows authoritative so unflushed writes remain visible. - Let clean-cache projected reads continue through disk streaming projection. - Fixed pretty JSON nested projection so dotted nested selections like `extensions.avatarCrop` work when clean-cache bypass exposes the streaming path. - Added focused Rust storage tests for clean-cache bypass and dirty-cache precedence. ## Refactor impact Primary owner: Rust storage Impact areas reviewed: - `storage_get` projected row reads - `storage_list` projected collection reads - projected filtered reads - projected message reads and message ID-only reads - dirty write cache behavior - pretty JSON nested projection Boundary notes: - Change stays inside `src-tauri/crates/storage`; no React, engine, shared API, command registration, or remote-runtime boundary changes. Pressure points touched: - Rust storage projection internals only. - 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 test --manifest-path src-tauri/Cargo.toml -p marinara-storage projected` - `cargo test --manifest-path src-tauri/Cargo.toml projected` - `cargo check --manifest-path src-tauri/Cargo.toml` - `pnpm check` ## 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: - Internal Rust storage performance regression fix only; no new user-discoverable feature. ## 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 Not applicable; 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: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#5391
No description provided.