mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1885] [Issue]: storage_list calls slow down repeatedly #911
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#911
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 @Promansis on GitHub (Jun 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1885
Originally assigned to: @Promansis on GitHub.
Summary
storage_listcalls observed in Crab Nebula devtools appear to get progressively slower with repeated calls. Investigation found the remote/api/invokepath had drifted from the embedded Tauri storage command and was not using the optimized message-list projection paths.Expected behavior
Repeated
storage_listcalls for the same data shape should stay roughly stable, with cost scaling to the requested result shape rather than repeatedly materializing full message payloads when projected fields are requested.Actual behavior
In the Crab Nebula devtools/runtime path, each
storage_listcall appeared slower than the previous one. The remote dispatcher duplicated olderstorage_listlogic and could deserialize/materialize full message rows for chat message projections that the embedded command handles with narrower storage reads.Steps to reproduce
storage_listcalls, especially message-list calls withfilters.chatIdand projected fields.Impact area
Environment
investigate-storage-list-growthLogs, screenshots, or video
No screenshot attached yet. Local investigation found
src-tauri/src/http_dispatch.rshandledstorage_listseparately fromsrc-tauri/src/commands/storage/commands/entities.rs, missing the optimized message ID/projection paths used by embedded Tauri.Regression notes
Unclear exact regression point. The remote dispatcher likely drifted after embedded
storage_listgained faster message list projection handling.Additional context
Candidate fix: make remote
storage_listdelegate to the shared storage command implementation so embedded Tauri and/api/invokeuse the same optimized code path. Local targeted proof:cargo test --manifest-path src-tauri/Cargo.toml dispatch_storage_list_uses_projected_message_reads; lane check:cargo check --manifest-path src-tauri/Cargo.toml.Template check
@Xelvanis commented on GitHub (Jun 2, 2026):
Additional storage comparison note, not a separate issue yet: #1890 appears to cover the remote
storage_listdispatcher drift called out here. If repeated slowdown remains after that PR, the next root-cause check should compare the broader storage backend shape.Legacy file-native storage loaded supported table snapshots into memory once, updated in-memory rows, then debounced/safety-flushed dirty tables. Refactor
FileStorageusually reads/parses a collection file per operation and rewrites pretty JSON for most mutations. That broader per-operation file I/O pattern may still matter for hot selectors/timelines even after individual projected-read fast paths are fixed.Useful follow-up proof would be a cold/warm timing harness around repeated
storage_list/storage_getcalls before deciding whether to add an in-memory cache, compact/index sidecar, or narrower collection-specific readers.