Skip to content

11309 11307 Fix cloud project multi-window support - #11310

Merged
embarc-gabriel merged 15 commits into
audacity:masterfrom
embarc-gabriel:open-cloud-project-flow
Jul 7, 2026
Merged

embarc-gabriel merged 15 commits into
audacity:masterfrom
embarc-gabriel:open-cloud-project-flow

Conversation

@embarc-gabriel

@embarc-gabriel embarc-gabriel commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Resolves: #11309
Resolves: #11307

Change open cloud project flow to fix multiple windows support.
Also check if the project is cloud using the database instead of the project location on disk.

  • 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

@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR reworks cloud project identification to use a projectId/snapshotId pair instead of local paths and URLs. Command-line/startup handling now recognizes cloud URLs. Audacity4Project caches CloudProjectInfo (projectId, snapshotId, localPath) and exposes it via a new cloudInfo() accessor on IAudacityProject. ProjectActionsController routing, recent-files persistence, and QML signal/handler chains across projects views were updated to carry only projectId (and optional snapshotId), replacing prior localPath/displayName/QUrl payloads. The old path-based isCloudProject check on ProjectConfiguration/IProjectConfiguration was removed. Cloud sync pending-record cleanup was simplified, and stub/mock signatures were updated accordingly.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant QMLView
  participant ProjectsPageModel
  participant ProjectActionsController
  participant CloudProjectsDatabase

  QMLView->>ProjectsPageModel: openCloudProject(projectId)
  ProjectsPageModel->>ProjectActionsController: dispatch cloud-file-open(projectId, snapshotId)
  ProjectActionsController->>CloudProjectsDatabase: cloudProjectLocalPath(projectId)
  CloudProjectsDatabase-->>ProjectActionsController: localPath or empty
  ProjectActionsController->>ProjectActionsController: openCloudProject(localPath, projectId, snapshotId)
Loading

Related PRs: None identified.

Suggested labels: cloud, project-management, refactor

Suggested reviewers: None identified.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address #11309 by using database-based cloud detection and simplifying the open-cloud-project flow for second-window opens.
Out of Scope Changes check ✅ Passed The code changes are broadly aligned with the cloud multi-window and database-detection goals, with no clear unrelated additions.
Title check ✅ Passed The title is concise and clearly summarizes the main change: fixing cloud project multi-window support.
Description check ✅ Passed The description matches the template well, including issue links, summary, and checklist items, with only QA remaining unchecked.

Warning

Review ran into problems

🔥 Problems

Linked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. 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: 2

🧹 Nitpick comments (1)
src/project/view/recentprojectsmodel.cpp (1)

92-95: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Collapse the duplicate cloud-project lookup cloudProjectId() already returns nullopt for non-cloud projects, so it can replace the separate isCloudProject() check and avoid a second CloudProjectsDatabase read per recent item.

Suggested change
-        const bool isCloud = audioComService()->isCloudProject(file.path);
-        const QString cloudProjectId = isCloud
-                                       ? QString::fromStdString(audioComService()->cloudProjectId(file.path).value_or(std::string()))
-                                       : QString();
+        const std::optional<std::string> cloudId = audioComService()->cloudProjectId(file.path);
+        const bool isCloud = cloudId.has_value();
+        const QString cloudProjectId = isCloud ? QString::fromStdString(*cloudId) : QString();

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 9c7af67c-c32c-4e93-b5c6-701583915b2a

📥 Commits

Reviewing files that changed from the base of the PR and between 071229e and 49aa61a9ce6f34c84b235ec3075b59f61858f3d6.

