[PR #1890] [MERGED] Preserve projected message list ordering #5338

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

📋 Pull Request Information

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

Base: refactor ← Head: investigate-storage-list-growth


📝 Commits (6)

  • 94b0511 Fix character selector cold load
  • 6d0a000 Speed up storage get record lookup
  • e175347 Speed up projected message list reads
  • 2097076 Fix remote storage list projection parity
  • 975025c Preserve projected message list ordering
  • 6f244a1 Fix storage lookup and greeting fallbacks

📊 Changes

5 files changed (+636 additions, -227 deletions)

View changed files

📝 src-tauri/crates/storage/src/lib.rs (+399 -0)
📝 src-tauri/src/commands/storage/commands/entities.rs (+129 -1)
📝 src-tauri/src/http_dispatch.rs (+62 -195)
📝 src/features/catalog/characters/components/CharacterAvatarImage.tsx (+18 -2)
📝 src/features/modes/shared/chat-ui/components/ChatSetupWizard.tsx (+28 -29)

📄 Description

Linked issue

Closes #1885 #1886 #1887 #1888

Why this change

  • Storage list projection optimizations should not change message ordering, cursor filtering, or hostable/embedded storage parity.
  • Projected message reads were loading only caller-visible fields plus swipe data, which could omit internal fields needed by the shared list command before final projection.

What changed

  • Keeps internal message list fields available during projected message materialization: id, sortOrder, order, createdAt, and explicit orderBy fields.
  • Preserves final caller-facing projection after sorting, cursor filtering, swipe materialization, and legacy prompt snapshot synthesis.
  • Adds Rust regression coverage for projected message ordering, cursor filtering, and internal projection fields.

Refactor impact

Primary owner:

Rust storage

Impact areas reviewed:

  • Embedded storage_list command path.
  • Hostable HTTP storage_list parity via the shared storage command implementation.
  • Message timeline projection and pagination behavior.

Boundary notes:

  • No TypeScript engine, React feature, shared API, or command-registration changes.
  • The fix stays inside the Rust storage command owner and continues using the existing storage capability APIs.

Pressure points touched:

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

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 storage_list_projected_messages -- --nocapture: passed, 2 tests.
  • cargo test --manifest-path src-tauri/Cargo.toml message_projection_materialization_includes_internal_sort_fields -- --nocapture: passed, 1 test.
  • cargo test --manifest-path src-tauri/Cargo.toml dispatch_storage_list_uses_projected_message_reads -- --nocapture: passed, 1 test.
  • cargo test --manifest-path src-tauri/crates/storage/Cargo.toml projected -- --nocapture: passed, 1 test.
  • cargo check --manifest-path src-tauri/Cargo.toml: passed.
  • git diff --check: clean.

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:

  • Bugfix for internal storage list behavior; 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

N/A. Storage command behavior only; 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/1890 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `investigate-storage-list-growth` --- ### 📝 Commits (6) - [`94b0511`](https://github.com/Pasta-Devs/Marinara-Engine/commit/94b0511a28eecc9fff9c402fd92bf937dabc0444) Fix character selector cold load - [`6d0a000`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6d0a00002e5bb689680439aef26b94dfa1a0d22c) Speed up storage get record lookup - [`e175347`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e175347775a8dab0463d36897f9cbacc11185178) Speed up projected message list reads - [`2097076`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2097076d961749a142802534e6a96e7b835eacef) Fix remote storage list projection parity - [`975025c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/975025c234f738a8ae68d9f124cb289c457a2c02) Preserve projected message list ordering - [`6f244a1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6f244a11e8d01ff5391e4d4f732b390a01d90717) Fix storage lookup and greeting fallbacks ### 📊 Changes **5 files changed** (+636 additions, -227 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/crates/storage/src/lib.rs` (+399 -0) 📝 `src-tauri/src/commands/storage/commands/entities.rs` (+129 -1) 📝 `src-tauri/src/http_dispatch.rs` (+62 -195) 📝 `src/features/catalog/characters/components/CharacterAvatarImage.tsx` (+18 -2) 📝 `src/features/modes/shared/chat-ui/components/ChatSetupWizard.tsx` (+28 -29) </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 #1885 #1886 #1887 #1888 ## Why this change - Storage list projection optimizations should not change message ordering, cursor filtering, or hostable/embedded storage parity. - Projected message reads were loading only caller-visible fields plus swipe data, which could omit internal fields needed by the shared list command before final projection. ## What changed - Keeps internal message list fields available during projected message materialization: `id`, `sortOrder`, `order`, `createdAt`, and explicit `orderBy` fields. - Preserves final caller-facing projection after sorting, cursor filtering, swipe materialization, and legacy prompt snapshot synthesis. - Adds Rust regression coverage for projected message ordering, cursor filtering, and internal projection fields. ## Refactor impact Primary owner: Rust storage Impact areas reviewed: - Embedded `storage_list` command path. - Hostable HTTP `storage_list` parity via the shared storage command implementation. - Message timeline projection and pagination behavior. Boundary notes: - No TypeScript engine, React feature, shared API, or command-registration changes. - The fix stays inside the Rust storage command owner and continues using the existing storage capability APIs. Pressure points touched: - `src-tauri/src/commands/storage/commands/entities.rs` ## 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 test --manifest-path src-tauri/Cargo.toml storage_list_projected_messages -- --nocapture`: passed, 2 tests. - `cargo test --manifest-path src-tauri/Cargo.toml message_projection_materialization_includes_internal_sort_fields -- --nocapture`: passed, 1 test. - `cargo test --manifest-path src-tauri/Cargo.toml dispatch_storage_list_uses_projected_message_reads -- --nocapture`: passed, 1 test. - `cargo test --manifest-path src-tauri/crates/storage/Cargo.toml projected -- --nocapture`: passed, 1 test. - `cargo check --manifest-path src-tauri/Cargo.toml`: passed. - `git diff --check`: clean. ## 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: - Bugfix for internal storage list behavior; 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` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence N/A. Storage command behavior only; 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:22 +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#5338
No description provided.