nus-cs2103-AY2425S1 / pe-dev-response

0 stars 0 forks source link

Delete 'Name' Command causes wrong user to be deleted when duplicates are present #8

Open nus-pe-bot opened 1 week ago

nus-pe-bot commented 1 week ago

Description:
When the delete command is used (where a Name is supplied as the parameter), and when 2 different users have the same name but are in different case ('John DoE' and 'John Doe'), the app deletes one of the users but not the other.

Steps to reproduce:

  1. Type command: add n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01
  2. Type command: add n/John DoE p/9123456 e/differentJohn@example.com a/John street, block 123, #01-01

image.png

  1. Type command: delete john doe

Expected: The system throws an error, indicating that there are 2 possible matches (when case insensitive). Ideally, the deletion is rejected, so as to prevent data lost about the wrong 'john' (i.e. the one who should not have been deleted).

Actual: The system deletes one John, while leaving the other present.

image.png

Problematic behaviour: All data about the 'wrong' John is lost, which can be very damaging to businesses.

Ways to improve:


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

engyuhan commented 1 week ago

Team's Response

Duplicate of #1322

Both bugs are caused by the same defect: improper duplicate detection with the add command. If the add command is fixed, this bug would also be fixed, since there will not be 2 different users with duplicate names anyways. Since both bugs are caused by the same defect and cannot be independently fixed, there are duplicate bugs.

Duplicate status (if any):

Duplicate of #1322