📒 Files selected for processing (37)
  • src/app/cmdoptions.h
  • src/app/commandlineparser.cpp
  • src/app/guiapp.cpp
  • src/appshell/appshelltypes.h
  • src/appshell/internal/startupscenario.cpp
  • src/appshell/internal/startupscenario.h
  • src/appshell/istartupscenario.h
  • src/au3cloud/iau3audiocomservice.h
  • src/au3cloud/internal/au3audiocomservice.cpp
  • src/au3cloud/internal/au3audiocomservice.h
  • src/au3cloud/internal/cloudurlhandler.cpp
  • src/project/internal/audacityproject.cpp
  • src/project/internal/audacityproject.h
  • src/project/internal/projectactionscontroller.cpp
  • src/project/internal/projectconfiguration.cpp
  • src/project/internal/projectconfiguration.h
  • src/project/iprojectconfiguration.h
  • src/project/qml/Audacity/Project/ProjectsGridView.qml
  • src/project/qml/Audacity/Project/ProjectsListView.qml
  • src/project/qml/Audacity/Project/ProjectsPage.qml
  • src/project/qml/Audacity/Project/ProjectsView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/CloudProjectsView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/DefaultProjectListView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/RecentProjectsView.qml
  • src/project/tests/mocks/projectconfigurationmock.h
  • src/project/types/projecttypes.h
  • src/project/view/cloudprojectcontextmenumodel.cpp
  • src/project/view/cloudprojectcontextmenumodel.h
  • src/project/view/cloudprojectsmodel.cpp
  • src/project/view/projectspagemodel.cpp
  • src/project/view/projectspagemodel.h
  • src/project/view/recentprojectcontextmenumodel.cpp
  • src/project/view/recentprojectcontextmenumodel.h
  • src/project/view/recentprojectsmodel.cpp
  • src/project/view/recentprojectsmodel.h
  • src/stubs/au3cloud/au3audiocomservicestub.cpp
  • src/stubs/au3cloud/au3audiocomservicestub.h
💤 Files with no reviewable changes (4)
  • src/project/tests/mocks/projectconfigurationmock.h
  • src/project/iprojectconfiguration.h
  • src/project/internal/projectconfiguration.h
  • src/project/internal/projectconfiguration.cpp

Comment thread src/project/view/projectspagemodel.cpp Resolved
@embarc-gabriel
embarc-gabriel force-pushed the open-cloud-project-flow branch from 49aa61a to 3785c46 Compare June 30, 2026 15:49

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/project/internal/projectactionscontroller.cpp (1)

883-895: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve cloud routing for known cloud local paths.

projectId is now unused and doOpenProject(actualPath) bypasses the cloud open flow, so opening a known cloud project by local path can skip the cloud DB lookup, unsynced checks, and sync resume. Replace the removed configuration check with the new audio-com DB lookup.

Proposed routing
-    return doOpenProject(actualPath);
+    if (audioComService()->enabled()) {
+        const std::string cloudProjectId = !projectId.isEmpty()
+                                           ? projectId.toStdString()
+                                           : audioComService()->cloudProjectId(actualPath).value_or(std::string {});
+        if (!cloudProjectId.empty()) {
+            return openCloudProject(actualPath, String::fromStdString(cloudProjectId));
+        }
+    }
+
+    return doOpenProject(actualPath);

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 4f0a1060-c4e3-4c9a-867f-81b1a6fe3256

📥 Commits

Reviewing files that changed from the base of the PR and between 49aa61a9ce6f34c84b235ec3075b59f61858f3d6 and 3785c464291cc6348493e195edda1789f0a53118.

📒 Files selected for processing (37)
  • src/app/cmdoptions.h
  • src/app/commandlineparser.cpp
  • src/app/guiapp.cpp
  • src/appshell/appshelltypes.h
  • src/appshell/internal/startupscenario.cpp
  • src/appshell/internal/startupscenario.h
  • src/appshell/istartupscenario.h
  • src/au3cloud/iau3audiocomservice.h
  • src/au3cloud/internal/au3audiocomservice.cpp
  • src/au3cloud/internal/au3audiocomservice.h
  • src/au3cloud/internal/cloudurlhandler.cpp
  • src/project/internal/audacityproject.cpp
  • src/project/internal/audacityproject.h
  • src/project/internal/projectactionscontroller.cpp
  • src/project/internal/projectconfiguration.cpp
  • src/project/internal/projectconfiguration.h
  • src/project/iprojectconfiguration.h
  • src/project/qml/Audacity/Project/ProjectsGridView.qml
  • src/project/qml/Audacity/Project/ProjectsListView.qml
  • src/project/qml/Audacity/Project/ProjectsPage.qml
  • src/project/qml/Audacity/Project/ProjectsView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/CloudProjectsView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/DefaultProjectListView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/RecentProjectsView.qml
  • src/project/tests/mocks/projectconfigurationmock.h
  • src/project/types/projecttypes.h
  • src/project/view/cloudprojectcontextmenumodel.cpp
  • src/project/view/cloudprojectcontextmenumodel.h
  • src/project/view/cloudprojectsmodel.cpp
  • src/project/view/projectspagemodel.cpp
  • src/project/view/projectspagemodel.h
  • src/project/view/recentprojectcontextmenumodel.cpp
  • src/project/view/recentprojectcontextmenumodel.h
  • src/project/view/recentprojectsmodel.cpp
  • src/project/view/recentprojectsmodel.h
  • src/stubs/au3cloud/au3audiocomservicestub.cpp
  • src/stubs/au3cloud/au3audiocomservicestub.h
