[GH-ISSUE #4344] [Issue]: Profile import fails on fresh install when Noodle handles already exist #2357

Closed
opened 2026-10-21 05:47:35 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Xelvanis on GitHub (Jul 31, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4344

Originally assigned to: @Gunterlie on GitHub.

Summary

Importing a native Marinara profile into a fresh install can fail when the destination has already initialized a Noodle account whose handle matches an account in the profile snapshot. The import exposes the internal error [file-storage] Unique value already exists for noodle_accounts.handle instead of reconciling the same logical account or reporting the collision during preview.

Expected behavior

A profile exported from another Marinara installation should import into a fresh installation even if normal startup or opening Noodle has already created local Noodle account rows.

The importer should reconcile accounts representing the same logical identity and preserve/remap their dependent references. A genuine same-handle/different-account conflict should be resolved deterministically or reported during preview with a user-facing explanation.

Actual behavior

The import fails with:

[file-storage] Unique value already exists for noodle_accounts.handle

The UI reports Profile import failed, and the profile is not restored.

Steps to reproduce

  1. Export a native profile containing Noodle account data from one Marinara installation.
  2. Start a fresh Marinara installation.
  3. Allow the destination to initialize Noodle accounts, for example by opening Noodle once.
  4. Open Settings and select Import Profile.
  5. Select and confirm the exported profile.
  6. Observe that import fails with the noodle_accounts.handle uniqueness error.

Environment

  • Marinara Engine version: Not provided by reporter; source path verified on origin/staging at a46683580875a198a5836ae6fadd0488072fb47d
  • Install type: Fresh install; exact type not provided
  • OS + version: Not provided
  • Browser or app shell: Not provided

Logs, screenshots, or video

Reporter-provided UI error:

Profile import failed
[file-storage] Unique value already exists for noodle_accounts.handle

A screenshot was provided in the support conversation, but no uploadable attachment URL is available for this issue.

Additional context

Source inspection on current staging shows the collision path:

  • noodle_accounts.handle is unique for public Noodle accounts.
  • Noodle bootstrap creates accounts with generated primary IDs through upsertAccountFromProfile().
  • Native profile import upserts snapshot rows using only each table's primary key.
  • The same logical Noodle account can therefore have one generated ID on the destination and a different exported ID in the snapshot. Import treats them as different rows, then the secondary handle constraint rejects the insert.
  • Import preview counts rows but does not detect this conflict.

The import is transactional, so the observed failure should roll back database changes and staged assets. The missing behavior is identity reconciliation before applying the snapshot.

This is distinct from:

  • #4056, which added/enforced unique visible handles during ordinary Noodle profile editing.
  • #1124, which covered an app_settings primary-key conflict.
  • #3683, which covered atomic rollback after profile-import failures.

A robust fix should reconcile imported Noodle accounts by stable logical identity such as platform, kind, and entity ID, then remap account-ID references in dependent Noodle tables. Genuine cross-identity handle conflicts should be handled separately rather than leaking the storage-layer exception.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (Jul 31, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4344 Originally assigned to: @Gunterlie on GitHub. ## Summary Importing a native Marinara profile into a fresh install can fail when the destination has already initialized a Noodle account whose handle matches an account in the profile snapshot. The import exposes the internal error `[file-storage] Unique value already exists for noodle_accounts.handle` instead of reconciling the same logical account or reporting the collision during preview. <!-- task-id: profile-import-noodle-handle-conflict --> ## Expected behavior A profile exported from another Marinara installation should import into a fresh installation even if normal startup or opening Noodle has already created local Noodle account rows. The importer should reconcile accounts representing the same logical identity and preserve/remap their dependent references. A genuine same-handle/different-account conflict should be resolved deterministically or reported during preview with a user-facing explanation. ## Actual behavior The import fails with: ```text [file-storage] Unique value already exists for noodle_accounts.handle ``` The UI reports `Profile import failed`, and the profile is not restored. ## Steps to reproduce 1. Export a native profile containing Noodle account data from one Marinara installation. 2. Start a fresh Marinara installation. 3. Allow the destination to initialize Noodle accounts, for example by opening Noodle once. 4. Open Settings and select Import Profile. 5. Select and confirm the exported profile. 6. Observe that import fails with the `noodle_accounts.handle` uniqueness error. ## Environment - Marinara Engine version: Not provided by reporter; source path verified on `origin/staging` at `a46683580875a198a5836ae6fadd0488072fb47d` - Install type: Fresh install; exact type not provided - OS + version: Not provided - Browser or app shell: Not provided ## Logs, screenshots, or video Reporter-provided UI error: ```text Profile import failed [file-storage] Unique value already exists for noodle_accounts.handle ``` A screenshot was provided in the support conversation, but no uploadable attachment URL is available for this issue. ## Additional context Source inspection on current `staging` shows the collision path: - `noodle_accounts.handle` is unique for public Noodle accounts. - Noodle bootstrap creates accounts with generated primary IDs through `upsertAccountFromProfile()`. - Native profile import upserts snapshot rows using only each table's primary key. - The same logical Noodle account can therefore have one generated ID on the destination and a different exported ID in the snapshot. Import treats them as different rows, then the secondary handle constraint rejects the insert. - Import preview counts rows but does not detect this conflict. The import is transactional, so the observed failure should roll back database changes and staged assets. The missing behavior is identity reconciliation before applying the snapshot. This is distinct from: - #4056, which added/enforced unique visible handles during ordinary Noodle profile editing. - #1124, which covered an `app_settings` primary-key conflict. - #3683, which covered atomic rollback after profile-import failures. A robust fix should reconcile imported Noodle accounts by stable logical identity such as platform, kind, and entity ID, then remap account-ID references in dependent Noodle tables. Genuine cross-identity handle conflicts should be handled separately rather than leaking the storage-layer exception. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:47:35 +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#2357
No description provided.