Umbraco-CMS icon indicating copy to clipboard operation
Umbraco-CMS copied to clipboard

Missing nullability in IUmbracoUserManager

Open patrickdemooij9 opened this issue 3 years ago • 5 comments

Which exact Umbraco version are you using? For example: 9.0.1 - don't just write v9

v10 versions

Bug summary

I was recently working with the IUmbracoUserManager and I noticed that most of the functions indicate that the result cannot be NULL. This isn't actually the case and it would be great if those could indicate that a NULL value could be present.

The ones that I can see are:

  • FindByIdAsync
  • FindByEmailAsync
  • FindByNameAsync

Specifics

No response

Steps to reproduce

Try including a null check after the result of the functions above. Visual studio will add a warning saying that the result cannot be NULL, so a null check isn't needed. Even though NULL can be returned by the function.

Expected result / actual result

Functions should change their functions to be nullable.

patrickdemooij9 avatar Aug 10 '22 11:08 patrickdemooij9

Hi there @patrickdemooij9!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

github-actions[bot] avatar Aug 10 '22 11:08 github-actions[bot]

Nicely spotted, seems like something we've overseen when doing the nullability changes.

Unfortunately, we can't really change this for V10, since it would be a breaking change, but coincidentally this is already being fixed in an unrelated PR for V11

nikolajlauridsen avatar Aug 10 '22 11:08 nikolajlauridsen

@nikolajlauridsen Ah perfect! Would it be better to close this issue then or wait till the launch of V11 in case other people stumble upon this issue?

patrickdemooij9 avatar Aug 10 '22 11:08 patrickdemooij9

That is a great question 😄, I honestly don't know 😆

What do you think @nul800sebastiaan

nikolajlauridsen avatar Aug 10 '22 12:08 nikolajlauridsen

I would close this one as fixed in v11 as soon as the related PR is merged. Then it's clear in the release notes later on as well!

nul800sebastiaan avatar Aug 10 '22 13:08 nul800sebastiaan