💤 Files with no reviewable changes (4)
  • src/project/tests/mocks/projectconfigurationmock.h
  • src/project/internal/projectconfiguration.cpp
  • src/project/iprojectconfiguration.h
  • src/project/internal/projectconfiguration.h
✅ Files skipped from review due to trivial changes (4)
  • src/appshell/appshelltypes.h
  • src/project/internal/audacityproject.cpp
  • src/project/internal/audacityproject.h
  • src/au3cloud/internal/au3audiocomservice.h
🚧 Files skipped from review as they are similar to previous changes (26)
  • src/project/qml/Audacity/Project/internal/ProjectsPage/CloudProjectsView.qml
  • src/project/qml/Audacity/Project/ProjectsGridView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/RecentProjectsView.qml
  • src/appshell/istartupscenario.h
  • src/project/view/recentprojectcontextmenumodel.h
  • src/au3cloud/iau3audiocomservice.h
  • src/project/view/projectspagemodel.cpp
  • src/project/types/projecttypes.h
  • src/project/qml/Audacity/Project/ProjectsPage.qml
  • src/project/view/recentprojectsmodel.h
  • src/app/cmdoptions.h
  • src/project/view/projectspagemodel.h
  • src/project/qml/Audacity/Project/ProjectsListView.qml
  • src/appshell/internal/startupscenario.h
  • src/project/view/cloudprojectsmodel.cpp
  • src/app/commandlineparser.cpp
  • src/au3cloud/internal/cloudurlhandler.cpp
  • src/au3cloud/internal/au3audiocomservice.cpp
  • src/project/view/cloudprojectcontextmenumodel.cpp
  • src/project/view/recentprojectcontextmenumodel.cpp
  • src/project/qml/Audacity/Project/ProjectsView.qml
  • src/project/view/recentprojectsmodel.cpp
  • src/project/view/cloudprojectcontextmenumodel.h
  • src/app/guiapp.cpp
  • src/appshell/internal/startupscenario.cpp
  • src/project/qml/Audacity/Project/internal/ProjectsPage/DefaultProjectListView.qml

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/project/internal/projectactionscontroller.cpp (1)

886-897: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preserve projectId when routing cloud projects.

openProject(..., projectId) drops projectId here and falls back to path-only startup/opening, so a recent cloud project resolved from the database can be opened as a plain local file instead of through the cloud-project route. Route non-empty projectId through --cloud-project-id for new windows and the cloud open path for the current window.

