[PR #636] [MERGED] fix(file-storage): use err-first logger form in flush failure path #4706

Closed
opened 2026-10-22 04:09:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/636
Author: @Romuromylus
Created: 5/10/2026
Status: ✅ Merged
Merged: 5/10/2026
Merged by: @SpicyMarinara

Base: main ← Head: fix/file-storage-flush-logger-err-first


📝 Commits (1)

  • 6254d35 fix(file-storage): use err-first logger form in flush failure path

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 packages/server/src/db/file-backed-store.ts (+1 -1)

📄 Description

Linked issue

Closes #635

Why this change

  • CLAUDE.md § Logging requires Pino's err-first form for error logs (logger.error(err, "...")), but FileTableStore.flush's catch block in packages/server/src/db/file-backed-store.ts was still using the metadata-first form (logger.error({ err }, "...")).
  • PR #634 (commit d67d4f4) corrected the three sibling instances in this same file and intentionally left this pre-existing one out of scope to keep that PR focused. Issue #635 tracks the cleanup.

What changed

  • packages/server/src/db/file-backed-store.ts: switched the single remaining logger.error({ err }, ...) call in FileTableStore.flush's catch block to err-first form. No behavior change — only the log shape, so flush-failure errors deserialize as the top-level err field, matching the rest of the file.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually verify the EasyPanel container builds with the change (Dockerfile build invokes pnpm install --frozen-lockfile and the package build steps).
  • Manually verify the app loads and exercises the file-backed store: navigate to /, observe /api/chats, /api/characters, /api/sprites, /api/avatars, /api/regex-scripts, /api/.../game-state all return 200, no console errors. (The catch block only fires on flush failure, so the only runtime risk is a build/import regression — which pnpm check and a successful container start cover.)
  • Manually verify (optional, hard to trigger naturally) that a forced flush failure logs with err as a top-level field instead of nested under { err }.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

N/A — server-side log shape change with no UI surface.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/636 **Author:** [@Romuromylus](https://github.com/Romuromylus) **Created:** 5/10/2026 **Status:** ✅ Merged **Merged:** 5/10/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `fix/file-storage-flush-logger-err-first` --- ### 📝 Commits (1) - [`6254d35`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6254d354a54fa2311946e59bed5930e00c66accd) fix(file-storage): use err-first logger form in flush failure path ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/db/file-backed-store.ts` (+1 -1) </details> ### 📄 Description ## Linked issue Closes #635 ## Why this change - `CLAUDE.md § Logging` requires Pino's err-first form for error logs (`logger.error(err, "...")`), but `FileTableStore.flush`'s catch block in `packages/server/src/db/file-backed-store.ts` was still using the metadata-first form (`logger.error({ err }, "...")`). - PR #634 (commit d67d4f4) corrected the three sibling instances in this same file and intentionally left this pre-existing one out of scope to keep that PR focused. Issue #635 tracks the cleanup. ## What changed - `packages/server/src/db/file-backed-store.ts`: switched the single remaining `logger.error({ err }, ...)` call in `FileTableStore.flush`'s catch block to err-first form. No behavior change — only the log shape, so flush-failure errors deserialize as the top-level `err` field, matching the rest of the file. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Manually verify the EasyPanel container builds with the change (Dockerfile build invokes `pnpm install --frozen-lockfile` and the package build steps). - Manually verify the app loads and exercises the file-backed store: navigate to `/`, observe `/api/chats`, `/api/characters`, `/api/sprites`, `/api/avatars`, `/api/regex-scripts`, `/api/.../game-state` all return 200, no console errors. (The catch block only fires on flush failure, so the only runtime risk is a build/import regression — which `pnpm check` and a successful container start cover.) - Manually verify (optional, hard to trigger naturally) that a forced flush failure logs with `err` as a top-level field instead of nested under `{ err }`. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) N/A — server-side log shape change with no UI surface. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:09:59 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4706
No description provided.