Lombiq / Lombiq-Orchard-Visual-Studio-Extension

Visual Studio extension to help our work at Lombiq (https://lombiq.com/), mainly with Orchard Core (and Orchard CMS) development.
13 stars 7 forks source link

Avoid crashing during shutdown of the package #31

Closed davkean closed 1 year ago

davkean commented 1 year ago

SwitchToMainThreadAsync throws OperationCancelledException if the specified cancellation token is signalled. This crashes Visual Studio if timer fires during Visual studio shutdown.

This has had 210 crashes in past 21 days.

davkean commented 1 year ago

Diff is much easier to read if you hide whitespace changes: image

davkean commented 1 year ago

Sorry to bother you @Piedone could I get a review on this and get this merged in?

Piedone commented 1 year ago

Thank you for your valuable contribution!

Sorry for not replying earlier; the Create Jira issues for community activities workflow should've run and thus notified us about you opening this PR, I don't know why this didn't happen. The build didn't run for your code either, and while that should require an approval, there's no option to approve here... It seems something got messed up by GitHub Actions for this PR. This is the reason the code analyzers didn't tell you what I just did with my small remark.

Once you apply the code suggestion, please re-request review. Hopefully, the commit will now trigger the build workflow.

Piedone commented 1 year ago

And yes, now it worked! Running the build now.

BTW do you use our extension for some tests in the VS team, or did you find this bug during your private work?

davkean commented 1 year ago

Our telemetry data captured this crash, and I just investigated it. Thanks for getting on this.

Piedone commented 1 year ago

I see, awesome! I don't think we'd have noticed this issue otherwise.

I'll do a release now too.