Skip to content

Online import: offer to overwrite an existing project like local import - #7668

Open
deferredreward wants to merge 4 commits into
developfrom
feature-deferredreward-online-import-overwrite
Open

deferredreward wants to merge 4 commits into
developfrom
feature-deferredreward-online-import-overwrite

Conversation

@deferredreward

Copy link
Copy Markdown

Fixes #7666

What

When importing a project from Door43 that already exists locally, the user is now offered the same overwrite/merge dialog that local import has always shown, instead of the import failing with "Reimporting existing projects is not currently supported."

How

onlineImport() now mirrors the branch local import has in LocalImportWorkflowActions.localImport():

  • After project-name resolution, ProjectDetailsHelpers.doesProjectAlreadyExist() is checked. If the project exists, the existing ProjectDetailsActions.handleOverwriteWarning() dialog is dispatched instead of move() — on confirm it runs the proven ProjectOverwriteHelpers.mergeOldProjectToNewProject() merge (preserves local checking data, merges alignments and manifest checkers/translators, records external verse edits, and invalidates stale selections).
  • If the user cancels the overwrite, the import is cleaned up the same way local import does: the project is closed, the validation stepper is canceled, and the cloned project is removed from the imports folder.

No new merge logic, dialogs, or localization keys — this reuses the existing, tested overwrite machinery, keeping the two import flows symmetric.

Testing

  • Added three tests to OnlineImportWorkflowActions.test.js covering: no local duplicate (moves without prompting), duplicate + confirm (merges instead of moving), duplicate + cancel (cleans up, does not open project). All 11 tests in the suite pass; eslint clean on changed files.
  • Not verified in this PR: a manual round-trip against live Door43 (import an existing project, e.g. a shared tcorePSA project, and confirm the overwrite merge in the running app). Recommend exercising that during review.

🤖 Generated with Claude Code

deferredreward and others added 4 commits July 9, 2026 10:20
When importing a project from Door43 that already exists locally,
offer the same overwrite/merge dialog that local import uses instead
of failing with "Reimporting existing projects is not currently
supported". On cancel, the import is cleaned up like local import.

Fixes #7666

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
handleOverwriteWarning resolved true immediately while the actual
merge/remove/move ran in a detached delay(500) callback, so callers
(local and online import) could openProject the old directory while it
was being swapped out. Move resolve(true) into the callback after the
swap finishes. Fixes a race flagged in review of #7666.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The previous fix moved resolve(true) into the delayed merge callback,
but if the merge/remove/move threw, the promise never settled and the
awaiting import flow would hang. Wrap the callback in try/catch and
resolve(false) on failure so the caller cleans up. Flagged in review
of #7666.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Online import should offer to overwrite an existing project like local import does

1 participant