Proposed fix
     if (globalContext()->currentProject()) {
         QStringList args;
-        args << actualPath.toQString();
-
-        if (!displayNameOverride.isEmpty()) {
+        if (!projectId.isEmpty()) {
+            args << "--cloud-project-id" << projectId.toQString();
+        } else {
+            args << actualPath.toQString();
+        }
+
+        if (projectId.isEmpty() && !displayNameOverride.isEmpty()) {
             args << "--project-display-name-override" << displayNameOverride;
         }
         multiwindowsProvider()->openNewWindow(args);
         return make_ret(Ret::Code::Ok);
     }
 
+    if (!projectId.isEmpty()) {
+        return openCloudProject(actualPath, projectId.toQString(), QString());
+    }
+
     return doOpenProject(actualPath);

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 3eec67f8-2d19-48cc-be4d-8753b6032b33

📥 Commits

Reviewing files that changed from the base of the PR and between 3785c464291cc6348493e195edda1789f0a53118 and 25fcc1dfb894de957c6c0cb98859884c88c14e57.

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

@embarc-gabriel
embarc-gabriel force-pushed the open-cloud-project-flow branch 2 times, most recently from cb4557c to 91e90da Compare July 1, 2026 11:19

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/project/internal/projectactionscontroller.cpp (1)

887-898: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve projectId when routing cloud projects.

When this overload receives a non-empty projectId, the changed paths discard it and open actualPath directly, bypassing the new cloud startup/sync route.

Proposed fix
     if (globalContext()->currentProject()) {
         QStringList args;
-        args << actualPath.toQString();
-
-        if (!displayNameOverride.isEmpty()) {
-            args << "--project-display-name-override" << displayNameOverride;
+        if (!projectId.isEmpty()) {
+            args << "--cloud-project-id" << projectId;
+        } else {
+            args << actualPath.toQString();
+
+            if (!displayNameOverride.isEmpty()) {
+                args << "--project-display-name-override" << displayNameOverride;
+            }
         }
         multiwindowsProvider()->openNewWindow(args);
         return make_ret(Ret::Code::Ok);
     }
 
+    if (!projectId.isEmpty()) {
+        return openCloudProject(actualPath, projectId);
+    }
+
     return doOpenProject(actualPath);

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 900c1191-9eb9-4d4d-928b-798a8fc0287f

📥 Commits

Reviewing files that changed from the base of the PR and between 25fcc1dfb894de957c6c0cb98859884c88c14e57 and 91e90da8433160e324df06ccdd9dfeafd66cdc4f.

📒 Files selected for processing (37)
  • src/app/cmdoptions.h
  • src/app/commandlineparser.cpp
  • src/app/guiapp.cpp
  • src/appshell/appshelltypes.h
  • src/appshell/internal/startupscenario.cpp
  • src/appshell/internal/startupscenario.h
  • src/appshell/istartupscenario.h
  • src/au3cloud/iau3audiocomservice.h
  • src/au3cloud/internal/au3audiocomservice.cpp
  • src/au3cloud/internal/au3audiocomservice.h
  • src/au3cloud/internal/cloudurlhandler.cpp
  • src/project/internal/audacityproject.cpp
  • src/project/internal/audacityproject.h
  • src/project/internal/projectactionscontroller.cpp
  • src/project/internal/projectconfiguration.cpp
  • src/project/internal/projectconfiguration.h
  • src/project/iprojectconfiguration.h
  • src/project/qml/Audacity/Project/ProjectsGridView.qml
  • src/project/qml/Audacity/Project/ProjectsListView.qml
  • src/project/qml/Audacity/Project/ProjectsPage.qml
  • src/project/qml/Audacity/Project/ProjectsView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/CloudProjectsView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/DefaultProjectListView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/RecentProjectsView.qml
  • src/project/tests/mocks/projectconfigurationmock.h
  • src/project/types/projecttypes.h
  • src/project/view/cloudprojectcontextmenumodel.cpp
  • src/project/view/cloudprojectcontextmenumodel.h
  • src/project/view/cloudprojectsmodel.cpp
  • src/project/view/projectspagemodel.cpp
  • src/project/view/projectspagemodel.h
  • src/project/view/recentprojectcontextmenumodel.cpp
  • src/project/view/recentprojectcontextmenumodel.h
  • src/project/view/recentprojectsmodel.cpp
  • src/project/view/recentprojectsmodel.h
  • src/stubs/au3cloud/au3audiocomservicestub.cpp
  • src/stubs/au3cloud/au3audiocomservicestub.h
💤 Files with no reviewable changes (4)
  • src/project/internal/projectconfiguration.h
  • src/project/tests/mocks/projectconfigurationmock.h
  • src/project/iprojectconfiguration.h
  • src/project/internal/projectconfiguration.cpp
✅ Files skipped from review due to trivial changes (1)
  • src/appshell/appshelltypes.h
🚧 Files skipped from review as they are similar to previous changes (31)
  • src/appshell/istartupscenario.h
  • src/project/qml/Audacity/Project/internal/ProjectsPage/RecentProjectsView.qml
  • src/project/qml/Audacity/Project/ProjectsGridView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/CloudProjectsView.qml
  • src/project/internal/audacityproject.h
  • src/project/qml/Audacity/Project/internal/ProjectsPage/DefaultProjectListView.qml
  • src/au3cloud/internal/au3audiocomservice.h
  • src/project/view/cloudprojectsmodel.cpp
  • src/project/qml/Audacity/Project/ProjectsListView.qml
  • src/project/internal/audacityproject.cpp
  • src/app/commandlineparser.cpp
  • src/au3cloud/iau3audiocomservice.h
  • src/app/cmdoptions.h
  • src/project/qml/Audacity/Project/ProjectsView.qml
  • src/project/view/cloudprojectcontextmenumodel.h
  • src/project/view/cloudprojectcontextmenumodel.cpp
  • src/project/view/recentprojectcontextmenumodel.cpp
  • src/project/view/projectspagemodel.cpp
  • src/project/types/projecttypes.h
  • src/project/view/recentprojectsmodel.h
  • src/project/view/projectspagemodel.h
  • src/stubs/au3cloud/au3audiocomservicestub.cpp
  • src/project/view/recentprojectcontextmenumodel.h
  • src/au3cloud/internal/cloudurlhandler.cpp
  • src/appshell/internal/startupscenario.h
  • src/au3cloud/internal/au3audiocomservice.cpp
  • src/stubs/au3cloud/au3audiocomservicestub.h
  • src/app/guiapp.cpp
  • src/project/qml/Audacity/Project/ProjectsPage.qml
  • src/appshell/internal/startupscenario.cpp
  • src/project/view/recentprojectsmodel.cpp

Comment on lines 32 to 34
muse::RetVal<muse::ProgressPtr> openCloudProject(const muse::io::path_t& localPath, const std::string& projectId = {},
bool forceOverwrite = false) override;
const std::string& snapshotId = {}, bool forceOverwrite = false) override;
muse::RetVal<muse::ProgressPtr> resumeProjectSync(au::project::IAudacityProjectPtr project) override;

@luapmartin luapmartin Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am surprised we use string type (string ref) for something as an Id it should be typed right? not for that branch I guess but it's a lost opportunity to strong type those ids (audioId, projectId, snapshotId...)

Comment thread src/au3cloud/iau3audiocomservice.h Resolved
Comment thread src/app/cmdoptions.h Resolved
@luapmartin
luapmartin force-pushed the open-cloud-project-flow branch from 729156b to 00ff963 Compare July 2, 2026 08:15

@luapmartin luapmartin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved but I wonder if the IDs should be typed and also if we should maybe keep the cloud ID as a reference inside the local project data because if I move the local file on my disk it will get out of sync with the cloud because the cloud db will expect the file at another location and all other types of de-sync issue that could happen around those lines. Actually I wonder if we should store the cloud project local file only on a temp directory far away from the user to avoid and copy paste or move of the local file...

@embarc-gabriel
embarc-gabriel force-pushed the open-cloud-project-flow branch from 00ff963 to 315631a Compare July 2, 2026 13:48
@embarc-gabriel

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/project/internal/audacityproject.cpp (1)

252-271: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Stale m_cloudInfo when path unchanged but cloud metadata changes.

setPath() refreshes m_cloudInfo from CloudProjectsDatabase only when path != m_path (the early return at Line 254-256 skips the whole DB lookup otherwise). If the cloud sync flow updates the DB entry for the same local path — e.g., a new SnapshotId is recorded after a save/sync while the project stays open at the same path — this cached m_cloudInfo becomes stale. Since ProjectActionsController::makeRecentFile() assigns file.cloudInfo = project->cloudInfo() directly from this cache, a stale snapshot id could be persisted into the recent-files list, causing reopen to target the wrong snapshot.

Consider re-querying (or invalidating) m_cloudInfo whenever the cloud sync layer updates the DB record for the currently-open path, not only on setPath() path changes.

💡 Possible approach
-void Audacity4Project::setPath(const io::path_t& path)
-{
-    if (m_path == path) {
-        return;
-    }
-
-    m_path = path;
-
-    const auto data = audacity::cloud::audiocom::sync::CloudProjectsDatabase::Get().GetProjectDataForPath(m_path.toStdString());
-    ...
-}
+void Audacity4Project::setPath(const io::path_t& path)
+{
+    if (m_path != path) {
+        m_path = path;
+    }
+
+    refreshCloudInfo();
+
+    m_pathChanged.notify();
+}
+
+void Audacity4Project::refreshCloudInfo()
+{
+    const auto data = audacity::cloud::audiocom::sync::CloudProjectsDatabase::Get().GetProjectDataForPath(m_path.toStdString());
+    ...
+}

(Note: also expose refreshCloudInfo() for callers, e.g. after cloud-sync completion, to re-sync the cache — this is illustrative, not exhaustive.)


ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 24aa45b8-b3af-435b-a5d5-7e82a3778e51

📥 Commits

Reviewing files that changed from the base of the PR and between 91e90da8433160e324df06ccdd9dfeafd66cdc4f and 64c72bbe74399740869b961991758189243ef4fd.

📒 Files selected for processing (35)
  • au3/libraries/au3-cloud-audiocom/sync/LocalProjectSnapshot.cpp
  • src/app/commandlineparser.cpp
  • src/app/guiapp.cpp
  • src/au3cloud/internal/au3audiocomservice.cpp
  • src/au3cloud/internal/cloudurlhandler.cpp
  • src/project/iaudacityproject.h
  • src/project/internal/audacityproject.cpp
  • src/project/internal/audacityproject.h
  • src/project/internal/projectactionscontroller.cpp
  • src/project/internal/projectconfiguration.cpp
  • src/project/internal/projectconfiguration.h
  • src/project/internal/recentfilescontroller.cpp
  • src/project/iprojectconfiguration.h
  • src/project/qml/Audacity/Project/ProjectsGridView.qml
  • src/project/qml/Audacity/Project/ProjectsListView.qml
  • src/project/qml/Audacity/Project/ProjectsPage.qml
  • src/project/qml/Audacity/Project/ProjectsView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/CloudProjectsView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/DefaultProjectListView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/RecentProjectsView.qml
  • src/project/tests/mocks/audacityprojectmock.h
  • src/project/tests/mocks/projectconfigurationmock.h
  • src/project/types/projecttypes.h
  • src/project/view/cloudprojectcontextmenumodel.cpp
  • src/project/view/cloudprojectcontextmenumodel.h
  • src/project/view/cloudprojectsmodel.cpp
  • src/project/view/projectspagemodel.cpp
  • src/project/view/projectspagemodel.h
  • src/project/view/recentprojectcontextmenumodel.cpp
  • src/project/view/recentprojectcontextmenumodel.h
  • src/project/view/recentprojectsmodel.cpp
  • src/project/view/recentprojectsmodel.h
  • src/projectscene/tests/mocks/audacity4projectmock.h
  • src/stubs/au3cloud/au3audiocomservicestub.cpp
  • src/stubs/au3cloud/au3audiocomservicestub.h
💤 Files with no reviewable changes (5)
  • src/project/tests/mocks/projectconfigurationmock.h
  • src/project/internal/projectconfiguration.cpp
  • src/project/internal/projectconfiguration.h
  • src/project/iprojectconfiguration.h
  • au3/libraries/au3-cloud-audiocom/sync/LocalProjectSnapshot.cpp
✅ Files skipped from review due to trivial changes (1)
  • src/project/iaudacityproject.h
🚧 Files skipped from review as they are similar to previous changes (15)
  • src/project/qml/Audacity/Project/internal/ProjectsPage/CloudProjectsView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/DefaultProjectListView.qml
  • src/project/qml/Audacity/Project/internal/ProjectsPage/RecentProjectsView.qml
  • src/project/qml/Audacity/Project/ProjectsView.qml
  • src/project/view/projectspagemodel.h
  • src/project/view/cloudprojectsmodel.cpp
  • src/project/view/cloudprojectcontextmenumodel.cpp
  • src/project/qml/Audacity/Project/ProjectsGridView.qml
  • src/project/view/cloudprojectcontextmenumodel.h
  • src/project/qml/Audacity/Project/ProjectsPage.qml
  • src/project/view/recentprojectcontextmenumodel.cpp
  • src/project/view/projectspagemodel.cpp
  • src/project/view/recentprojectcontextmenumodel.h
  • src/au3cloud/internal/cloudurlhandler.cpp
  • src/project/qml/Audacity/Project/ProjectsListView.qml

@embarc-gabriel
embarc-gabriel force-pushed the open-cloud-project-flow branch 2 times, most recently from 2d82a2c to 8c4fab2 Compare July 6, 2026 09:39
@embarc-gabriel
embarc-gabriel requested a review from Eism July 6, 2026 09:47
@embarc-gabriel embarc-gabriel changed the title 11309 11307 11243 Fix cloud project multi-window support 11309 11307 Fix cloud project multi-window support Jul 6, 2026
@embarc-gabriel
embarc-gabriel force-pushed the open-cloud-project-flow branch 2 times, most recently from 9f37b50 to c7e9404 Compare July 6, 2026 17:08
Comment thread src/project/iaudacityproject.h Resolved
@embarc-gabriel
embarc-gabriel force-pushed the open-cloud-project-flow branch 2 times, most recently from 1a23823 to ff4ab3e Compare July 7, 2026 11:11
@embarc-gabriel
embarc-gabriel force-pushed the open-cloud-project-flow branch from ff4ab3e to ec53623 Compare July 7, 2026 14:01
@embarc-gabriel
embarc-gabriel merged commit 4b0b22a into audacity:master Jul 7, 2026
17 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 31, 2026
10 of 12 tasks
@embarc-gabriel
embarc-gabriel deleted the open-cloud-project-flow branch August 28, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants