Hi Tibor, (cannot @ mention you), return await
is not redundant, and removing await
causes undesired side-effects, and in many cases, broken code. I am linking some examples, but in short: not awaiting breaks stack traces, try-catch and try-finally blocks.
So I think the rule is actually harmful, I see more and more people breaking otherwise perfectly fine code by “optimizing” (removing) the await
, and some of them were pointing to this particular sonar rule. Would it be possible to remove the rule, or at least deprecate it and extend the documentation to have a big warning about try-catch and try-finally blocks?
Examples:
Cross-references, similar threads: