guardian icon indicating copy to clipboard operation
guardian copied to clipboard

Incorrect status code for duplicate email on registration, using 500.

Open mattsmithies opened this issue 1 year ago • 0 comments

Problem description

Using the API, when you attempt to register a new account with a username that has already been used, and the validation passes, the server throws a 500 error, indicating a server crash, this is incorrect.

Step to reproduce

Steps to reproduce the behavior:

  1. API register new user that duplicates a present user.

Expected behavior

The server should not crash, nor provide an exception, status code should be 409 rather then 500 as the username is a state in the system that already exists.

Screenshots

Screenshot 2024-04-05 at 16 09 28

mattsmithies avatar Apr 05 '24 15:04 mattsmithies

Thanks @mshakeg we'll take a look. As usual if it's a simple change on the command line it's just a case of scheduling the work or approving a PR of your own. Some of these items are likely consensus node changes which require much more design and coordination. Just FYI as we look into this.

Nana-EC avatar Mar 15 '23 02:03 Nana-EC

@Nana-EC all 3 of the config options listed would likely require changes to the consensus node. The last option i.e. allowUnlimitedContractSize will likely also require changes to the relay assuming the relay validates contract bytecode size to be <24KB before attempting to create the file.

mshakeg avatar Mar 15 '23 05:03 mshakeg

Hey @mshakeg , The team looked into this and as we discussed earlier on it does seem this requires consensus node changes and in other places relies on Hardhats ability to inform the modification. This isn't something we're able to explore further at this time.

However, we'll look to revisit once the modularized hedera services is completed. There may some potential options in that case.

Nana-EC avatar Jul 27 '23 16:07 Nana-EC

Additionally, we're going to check to see if any of these items directly map to current node configs. If so developers can be unblocked by configuring their local properties to set these items ahead of running hardhat tests

Nana-EC avatar Jul 27 '23 16:07 Nana-EC