We are using Community Edition Version 8.9 (build 43852)
Application is using bot framework
Sonar shows multiple instances of code smells as “Redundant use of await on a return value”. The recommendation from Sonar is not to use await as the async method is expected to use a promise.
to the best of my knowledge, these return await are indeed redundant. If you want the confirmation, you should check it with project authors. I would be curious what’s their reasoning.
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?