[PR #4347] [MERGED] fix: reconcile Noodle accounts during profile import #6342

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4347
Author: @Gunterlie
Created: 7/31/2026
Status: ✅ Merged
Merged: 7/31/2026
Merged by: @Gunterlie

Base: staging ← Head: noodle-account-reconciliation


📝 Commits (3)

  • bc1877f fix: reconcile Noodle accounts during profile import
  • bf8c3f0 fix: reconcile Noodle accounts during profile import
  • 4a6cb23 Merge branch 'staging' into noodle-account-reconciliation

📊 Changes

5 files changed (+512 additions, -5 deletions)

View changed files

📝 package.json (+1 -1)
📝 packages/server/src/routes/backup.routes.ts (+10 -4)
➕ packages/server/src/services/import/profile-import-errors.ts (+1 -0)
➕ packages/server/src/services/import/profile-import-noodle.ts (+305 -0)
➕ scripts/regressions/profile-import-noodle.regression.ts (+195 -0)

📄 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

Closes #4344

Why this change

Native profile imports treated an exported Noodle account ID as the only identity. A fresh destination could already contain the same logical account under a generated ID, causing the imported row to collide on its unique handle and abort the whole import.

What changed

  • Reconcile imported Noodle accounts by (platform, kind, entityId) before applying the snapshot.
  • Remap direct and nested Noodle account references, including posts, subscriptions, unlocks, interactions, activity digests, refresh runs, and account settings.
  • Reuse existing dependent IDs where remapping would otherwise violate Noodle uniqueness constraints.
  • Detect genuine public-handle conflicts during preview and assign deterministic suffixed handles with a user-facing warning.
  • Add a regression covering logical reconciliation, dependent references, and preview handle conflicts.

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

  • Focused regression passed: pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/profile-import-noodle.regression.ts
  • Production build passed: pnpm build
  • Server typecheck and client lint passed independently.
  • pnpm check reached the client lint stage but exceeded the 120-second command timeout; the client lint was rerun independently and passed.
  • Manual browser import of a real exported profile remains to be completed by a human reviewer.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Not applicable; this changes the server-side profile import planner and regression coverage.

Summary by CodeRabbit

  • New Features

    • Profile imports now provide a planned preview with warnings before changes are applied.
    • Imported profiles are automatically matched and reconciled with existing accounts.
    • Conflicting account handles are resolved safely with clear warnings.
    • Related profile data and references are remapped to preserve connections during import.
  • Bug Fixes

    • Improved handling of duplicate identities, invalid mappings, and identifier conflicts during profile restoration.
    • Preserved unrelated data during imports.
    • Added regression coverage for profile-import reconciliation and warning behavior.

🔄 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/4347 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 7/31/2026 **Status:** ✅ Merged **Merged:** 7/31/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `noodle-account-reconciliation` --- ### 📝 Commits (3) - [`bc1877f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bc1877f62684426a2ccc759b39862393d5131fb9) fix: reconcile Noodle accounts during profile import - [`bf8c3f0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bf8c3f048f3018ff8dc49ddbe9cc7c4d77f7c732) fix: reconcile Noodle accounts during profile import - [`4a6cb23`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4a6cb236b4eb98b1ecaf75f2b352f3447b8302be) Merge branch 'staging' into noodle-account-reconciliation ### 📊 Changes **5 files changed** (+512 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `package.json` (+1 -1) 📝 `packages/server/src/routes/backup.routes.ts` (+10 -4) ➕ `packages/server/src/services/import/profile-import-errors.ts` (+1 -0) ➕ `packages/server/src/services/import/profile-import-noodle.ts` (+305 -0) ➕ `scripts/regressions/profile-import-noodle.regression.ts` (+195 -0) </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 Closes #4344 ## Why this change Native profile imports treated an exported Noodle account ID as the only identity. A fresh destination could already contain the same logical account under a generated ID, causing the imported row to collide on its unique handle and abort the whole import. ## What changed - Reconcile imported Noodle accounts by `(platform, kind, entityId)` before applying the snapshot. - Remap direct and nested Noodle account references, including posts, subscriptions, unlocks, interactions, activity digests, refresh runs, and account settings. - Reuse existing dependent IDs where remapping would otherwise violate Noodle uniqueness constraints. - Detect genuine public-handle conflicts during preview and assign deterministic suffixed handles with a user-facing warning. - Add a regression covering logical reconciliation, dependent references, and preview handle conflicts. ## 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 - Focused regression passed: `pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/profile-import-noodle.regression.ts` - Production build passed: `pnpm build` - Server typecheck and client lint passed independently. - `pnpm check` reached the client lint stage but exceeded the 120-second command timeout; the client lint was rerun independently and passed. - Manual browser import of a real exported profile remains to be completed by a human reviewer. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Not applicable; this changes the server-side profile import planner and regression coverage. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Profile imports now provide a planned preview with warnings before changes are applied. - Imported profiles are automatically matched and reconciled with existing accounts. - Conflicting account handles are resolved safely with clear warnings. - Related profile data and references are remapped to preserve connections during import. - **Bug Fixes** - Improved handling of duplicate identities, invalid mappings, and identifier conflicts during profile restoration. - Preserved unrelated data during imports. - Added regression coverage for profile-import reconciliation and warning behavior. <!-- 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:31 +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#6342
No description provided.