While testing my app with some edge cases, I stumbled on some weird behaviors regarding user registration.
I first register my users anonymously (guest users). Then they can create an account, in which case I use the
Register User block (in Codeless), and send their email, password, along with the
objectId of the guest user.
If the user tries to register with an existing email address, it produces an error, as is to be expected. However, the first time this is done, the HTTP error code is 400, and the error says
Duplicate value 'email@example.com' for column 'email', whereas all attempts thereafter come back with a 409 code, and an error message
Unable to register user with identity 'firstname.lastname@example.org'. User already exists. I was quite puzzled that the error code changes.
The strangest thing, though, is that even though the first transaction fails, the user status is changed from
ENABLED, even though the email address is not set. This means that I end up having registered users with incorrect email address identities. Plus, this hinders any subsequent attempt at registering.
I suspect the first issue has to do with the second. Is this a known or reported issue ? Could you advise as to how I could solve it ?