mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1919] [Issue]: projected storage_get still reads full row before projection #936
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#936
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Xelvanis on GitHub (Jun 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1919
Originally assigned to: @Xelvanis on GitHub.
Summary
storage_getacceptsfieldsandfieldSelections, and several current callers use projected gets, but the Rust command path reads the full matched row before applying projection. Large character rows can still pay the full row parse/read cost even when the caller only asks for a narrow field subset.Expected behavior
Projected
storage_getcalls should either push projection into the storage read path or make the contract clear that projection only trims the returned payload after a full row read. For hot resource reads, the preferred behavior is a narrowget_projectedstorage path that keeps embedded Tauri and remote/api/invokebehavior identical.Actual behavior
Static inspection on current
origin/refactorshowsstorage_get_innercallingstate.storage.get(&entity, &id)and then applyingshared::project_record(...)afterward. The storage crate has projected list readers, but the publicgetpath has no projection parameters and returns the full matching record before command-level projection.Steps to reproduce
data, avatar, prompt, or extension fields.storage_list:storage_getstill performs a full matched-row read before projection.Impact area
Environment
origin/refactorat3e05c12b/api/invokeshare the same storage helperLogs, screenshots, or video
No runtime screenshot attached. Static evidence:
src-tauri/src/commands/storage/commands/entities.rs:247-261:storage_get_innervalidates the entity, callsstate.storage.get(&entity, &id), then appliesshared::project_record(...).src-tauri/crates/storage/src/lib.rs:54-63:list_projectedaccepts projection fields and nested selections.src-tauri/crates/storage/src/lib.rs:111-115:gethas no projection parameters.src-tauri/crates/storage/src/lib.rs:550-592: the id lookup returns the full matching row.src/features/catalog/characters/hooks/use-characters.ts:129,src/features/shell/bot-browser/components/BotBrowserPanel.tsx:86,src/features/runtime/generation/hooks/use-generate.ts:516, andsrc/features/runtime/tracker/hooks/use-tracker-card-color-manager.ts:166.Regression notes
Adjacent closed issues are not duplicates:
storage_getlookup cost for non-matching rows by adding a pretty-file id fast path.storage_listreads.storage_listslowdown and already has a broader storage timing-harness note.This issue covers the remaining
storage_getprojection gap: once the target id is found, the matched row is still read as a full row before projection. This is static parity evidence, not a measured runtime timing repro yet.Additional context
Suggested follow-up:
storage_getwith large rows.get_projectedpath and routestorage_getoptions through it.Related tracker: #1904 target 2, storage and data access.
Template check
@Xelvanis commented on GitHub (Jun 2, 2026):
Claiming this now. Plan: add a storage-level projected get path, route storage_get projection options through it for embedded and remote invoke, then verify with focused Rust storage coverage and cargo check.