Skip to content

Luapmartin/10510 - #10518

Closed
luapmartin wants to merge 41 commits into
audacity:masterfrom
luapmartin:luapmartin/10510
Closed

luapmartin wants to merge 41 commits into
audacity:masterfrom
luapmartin:luapmartin/10510

Conversation

@luapmartin

@luapmartin luapmartin commented Mar 11, 2026 •

Copy link
Copy Markdown
Contributor

Resolves: Revert to factory setting crash #10510

might fix: #10519

(short description of the changes and the motivation to make the changes)

  • 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:

  • Autobot test cases have been run

@luapmartin luapmartin self-assigned this Mar 11, 2026
@luapmartin luapmartin linked an issue Mar 11, 2026 that may be closed by this pull request
@luapmartin
luapmartin force-pushed the luapmartin/10510 branch 7 times, most recently from 4272398 to 66ff24f Compare March 18, 2026 10:33
Comment thread src/au3cloud/au3cloudmodule.cpp Resolved
Comment thread src/importexport/export/CMakeLists.txt Resolved
Comment thread src/au3cloud/iau3audiocomservice.h Resolved
Comment thread src/appshell/tests/CMakeLists.txt Resolved
@luapmartin
luapmartin force-pushed the luapmartin/10510 branch 3 times, most recently from d562e1e to d98a4ee Compare March 18, 2026 21:47
@luapmartin
luapmartin force-pushed the luapmartin/10510 branch 5 times, most recently from 7ba6755 to 629f1f4 Compare March 25, 2026 13:53

@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

Caution

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

⚠️ Outside diff range comments (1)
CMakeLists.txt (1)

100-116: ⚠️ Potential issue | 🟠 Major

AU_BUILD_APPSHELL_TESTS does not currently disable the supporting workspace tests.

MUSE_MODULE_WORKSPACE_TESTS is forced on before the new option is even declared, so a build with -DAU_BUILD_APPSHELL_TESTS=OFF still keeps the framework workspace test surface enabled. That makes the new toggle incomplete and can break “tests-off” build profiles.

💡 Suggested fix
-set(MUSE_MODULE_WORKSPACE_TESTS ON)
+set(MUSE_MODULE_WORKSPACE_TESTS OFF)
 ...
 option(AU_BUILD_APPSHELL_MODULE "Build appshell module" ON)
+option(AU_BUILD_APPSHELL_TESTS "Build appshell tests" ON)
 option(AU_BUILD_AUTOMATION_TESTS "Build automation tests" ON)
 option(AU_BUILD_CLOUD_AUDIOCOM "Build cloud audiocom module" ON)
 ...
-option(AU_BUILD_APPSHELL_TESTS "Build appshell tests" ON)
+if (MUSE_ENABLE_UNIT_TESTS AND AU_BUILD_APPSHELL_TESTS)
+    set(MUSE_MODULE_WORKSPACE_TESTS ON)
+endif()
♻️ Duplicate comments (1)
src/au3cloud/au3cloudmodule.cpp (1)

37-39: ⚠️ Potential issue | 🟠 Major

Move the cloud DB teardown out of the per-context deinit path.

Au3CloudContext::onDeinit() runs once per IOC context, but the database you are closing in IAu3AudioComService::deinit() is process-wide (CloudProjectsDatabase::Get()). In a multi-window session, destroying one context can tear down the shared DB while other contexts are still alive. This belongs in Au3CloudModule::onDeinit() or behind a “last context shutting down” guard instead.

Also applies to: 80-85


ℹ️ Review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro

Run ID: b767054d-111e-4931-a43e-5de9d3c1c50f

📥 Commits

Reviewing files that changed from the base of the PR and between f088e9c0b098c2241ac1fb4403c9f69c4b97eba9 and b6dfd74.

📒 Files selected for processing (31)
  • CMakeLists.txt
  • au3/libraries/au3-cloud-audiocom/sync/CloudProjectsDatabase.cpp
  • au3/libraries/au3-cloud-audiocom/sync/CloudProjectsDatabase.h
  • au3/libraries/au3-cloud-audiocom/sync/CloudSyncHousekeeper.cpp
  • muse_framework
  • src/app/app.cpp
  • src/app/commandlineparser.cpp
  • src/app/commandlineparser.h
  • src/app/guiapp.cpp
  • src/appshell/CMakeLists.txt
  • src/appshell/iappshellconfiguration.h
  • src/appshell/internal/applicationactioncontroller.cpp
  • src/appshell/internal/applicationactioncontroller.h
  • src/appshell/internal/appshellconfiguration.cpp
  • src/appshell/internal/appshellconfiguration.h
  • src/appshell/tests/CMakeLists.txt
  • src/appshell/tests/factoryreset_actioncontroller_tests.cpp
  • src/appshell/tests/mocks/appshellconfigurationmock.h
  • src/au3cloud/CMakeLists.txt
  • src/au3cloud/au3cloudmodule.cpp
  • src/au3cloud/au3cloudmodule.h
  • src/au3cloud/iau3audiocomservice.h
  • src/au3cloud/internal/au3audiocomservice.cpp
  • src/au3cloud/internal/au3audiocomservice.h
  • src/effects/effects_base/effectsmodule.cpp
  • src/effects/effects_base/effectsmodule.h
  • src/importexport/export/CMakeLists.txt
  • src/project/internal/projectactionscontroller.cpp
  • src/project/tests/mocks/projectfilescontrollermock.h
  • src/stubs/au3cloud/au3audiocomservicestub.cpp
  • src/stubs/au3cloud/au3audiocomservicestub.h
💤 Files with no reviewable changes (4)
  • src/effects/effects_base/effectsmodule.h
  • src/effects/effects_base/effectsmodule.cpp
  • src/au3cloud/CMakeLists.txt
  • src/importexport/export/CMakeLists.txt

Comment thread src/app/guiapp.cpp
Comment on lines +478 to +479
if (options.app.factoryReset) {
appshellConfiguration()->revertToFactorySettings();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Defer the CLI factory reset until after module init.

applyCommandLineOptions() runs from GuiApp::setup() before module onInit() (Line 78 vs. Line 90-93), but the new pre-reset cleanup is wired from src/au3cloud/internal/au3audiocomservice.cpp::init(). In the --factory-settings path, aboutToRevertToFactorySettings() therefore fires with no listeners, so the DB-close hook added by this PR is skipped. Please move this reset branch to a post-init phase, or invoke the same cleanup explicitly before resetting here.

Comment on lines +18 to +25
set(MODULE_TEST_INCLUDE
${MUSE_FRAMEWORK_PATH}/framework/multiwindows
${MUSE_FRAMEWORK_PATH}/framework/actions
${MUSE_FRAMEWORK_PATH}/framework/interactive
${MUSE_FRAMEWORK_PATH}/framework/global
${CMAKE_SOURCE_DIR}/src/appshell
${CMAKE_SOURCE_DIR}/src/record
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

The include roots do not match the new test's #include prefixes.

The test source includes both actions/tests/...-style mock headers and framework/... headers pulled in by applicationactioncontroller.h. With the current paths, the compiler looks under .../framework/actions/actions/tests/... and .../framework/global/framework/..., which is wrong. project/... and record/... also need the src root, not per-module subdirectories.

💡 Suggested fix
 set(MODULE_TEST_INCLUDE
-    ${MUSE_FRAMEWORK_PATH}/framework/multiwindows
-    ${MUSE_FRAMEWORK_PATH}/framework/actions
-    ${MUSE_FRAMEWORK_PATH}/framework/interactive
-    ${MUSE_FRAMEWORK_PATH}/framework/global
+    ${MUSE_FRAMEWORK_PATH}
+    ${MUSE_FRAMEWORK_PATH}/framework
+    ${CMAKE_SOURCE_DIR}/src
     ${CMAKE_SOURCE_DIR}/src/appshell
-    ${CMAKE_SOURCE_DIR}/src/record
 )

@luapmartin

Copy link
Copy Markdown
Contributor Author

replaced by #10794

luapmartin added a commit that referenced this pull request Apr 27, 2026
Resolves: 
Revert to factory setting crash
#10510
copy update #9677

- Unify factory-reset entry points via FactoryResetMode; close
CloudProjectsDatabase before wiping config
- Multi-window restart-confirmation handling; cancel is default
- Add single- and multi-window action-controller tests; drop unused -R
CLI flag

this PR replaces #10518


<!-- Use "x" to fill the checkboxes below like [x] -->

- [x] I signed [CLA](https://www.audacityteam.org/cla/)
- [x] The title of the pull request describes an issue it addresses
- [x] If changes are extensive, then there is a sequence of easily
reviewable commits
- [x] Each commit's message describes its purpose and effects
- [x] There are no behavior changes unnecessary for the stated purpose
of the PR

Recommended:
- [x] Each commit compiles and runs on my machine without known
undesirable changes of behavior

QA:

- [ ] Testflow test cases have been run
@luapmartin
luapmartin deleted the luapmartin/10510 branch April 28, 2026 06:41
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.

Crash on exit (MacOS) Revert to factory setting crash Revert to factory settings – copy update

3 participants