mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
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#6509
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/4828
Author: @kolacheee
Created: 8/9/2026
Status: ✅ Merged
Merged: 8/9/2026
Merged by: @kolacheee
Base:
staging← Head:fix/4813-mari-durable-review📝 Commits (1)
4f48564feat(mari-db): make Professor Mari's Keep/Restore undo durable (#4813)📊 Changes
3 files changed (+466 additions, -16 deletions)
View changed files
📝
package.json(+2 -1)📝
packages/server/src/services/mari-db/mari-db.service.ts(+155 -15)➕
scripts/regressions/mari-db-review-durability.regression.ts(+309 -0)📄 Description
Linked issue
Refs #4813 (the approval-architecture half — "Thread B", part 2 of 2).
Why this change
Part 1 (#4825) routes Professor Mari's creates through the same Keep/Restore review as edits and deletes, so an unwanted create is undoable in chat. But the undo itself was never durable: the pending review lived only in an in-memory Map with a 10-minute self-evicting timer. So an applied change quietly became permanent after ten minutes, or the moment the process restarted — exactly the "I couldn't undo it" failure mode behind #4813. A backup was still the only recovery.
What changed
Server-only (
packages/server/src/services/mari-db/mari-db.service.ts):journal/pending/<id>.jsonwhen it is created, and rehydrate the set lazily on first access, so a fresh process recovers every outstanding Keep/Restore card. Keep and Restore delete the sidecar when they resolve.PENDING_REVIEW_LIMIT(mirrorsHISTORY_LIMIT= 50) so it can't grow without bound. The oldest review past the cap loses its undo — its change stays applied — and that is logged rather than silent. Eviction uses the Map's insertion order, so the review that was just created is never the one dropped.Behavioral note (intended, worth a glance)
Because reviews are now durable, a pending Keep/Restore card — and the "Professor Mari needs your approval" notification the client fires for an unseen approval — reappears after a restart for any change still within the retention window. That is the feature working: the undo survives the restart. Two consequences worth a conscious call:
clearHistory()clears the history log only; it deliberately does not discard live pending undos, since those are unresolved state a user did not ask to drop.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm check(TypeScript + ESLint + localization + build) passes.pnpm regression:mari-review-durabilitypasses: it drives the realMariDbServiceagainst a file-native store and asserts a create's review persists to a sidecar, a fresh service instance (a simulated restart) rehydrates it, Restore and Keep still work after the restart and remove the sidecar, an expired sidecar is pruned on load, and the persisted set is capped. Also wired into theregression:issueslane.pnpm regression:issuesopen-issues lane (part 1's create-review assertions) still passes with these changes.capability-package-lifecycle.regression.tsfails onstagingfor an unrelated, pre-existing reason (tracked in #4824); not touched by this PR.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Server-internal behavior change; no
docs/changes and no version bump. The on-disk sidecars live under the existingjournal/directory.Summary by CodeRabbit
New Features
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.