Skip to content

11460 remove cloud project from db when overwritten as local - #11648

Merged
embarc-gabriel merged 1 commit into
audacity:masterfrom
embarc-gabriel:11460-ovewrite-cloud-project
Sep 10, 2026
Merged

embarc-gabriel merged 1 commit into
audacity:masterfrom
embarc-gabriel:11460-ovewrite-cloud-project

Conversation

@embarc-gabriel

Copy link
Copy Markdown
Contributor

Resolves: #11460

If we try to overwrite a cloud project using save as local now we remove the project from the cloud database and save it as a local project instead.

  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

QA:

  • Testflow test cases have been run

@embarc-gabriel embarc-gabriel changed the title 11460 remove cloud project when overwritten as local 11460 remove cloud project from db when overwritten as local Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 54935c2d-55c4-48a4-b047-b57e0911c307

📥 Commits

Reviewing files that changed from the base of the PR and between 5fbbe77 and 9e199e5.

📒 Files selected for processing (2)
  • src/project/internal/projectactionscontroller.cpp
  • src/project/internal/projectactionscontroller.h
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/project/internal/projectactionscontroller.h
  • src/project/internal/projectactionscontroller.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

ProjectActionsController now uses doSaveProjectLocally for the actual local save operation. Cloud uploads use this helper directly. Standard local saves first remove any cloud-project record at the destination path and log deletion failures.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 9e199

The change separates cloud-record cleanup from local saving so overwriting a local copy of a cloud project can complete without the reported save error. No merge-blocking risk is currently identified.

Sequence Diagram(s)

sequenceDiagram
  participant ProjectActionsController
  participant CloudProjectsProvider
  participant AudioComService
  participant Project
  ProjectActionsController->>CloudProjectsProvider: Check destination path
  CloudProjectsProvider-->>ProjectActionsController: Return cloud-project record
  ProjectActionsController->>AudioComService: Delete cloud-project record
  ProjectActionsController->>Project: Save project locally
Loading
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary change: removing the cloud project association when saving over it as a local project.
Description check ✅ Passed The description links issue #11460, explains the behavior change and motivation, and completes the required checklist. QA testflow execution is not marked complete, but this is non-critical.
Linked Issues check ✅ Passed The changes address issue #11460 by removing the cloud project association before saving a local project to the same destination, which targets the reported save error.
Out of Scope Changes check ✅ Passed The changes are limited to local-save handling and the required private helper declaration. No unrelated changes are identified.

Warning

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/musescore.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: e9617302-622e-4fd7-8a9c-fb97d8ce2616

📥 Commits

Reviewing files that changed from the base of the PR and between 36b8647 and 2978455403a4f005f554df250b46082dcec59a76.

📒 Files selected for processing (2)
  • src/project/internal/projectactionscontroller.cpp
  • src/project/internal/projectactionscontroller.h

Comment on lines +748 to +754
const Ret deleteRet = audioComService()->deleteCloudProject(filePath);
if (!deleteRet) {
LOGW() << deleteRet.toString();
}
}

return doSaveProjectLocally(filePath, saveMode);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Make cloud cleanup failure-safe.

deleteCloudProject(filePath) can fail, but this branch only logs the failure and still calls doSaveProjectLocally. If the local save succeeds, saveProjectLocally returns true while the destination still has a cloud-project record. Return failure and skip the local save when deletion fails.

The current order has the opposite failure mode. If doSaveProjectLocally fails after deletion succeeds, the cloud record is already gone and no local replacement exists. Preserve the record until the local save succeeds, or add rollback or transaction handling.

Minimum failure-path fix
         if (!deleteRet) {
             LOGW() << deleteRet.toString();
+            return false;
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const Ret deleteRet = audioComService()->deleteCloudProject(filePath);
if (!deleteRet) {
LOGW() << deleteRet.toString();
}
}
return doSaveProjectLocally(filePath, saveMode);
const Ret deleteRet = audioComService()->deleteCloudProject(filePath);
if (!deleteRet) {
LOGW() << deleteRet.toString();
return false;
}
}
return doSaveProjectLocally(filePath, saveMode);

If we try to overwrite a cloud project using save as local
now we remove the project from the database and save it as
a local project.
@embarc-gabriel
embarc-gabriel force-pushed the 11460-ovewrite-cloud-project branch from 2978455 to 9e199e5 Compare September 10, 2026 01:23
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@embarc-gabriel
embarc-gabriel merged commit fb247d5 into audacity:master Sep 10, 2026
17 checks passed
kryksyh added a commit that referenced this pull request Sep 22, 2026
11460 remove cloud project from db when overwritten as local (#11648)
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.

'Error saving project' when trying to overwrite an existing local cloud project copy (MacOS)

2 participants