[PR #3357] [MERGED] fix(lorebooks): restore lorebooksStorage in characters.routes (unbreak staging build) #5896

Closed
opened 2026-10-23 04:04:56 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3357
Author: @kolacheee
Created: 7/8/2026
Status: ✅ Merged
Merged: 7/8/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/3356-restore-lorebooksstorage


📝 Commits (1)

  • bfec94d fix(lorebooks): restore lorebooksStorage in characters.routes (#3356)

📊 Changes

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

View changed files

📝 packages/server/src/routes/characters.routes.ts (+2 -0)

📄 Description

Linked issue

Closes #3356

Why this change

The server package fails to build on staging: TS2304: Cannot find name 'lorebooksStorage' ×3 in characters.routes.ts (lines 1360/1393/1404), so pnpm build and pnpm check exit 2 for everyone on staging. Root cause — a semantic merge that git could not detect:

  • #3349 (revert linked-lorebook native export) removed the module-level const lorebooksStorage = createLorebooksStorage(app.db) and its import (they only fed the export bundling that PR reverts).
  • #3343 ("Embed into card") added the POST /:id/embedded-lorebook/embed handler, which uses lorebooksStorage, and merged after #3349 without a rebase.
  • The removed-declaration lines and the added-usage lines are in different parts of the file, so git auto-merged with no textual conflict — landing code that references an undeclared symbol.

What changed

  • packages/server/src/routes/characters.routes.ts — re-added the createLorebooksStorage import and const lorebooksStorage = createLorebooksStorage(app.db) next to the other storage consts. This is the storage handle the Embed-into-card endpoint legitimately needs; the revert only needed to drop the export-bundling helpers, not this handle.

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

  • pnpm build passes (exit 0) — the exact command from the bug report; the three TS2304 errors are gone. Server package build (node ./scripts/build.mjs) and client build both complete.
  • pnpm --filter @marinara-engine/server lint (tsc) passes.
  • Manually verify the Embed into card action still works end-to-end in the app (POST /:id/embedded-lorebook/embed) — it was the only endpoint referencing the previously-missing symbol.

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)

Build-only fix — no user-facing behavior change, no version bump. (No CHANGELOG entry, since it repairs unreleased staging work rather than changing shipped behavior.)

UI evidence (if applicable)

N/A — server build fix; no UI change.

Summary by CodeRabbit

  • New Features
    • Character embedded lorebooks now use persistent storage, enabling the embed action to fetch and update saved lorebook data reliably.

🔄 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/3357 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 7/8/2026 **Status:** ✅ Merged **Merged:** 7/8/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/3356-restore-lorebooksstorage` --- ### 📝 Commits (1) - [`bfec94d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bfec94d636efcc4160c77c5ccfde419c43c43c71) fix(lorebooks): restore lorebooksStorage in characters.routes (#3356) ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/characters.routes.ts` (+2 -0) </details> ### 📄 Description ## Linked issue Closes #3356 ## Why this change The server package fails to build on `staging`: `TS2304: Cannot find name 'lorebooksStorage'` ×3 in `characters.routes.ts` (lines 1360/1393/1404), so `pnpm build` and `pnpm check` exit 2 for everyone on staging. Root cause — a semantic merge that git could not detect: - #3349 (revert linked-lorebook native export) **removed** the module-level `const lorebooksStorage = createLorebooksStorage(app.db)` and its import (they only fed the export bundling that PR reverts). - #3343 ("Embed into card") **added** the `POST /:id/embedded-lorebook/embed` handler, which **uses** `lorebooksStorage`, and merged **after** #3349 without a rebase. - The removed-declaration lines and the added-usage lines are in different parts of the file, so git auto-merged with **no textual conflict** — landing code that references an undeclared symbol. ## What changed - `packages/server/src/routes/characters.routes.ts` — re-added the `createLorebooksStorage` import and `const lorebooksStorage = createLorebooksStorage(app.db)` next to the other storage consts. This is the storage handle the Embed-into-card endpoint legitimately needs; the revert only needed to drop the export-bundling *helpers*, not this handle. ## 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 - `pnpm build` passes (exit 0) — the exact command from the bug report; the three `TS2304` errors are gone. Server package build (`node ./scripts/build.mjs`) and client build both complete. - `pnpm --filter @marinara-engine/server lint` (`tsc`) passes. - Manually verify the **Embed into card** action still works end-to-end in the app (`POST /:id/embedded-lorebook/embed`) — it was the only endpoint referencing the previously-missing symbol. ## 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) Build-only fix — no user-facing behavior change, no version bump. (No CHANGELOG entry, since it repairs unreleased staging work rather than changing shipped behavior.) ## UI evidence (if applicable) N/A — server build fix; no UI change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Character embedded lorebooks now use persistent storage, enabling the embed action to fetch and update saved lorebook data reliably. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:04:56 +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#5896
No description provided.