nus-cs2103-AY2425S1 / pe-dev-response

0 stars 0 forks source link

Duplicate validation for email addresses is case sensitive #3849

Open nus-pe-bot opened 20 hours ago

nus-pe-bot commented 20 hours ago

Steps to Reproduce:

  1. (Prerequisite) Have a contact in the address book with email e.g., example@email.com, and another contact with a different email (at index 2, for example)
  2. Enter command edit 2 e/EXAMPLE@email.com

Expected Behaviour: System should reject duplicate email, as this is stated as the rule for uniqueness of persons in the system.

Actual Behaviour: System allows for the email of contact at index 2 to be changed to EXAMPLE@email.com

Screenshot of Behaviour:

Screenshot 2024-11-15 at 4.25.48 PM.png

After entering command edit 6 e/IRFAN@example.com, email for contact Roy Balakrishnan is changed to IRFAN@example.com, although contact 5 has email irfan@example.com

Explanation Uniqueness is stated in the User Guide as disallowing the same email address. In the real world, email addresses are case insensitive, so allowing a user to be edited to have the same email but with different case sensitivity to another violates the rules of uniqueness. This is quite a high severity bug, as users reading the User Guide would expect that they would be notified of the duplicate, even though it has a different case, as this is in actual fact the same email address despite the case differences; this is high in severity as this is the fundamental rule stated for uniqueness in the address book, so users would be relying on this to maintain the uniqueness of their contacts. The case sensitivity for emails is also never stated in the user guide, hence the user would likely assume this follows real-world case. This error in duplicate validation is the same for email addresses entered in the add command - however, both commands likely rely on the equals() method for the email class, so this can likely be fixed with just one change.

Screenshot 2024-11-15 at 4.26.46 PM.png


[original: nus-cs2103-AY2425S1/pe-interim#3621] [original labels: severity.Medium type.FunctionalityBug]

O-Darren commented 3 hours ago

Team's Response

Thank you for helping us find this bug, as we had overlooked that emails are case insensitive.

We do accept this as a valid bug. However, we believe that the severity is low rather than medium. As emails are case insensitive, it is unlikely that our users would be entering emails with capital letters. It is also unlikely that users would enter the same email multiple times. Hence, as this issue is unlikely to occur, and the users can continue to use our application even if it does occur, we believe that the severity should be low, similar to the bug from the quiz below.

image.png

Duplicate status (if any):

--