[PR #4352] [CLOSED] fix: reconcile orphaned Noodle character accounts on open #6344

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4352
Author: @Gunterlie
Created: 7/31/2026
Status: ❌ Closed

Base: staging ← Head: noodle-ghost-cleanup


📝 Commits (1)

  • 98a8b49 fix: reconcile orphaned Noodle character accounts on open

📊 Changes

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

View changed files

📝 packages/server/src/services/noodle/noodle-public-support.ts (+6 -1)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

No existing issue found for this — should be opened before merge to gather opinions per CONTRIBUTING.md.

Closes #

Why this change

Deleting a character is supposed to delete its Noodle account too (characters.routes.ts delete handler), but that cleanup is best-effort: if it throws, the error is only logged and the account is left behind. Those orphaned "ghost" accounts keep showing up in the Noodle feed/profile list with no character behind them, and there was no reconciliation path to clear them — a user affected by one had no self-serve way to remove it.

What changed

  • noodle-public-support.ts's bootstrapVisibleNoodle (runs on every GET /noodle/, i.e. every time Noodle is opened) already loops character-backed accounts against live characters and used to just continue past any account whose character no longer exists.
  • Changed that branch to call the existing deleteAccountByEntity("character", entityId) teardown instead, so ghost accounts (and their posts/interactions/subscriptions/digests, via that function's existing cascade) are cleared the next time Noodle is opened.

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: delete a character with an existing Noodle presence, simulate/force the account-cleanup step to fail (or manually leave a stray noodle_accounts row pointing at a deleted character id), then reopen Noodle and confirm the ghost account and its posts disappear.
  • Manually verify: normal character delete + Noodle open still works with no ghost accounts present (no-op path).

Docs and release impact

  • No docs changes needed

UI evidence (if applicable)

N/A — behavior-only fix, no UI surface changed.

Summary by CodeRabbit

  • Bug Fixes
    • Removed obsolete Noodle accounts when their associated character records no longer exist.
    • Improved account reconciliation to prevent stale accounts from remaining active.

🔄 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/4352 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 7/31/2026 **Status:** ❌ Closed **Base:** `staging` ← **Head:** `noodle-ghost-cleanup` --- ### 📝 Commits (1) - [`98a8b49`](https://github.com/Pasta-Devs/Marinara-Engine/commit/98a8b49275201006886cba4d1102f0028531b3dc) fix: reconcile orphaned Noodle character accounts on open ### 📊 Changes **1 file changed** (+6 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/noodle/noodle-public-support.ts` (+6 -1) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue No existing issue found for this — should be opened before merge to gather opinions per CONTRIBUTING.md. Closes # ## Why this change Deleting a character is supposed to delete its Noodle account too (`characters.routes.ts` delete handler), but that cleanup is best-effort: if it throws, the error is only logged and the account is left behind. Those orphaned "ghost" accounts keep showing up in the Noodle feed/profile list with no character behind them, and there was no reconciliation path to clear them — a user affected by one had no self-serve way to remove it. ## What changed - `noodle-public-support.ts`'s `bootstrapVisibleNoodle` (runs on every `GET /noodle/`, i.e. every time Noodle is opened) already loops character-backed accounts against live characters and used to just `continue` past any account whose character no longer exists. - Changed that branch to call the existing `deleteAccountByEntity("character", entityId)` teardown instead, so ghost accounts (and their posts/interactions/subscriptions/digests, via that function's existing cascade) are cleared the next time Noodle is opened. ## 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 <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - Manually verify: delete a character with an existing Noodle presence, simulate/force the account-cleanup step to fail (or manually leave a stray `noodle_accounts` row pointing at a deleted character id), then reopen Noodle and confirm the ghost account and its posts disappear. - Manually verify: normal character delete + Noodle open still works with no ghost accounts present (no-op path). ## Docs and release impact - [x] No docs changes needed ## UI evidence (if applicable) N/A — behavior-only fix, no UI surface changed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Removed obsolete Noodle accounts when their associated character records no longer exist. * Improved account reconciliation to prevent stale accounts from remaining active. <!-- 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:09:32 +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#6344
No description provided.