Skip to content

Fix crash when clicking "Repeat last effect" on a closed project - #12573

Merged
saintmatthieu merged 1 commit into
audacity:masterfrom
kryksyh:fix-repeat-effect
Oct 28, 2026
Merged

saintmatthieu merged 1 commit into
audacity:masterfrom
kryksyh:fix-repeat-effect

Conversation

@kryksyh

@kryksyh kryksyh commented Oct 23, 2026

Copy link
Copy Markdown
Member

Resolves: #12493

  • I signed CLA
  • This PR includes AI assistance
  • If the PR is AI-assisted, I have read, understood and complied with the guidelines for AI-assisted contributions
  • 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

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a27751df-fd86-4409-8034-4d81e938cf35
Commits

Reviewing files that changed from the base of the PR and between 2cbfecd and 2243abd.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
Walkthrough

The repeat-last-effect action now uses project-opened UI and shortcut contexts. Its command state requires both an open project and an available last processor. If no project is open, repeatLastProcessor returns Err::UnknownError.

Priority: Normal

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

Severity of issue fixed: Medium

Merge Risk: Moderate · previous review 2cbfe

Repeating an effect after closing a project can still crash Audacity; guard the action before stopping playback.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly identifies the main change: preventing a crash when selecting “Repeat last effect” with a closed project.
Description check Passed The description includes the linked issue and the required checklist. It does not include the template’s separate short description and motivation, but the remaining required information is present an…
Linked Issues check Passed Issue #12493 requires that the repeat-last-effect option cannot run after the project closes. The reviewed code disables the command when globalContext()->currentProject() is null. The repeat action…
Out of Scope Changes check Passed The three changed files support issue #12493. They control repeat-action visibility context, command enablement, and the no-project execution guard. No unrelated change is established by the supplied …
Full details: Description check

Explanation

The description includes the linked issue and the required checklist. It does not include the template’s separate short description and motivation, but the remaining required information is present and the description is mostly complete.

Full details: Linked Issues check

Explanation

Issue #12493 requires that the repeat-last-effect option cannot run after the project closes. The reviewed code disables the command when globalContext()->currentProject() is null. The repeat action uses UiCtxProjectOpened and CTX_PROJECT_OPENED. repeatLastProcessor() also returns Err::UnknownError before it accesses project data when no project exists. The state listener updates command states when the current project changes. No separate automated-test requirement appears in the linked issue.

Full details: Out of Scope Changes check

Explanation

The three changed files support issue #12493. They control repeat-action visibility context, command enablement, and the no-project execution guard. No unrelated change is established by the supplied change summary or the reviewed file content. The whole diff was unavailable because changed blobs were missing from the checkout, but the available evidence does not identify an out-of-scope change.

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

❤️ 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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a5e547ba-48b9-4c0f-917b-c1a5156c9117
📥 Commits

Reviewing files that changed from the base of the PR and between 414c827 and 2cbfecd.

📒 Files selected for processing: 3
  • src/effects/effects_base/internal/effectexecutionscenario.cpp
  • src/effects/effects_base/internal/effectscommandsstate.cpp
  • src/effects/effects_base/internal/effectsuiactions.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@@ -82,7 +82,7 @@ bool EffectsCommandsState::isSpectralEffect(const EffectId& effectId) const
CommandState EffectsCommandsState::commandState(const Command& command) const
{

@embarc-gabriel embarc-gabriel Oct 23, 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.

Can't we move this check to the top of the function?

if (globalContext()->currentProject() == nullptr) {
        return CommandState(false);
    }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh, no, we can't. If we do that, it would also disable Plugin Manager

@saintmatthieu
saintmatthieu merged commit 91a9cba into audacity:master Oct 28, 2026
8 of 11 checks passed
saintmatthieu added a commit that referenced this pull request Oct 28, 2026
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.

'Repeat last effect' remains accessible in the main Effect menu once the project is closed

3 participants