You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds project recovery tool that allows users to recover a corrupted project. This PR adds the infrastructure, ui and first recovery method which replaces the missing audio data with silence.
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.
This pull request adds a project recovery module with project inspection, missing-block repair, and a QML recovery wizard. It adds SQLite and binary XML support, project parsing, and WAL-aware working copies. The application can open recovery from the Tools menu or from a project-open error dialog for Audacity exception errors. Tests cover serialization, inspection, and repair.
sequenceDiagram
actor User
participant ProjectRecoveryDialog
participant ProjectRecoveryWizardModel
participant ProjectRecoveryService
participant ProjectInspector
participant ProjectRepairer
User->>ProjectRecoveryDialog: Select project and start analysis
ProjectRecoveryDialog->>ProjectRecoveryWizardModel: Set path and advance
ProjectRecoveryWizardModel->>ProjectRecoveryService: Request inspection
ProjectRecoveryService->>ProjectInspector: Inspect project
ProjectInspector-->>ProjectRecoveryService: Return inspection
ProjectRecoveryService-->>ProjectRecoveryWizardModel: Complete inspection future
ProjectRecoveryWizardModel-->>ProjectRecoveryDialog: Display inspection results
ProjectRecoveryWizardModel->>ProjectRecoveryService: Request repair
ProjectRecoveryService->>ProjectRepairer: Repair project copy
ProjectRepairer-->>ProjectRecoveryService: Return repair report
ProjectRecoveryService-->>ProjectRecoveryWizardModel: Complete repair future
ProjectRecoveryDialog->>ProjectRecoveryWizardModel: Open recovered result
Loading
Merge Risk: Low · previous review 76745
The recovery tool works on a copy and leaves the original project untouched. Some edge cases remain: UNC network paths, read-only source projects, concurrent repairs to the same output, and a few unconfirmed UI polish and accessibility items. These are worth fixing but are unlikely to block most users.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "Project recovery tool" names the main change. The PR adds a project recovery module, its UI wizard, and a first recovery method that silences missing audio blocks. The title is short and sp…
Description check
The description states the purpose (a tool to recover corrupted projects), links issue #12414, and summarizes the infrastructure, UI, and first recovery method. It also keeps the template checklist. T…
Linked Issues check
[#12414] asks for a recovery tool for corrupted projects. The issue has no textual acceptance criteria. Its only detail is a Figma design link, which cannot be checked from the repository. The require…
Out of Scope Changes check
Each changed area supports the recovery tool: - Build changes add the projectrecovery target, the AU_BUILD_PROJECTRECOVERY_TESTS option, and the Audacity.ProjectRecovery QML module. - `appfactor…
Full details: Title check
Explanation
The title "Project recovery tool" names the main change. The PR adds a project recovery module, its UI wizard, and a first recovery method that silences missing audio blocks. The title is short and specific, though it does not mention the silence-based repair.
Full details: Description check
Explanation
The description states the purpose (a tool to recover corrupted projects), links issue #12414, and summarizes the infrastructure, UI, and first recovery method. It also keeps the template checklist. The template's 'short description' and issue link are present. The first checkbox is ticked and the 'compiles and runs' item is unticked, which is acceptable. It does not explain the recovery method's limits or testing, but the template does not require that, so the description is mostly complete.
Full details: Linked Issues check
Explanation
[#12414] asks for a recovery tool for corrupted projects. The issue has no textual acceptance criteria. Its only detail is a Figma design link, which cannot be checked from the repository. The requirement is therefore to provide a project recovery tool. The whole-PR summary (merge base 9d26524 to head 7674579) shows these implementing changes:
Tools menu command PROJECT_RECOVERY_COMMAND (command://project/recovery) opens the recovery wizard (ProjectRecoveryDialog.qml, backed by ProjectRecoveryWizardModel).
ProjectInspector::inspect checks the project database, WAL state, and project and autosave documents for missing and orphan blocks.
ProjectRepairer::repair and silenceBlocks replace missing audio blocks with silence in a new output file. The original file is not modified.
A failed project open offers a Recover action (projectactionscontroller.cpp).
Automated tests cover binary XML, document editing, project parsing, inspection, repair, and the service.
The PR description states the same scope. The summary matches the previous review conclusion. The incremental changes since the previous reviewed head were not read in detail. The verdict relies on the whole-PR summary, which does not contradict the previous conclusion.
Full details: Out of Scope Changes check
Explanation
Each changed area supports the recovery tool:
Build changes add the projectrecovery target, the AU_BUILD_PROJECTRECOVERY_TESTS option, and the Audacity.ProjectRecovery QML module.
appfactory.cpp, appmenumodel.cpp, the appshell link list, and projectactionscontroller.cpp register the module, the menu command, and the error-dialog entry point.
The .cfg theme files add colors for the callout, progress indicator, and track elements used by Callout.qml, IndeterminateProgressBar.qml, and StepIndicator.qml. The existing audio_envelope_point_centre value is unchanged.
Tests and test helpers cover the new backend code.
The verdict relies on the whole-PR summary. Source files were not read directly. The incremental changes since the previous reviewed head were not read in detail. No ignored files apply.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Reviewing files that changed from the base of the PR and between 377cf98 and 36d29e1.
Files selected for processing: 4
src/projectrecovery/CMakeLists.txt
src/projectrecovery/internal/database.cpp
src/projectrecovery/tests/CMakeLists.txt
src/projectrecovery/tests/testprojectbuilder.cpp
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Data Integrity & Integration · Quick win
Stop execution when parameter binding fails.
bindParameter() discards every binding result. If SQLite rejects a text or blob with SQLITE_TOOBIG, the parameter remains unbound and therefore evaluates to NULL. query() still executes the statement and can report success. (sqlite.org)
The document UPDATE in src/projectrecovery/internal/projectrepairer.cpp, Line 145, uses this path. Subsequent verification protects the original project, but it does not correct the false success returned by query(). (raw.githubusercontent.com)
Return the binding status from bindParameter(). On failure, preserve the error, finalize the statement, and return without calling sqlite3_step().
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Reject a project root that lacks the required version attributes.
readProjectDocument() accepts a project root without version or audacityversion. The loader rejects that root: HandleXMLTag() returns false when either attribute is missing (au3/libraries/au3-project-file-io/ProjectFileIO.cpp:1826-1837).
The inspector does not flag this case. DocumentNotReadable is set only when no project document parses. A root without the attributes still parses, so the inspector can report a healthy result. The repairer uses the same health check (src/projectrecovery/internal/projectrepairer.cpp:91). The recovered output can then appear healthy even though Audacity cannot open it.
The condition needs a damaged document whose project root lost these attributes. That damage is uncommon, so the impact is narrow.
This check matches the loader's presence test. summarize() then reports "the document has no project element" for this case, which is misleading. Give this case its own error text.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Data Integrity & Integration · Quick win
Do not delete an output that this repair did not create.
Two repair calls can pass the existence checks before either creates output. If one call creates the output and the other then fails in copyToOutput()—including during working-copy preparation—this branch deletes the first call's database and sidecars. The asynchronous service does not serialize repair calls by output path. (raw.githubusercontent.com)
Use per-call staging and publish without replacement. Limit failure cleanup to files owned by that call.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Make the copied output writable before it is edited.
copyToOutput copies the working copy with fileSystem()->copy. Muse's implementation calls QFile::copy without a permission argument. Qt then keeps the source's read-only bit on the output. If the source project is read-only, the output is read-only too. silenceMissingBlocks then fails to update the document. repair deletes the output and returns an error, so the repair cannot succeed for that project.
Set owner-write permission on output after the copy succeeds and before silenceMissingBlocks runs. Use the permission call that the file system abstraction supports. Do not make the original file writable.
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
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.
Resolves: #12414
Adds project recovery tool that allows users to recover a corrupted project. This PR adds the infrastructure, ui and first recovery method which replaces the missing audio data with silence.
Recommended: