Skip to content

Defer toast dismissal to avoid destroying Progress during callback - #210

Merged
kryksyh merged 1 commit into
musescore:mainfrom
embarc-gabriel:avoid-crash-on-toast-progress-callback
Aug 11, 2026
Merged

Defer toast dismissal to avoid destroying Progress during callback#210
kryksyh merged 1 commit into
musescore:mainfrom
embarc-gabriel:avoid-crash-on-toast-progress-callback

Conversation

@embarc-gabriel

Copy link
Copy Markdown
Contributor

Dismissing a toast from inside a Progress channel callback erased the ToastItem.
If this item is the last owner of the Progress it would destroying the channel during the callback.
Post the dismissal via Async::call

Resolves: #NNNNN

  • I signed the CLA as username:
  • The title of the PR describes the problem it addresses.
  • Each commit's message describes its purpose and effects, and references the issue it resolves. If changes are extensive, there is a sequence of easily reviewable commits.
  • The code in the PR follows the coding rules.
  • I understand all aspects of the code I'm contributing and I'm able to explain it if requested.
  • The code compiles and runs on my machine, preferably after each commit individually. I have manually tested and verified that my changes fulfil their intended purpose.
  • No prior attempts to resolve this problem exist, or if they do, I listed them in my PR description and described how I avoided repeating past mistakes.
  • There are no unnecessary changes.
  • I created a unit test or vtest to verify the changes I made (if applicable).

Build configuration

audacity: audacity/audacity/master
audacity platforms: linux_x64
musescore: musescore/MuseScore/main
musescore platforms: linux_x64

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6ad9f7cd-c88e-4511-a8f5-dc68c62d2345

📥 Commits

Reviewing files that changed from the base of the PR and between 476d928 and 727fd18.

📒 Files selected for processing (1)
  • framework/toast/internal/toastprovider.cpp

📝 Walkthrough

Walkthrough

The toast provider now includes the async utility header. When progress reaches 100% or the finished signal is emitted, the provider schedules toast dismissal through async::Async::call instead of dismissing the toast synchronously.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states that toast dismissal is deferred to prevent Progress destruction during a callback.
Description check ✅ Passed The description explains the issue, motivation, implementation, checklist status, and build configuration, but retains the placeholder issue number.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@kryksyh
kryksyh merged commit ad5cc93 into musescore:main Aug 11, 2026
3 checks passed
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.

3 participants