mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2509] [CLOSED] Add chat swipe append fast path #5629
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#5629
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2509
Author: @Xelvanis
Created: 6/6/2026
Status: ❌ Closed
Base:
refactor← Head:perf/issue-2493-add-swipe-fast-path📝 Commits (2)
c2c4b92Add chat swipe append fast pathd4571a0Harden swipe append transaction checks📊 Changes
3 files changed (+993 additions, -7 deletions)
View changed files
📝
src-tauri/crates/storage/src/lib.rs(+643 -0)📝
src-tauri/src/commands/storage/chats.rs(+204 -7)📝
src-tauri/src/commands/storage/message_swipes.rs(+146 -0)📄 Description
Linked issue
Part of #2493
Why this change
What changed
chat_message_add_swipeto fast-path sidecar-backed messages by replacing the parentmessagesrow, appending only newmessage-swipesrows, and applying chat memory invalidation in the same transaction when active content changes.Refactor impact
Primary owner:
Rust storage and chat storage commands.
Impact areas reviewed:
FileStorageappend/update transaction staging, rollback, and cache refresh.chat_message_add_swipeactive/inactive semantics and legacysilentcompatibility.Boundary notes:
src-tauriRust storage/command modules.Noneon unsafe storage shape so the existing full replacement path remains the correctness fallback.Pressure points touched:
ModeSurface,GameSurface, shared mode UI,src-tauri/src/lib.rscommand registration, or import modules.Validation
pnpm typecheck,pnpm build,pnpm check:architecture,pnpm check:docs, or fullpnpm checkwhen warranted)pnpm checkpasses before PR push/handoffManual verification notes
Commands run locally:
cargo test --manifest-path src-tauri/Cargo.toml -p marinara-engine message_swipes_append_cleans_trimmed_legacy_sidecar_rows --libcargo test --manifest-path src-tauri/Cargo.toml -p marinara-engine message_swipes --libcargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage append_many --libcargo check --manifest-path src-tauri/Cargo.toml --workspacerustfmt --edition 2021 --check src-tauri/crates/storage/src/lib.rs src-tauri/src/commands/storage/chats.rs src-tauri/src/commands/storage/message_swipes.rsgit diff --checkpnpm check:architecturepnpm checkDurable test rationale:
Native Tauri large-chat timing:
chat_message_add_swipe: 358.9ms -> 266.4ms on the 5k-message fixture.patchChatMessageExtrawrite still costs 631.0ms, so Phase 3 remains the clearest next latency win.Remaining proof gap:
Feature Discoverability
Check exactly one:
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.Reason:
Docs and release impact
README.mdCONTRIBUTING.mddocs/developer/AGENTS.mdUI evidence
No UI screenshots or recordings. This PR changes Rust storage behavior only.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.