Skip to content

Remove async await where not needed#18901

Closed
Henr1k80 wants to merge 1 commit intoumbraco:contribfrom
Henr1k80:asyncfix
Closed

Remove async await where not needed#18901
Henr1k80 wants to merge 1 commit intoumbraco:contribfrom
Henr1k80:asyncfix

Conversation

@Henr1k80
Copy link
Copy Markdown
Contributor

@Henr1k80 Henr1k80 commented Apr 1, 2025

Prerequisites

  • I have added steps to test this contribution in the description below

Description

Remove async await where not needed.

I am aware that I have changed a lot of files, and it might not make a lot of performance difference in most places, but I wanted to eliminate the horrible await Task.FromResult( from the codebase, so it is never copied again.
Many of the controller methods could be be made sync, but I supposed it would make it fail the signature change check.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2025

Hi there @Henr1k80, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@AndyButland
Copy link
Copy Markdown
Contributor

Thanks for the effort on this one @Henr1k80 but I'm afraid we've already had this covered in another PR - #16535 - that we've merged in for Umbraco 16. It could have been in 15 as it's not breaking, but we felt when reviewing it was better for the next major just so we have a longer period for a release candidate just in case something gets missed in implementation or review.

So we will be removing the await Task.FromResult constructs via that, and just live with them in the current version.

Apologies for your wasted work on this one. Do feel free in future to raise an issue suggesting a PR you'll make if you are going to spend a fair bit of time on one - as hopefully then someone will catch it before you embark on something we may not need.

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.

2 participants