[GH-ISSUE #635] [Issue]: cleanup(file-storage): logger.error({ err }, ...) protocol drift in saveFileSnapshots #297

Closed
opened 2026-10-20 17:27:23 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @coderabbitai[bot] on GitHub (May 10, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/635

Originally assigned to: @Romuromylus on GitHub.

Summary

A logger.error call inside FileTableStore.flush in packages/server/src/db/file-backed-store.ts uses the metadata-first form logger.error({ err }, "...") instead of the err-first form required by CLAUDE.md § Logging ("Log errors with the error object first: logger.error(err, "Import failed")"). This is a pre-existing call site that PR #634 intentionally left out of scope while fixing three sibling instances in the same file.

Expected behavior

saveFileSnapshots flush failures should be logged in Pino's err-first form so the underlying error object is attached as err rather than nested under a wrapping object, keeping the log shape consistent with the rest of the file:

logger.error(err, "[file-storage] Failed to persist file-native storage");

Actual behavior

packages/server/src/db/file-backed-store.ts:941 currently passes the error inside a metadata object:

logger.error({ err }, "[file-storage] Failed to persist file-native storage");

This produces a different log shape from the three sibling logger.error calls fixed in commit d67d4f4 (PR #634) and violates the convention documented in CLAUDE.md § Logging.

Steps to reproduce

  1. Open packages/server/src/db/file-backed-store.ts at the synced fork HEAD.
  2. Search for logger.error({ err }.
  3. Observe the single remaining match inside FileTableStore.flush's catch block at line 941.

Environment

  • Marinara Engine version: main @ 3d64348 (upstream) / 787b390 (fork mirror)
  • Install type: source
  • OS + version: N/A (code-only cleanup)
  • Browser or app shell: N/A

Logs, screenshots, or video

N/A — static code-style fix; no runtime symptom.

Additional context

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @coderabbitai[bot] on GitHub (May 10, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/635 Originally assigned to: @Romuromylus on GitHub. ## Summary A `logger.error` call inside `FileTableStore.flush` in `packages/server/src/db/file-backed-store.ts` uses the metadata-first form `logger.error({ err }, "...")` instead of the err-first form required by `CLAUDE.md § Logging` ("Log errors with the error object first: `logger.error(err, "Import failed")`"). This is a pre-existing call site that PR #634 intentionally left out of scope while fixing three sibling instances in the same file. ## Expected behavior `saveFileSnapshots` flush failures should be logged in Pino's err-first form so the underlying error object is attached as `err` rather than nested under a wrapping object, keeping the log shape consistent with the rest of the file: ```ts logger.error(err, "[file-storage] Failed to persist file-native storage"); ``` ## Actual behavior `packages/server/src/db/file-backed-store.ts:941` currently passes the error inside a metadata object: ```ts logger.error({ err }, "[file-storage] Failed to persist file-native storage"); ``` This produces a different log shape from the three sibling `logger.error` calls fixed in commit d67d4f4 (PR #634) and violates the convention documented in `CLAUDE.md § Logging`. ## Steps to reproduce 1. Open `packages/server/src/db/file-backed-store.ts` at the synced fork HEAD. 2. Search for `logger.error({ err }`. 3. Observe the single remaining match inside `FileTableStore.flush`'s catch block at line 941. ## Environment - Marinara Engine version: main @ 3d64348 (upstream) / 787b390 (fork mirror) - Install type: source - OS + version: N/A (code-only cleanup) - Browser or app shell: N/A ## Logs, screenshots, or video N/A — static code-style fix; no runtime symptom. ## Additional context - Sibling fix: PR #634 commit d67d4f4 — switched three new `logger.error` call sites in the same file to err-first form, deferred this pre-existing one to keep the PR focused. - Review thread that flagged the deferral: https://github.com/Pasta-Devs/Marinara-Engine/pull/634#discussion_r3214594946 - Convention reference: `CLAUDE.md § Logging`. ## Template check - [ ] I DID NOT read this template and provide the requested details.
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#297
No description provided.