Online import: offer to overwrite an existing project like local import - #7668
Open
deferredreward wants to merge 4 commits into
Open
deferredreward wants to merge 4 commits into
deferredreward wants to merge 4 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inLocalImportWorkflowActions.localImport():ProjectDetailsHelpers.doesProjectAlreadyExist()is checked. If the project exists, the existingProjectDetailsActions.handleOverwriteWarning()dialog is dispatched instead ofmove()— on confirm it runs the provenProjectOverwriteHelpers.mergeOldProjectToNewProject()merge (preserves local checking data, merges alignments and manifest checkers/translators, records external verse edits, and invalidates stale selections).No new merge logic, dialogs, or localization keys — this reuses the existing, tested overwrite machinery, keeping the two import flows symmetric.
Testing
OnlineImportWorkflowActions.test.jscovering: 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.tcorePSAproject, and confirm the overwrite merge in the running app). Recommend exercising that during review.🤖 Generated with Claude Code