mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #731] [MERGED] test(file-storage): cover post-heal .bak refresh + tidy adjacent comments #4751
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#4751
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/731
Author: @Romuromylus
Created: 5/12/2026
Status: ✅ Merged
Merged: 5/12/2026
Merged by: @Romuromylus
Base:
main← Head:improve/file-native-self-heal-followup📝 Commits (1)
56b82d8test(file-storage): cover post-heal .bak refresh + tidy adjacent comments📊 Changes
2 files changed (+57 additions, -5 deletions)
View changed files
📝
packages/server/src/db/file-backed-store.ts(+10 -5)📝
packages/server/test/file-backed-store.test.ts(+47 -0)📄 Description
Linked issue
Follows up on #728 / #730 — small regression test plus comment polish on top of @NeoKazuya's fix. No separate issue.
Why this change
.baksurvives the heal write. The other half of the contract — that a subsequent ordinary save refreshes.bakfrom the now-healed primary (i.e.backupRecoveredPaths.clear()actually runs) — isn't pinned by a test. A future refactor that forgot to clear the set would leave all four existing tests green while real users had permanently frozen backups.atomicWriteFile's skip-refreshifhas two skip conditions sandwiching the durability rationale. Reads cleaner with the two skip-reasons broken out as numbered siblings.loadFileSnapshotsstill describes only the primary-rewrite half. Mentioning.bakpreservation makes the mental model match what the new tracking actually does.What changed
file-native subsequent save after self-heal refreshes .bak from the healed primarytest — wrecks.bakwith[]after the first heal, performs an ordinary insert + close, asserts.bakwas refreshed to the pre-save healed primary's state. Pins theclear()half of #730's contract.atomicWriteFileskip-refresh comment so the two skip conditions (caller-driven, NUL-corrupted) read as numbered siblings rather than bracketing the refresh rationale.loadFileSnapshotsrecovery comment to mention the.bakpreservation effect of the new tracking.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm --dir packages/server exec tsx --import ./test/setup-env.ts --test test/file-backed-store.test.tspasses — the new test should appear alongside the existing four corruption-recovery cases (total 10/10 pass expected).personas.jsonandpersonas.json.bakboth remain valid JSON after each save cycle.Docs and release impact
UI evidence (if applicable)
N/A — server-side test + comment changes only.
Summary by CodeRabbit
Documentation
Tests
Note: This release contains internal improvements to code reliability and maintainability with no user-facing changes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.