weekiat-douze / pe

0 stars 0 forks source link

Edit can violate uniqueness constraint causing all data to be wiped #4

Open weekiat-douze opened 1 year ago

weekiat-douze commented 1 year ago

How to replicate

  1. add n/Alex Yeo p/98765432 e/johnd@example.com a/John street, block 123, #01-01 s/Math sch/monday st/09:30 et/11:30
  2. Copy the contact copy 7 s/Physics sch/monday st/09:30 et/11:30
  3. Edit the contact to same field edit 8 s/Math

Expectation / Description

Since there is the uniqueness constraint, it is expected that such edit will not go through. However, the edit is possible and once the application is restarted, it detected the abnormally and wiped all data. This is severe as it is easy to trigger and the large amount of data is lost

Image

Duplicates: Screenshot 2023-04-14 at 2.32.43 PM.png

Data Wiped: Screenshot 2023-04-14 at 2.33.09 PM.png

soc-pe-bot commented 1 year ago

Team's Response

Bug is produced because user edited the subject which is not allowed as stated in the ug

image.png

However, some users may not have read the ug and edited the subject where the exception was not caught so this issue still has a medium severity

Items for the Tester to Verify

:question: Issue severity

Team chose [severity.Medium] Originally [severity.High]

Reason for disagreement: Hi, thanks for the response!

If it is not allowed in the User Guide, but it can still be done then it is a Functionality Bug ("Behavior differs from the User Guide").

Editing the subject is a valid user behaviour as most users would not want to delete and add the entire entry just to change the subject, especially since edit is a provided command. Hence, for the input to not be handled it is also under Functionality Bug ("A legitimate user behaviour is not handled).

Finally, this issue should be of severity.High as it is recommended in the PE Readiness Quiz. The issue is identical as the scenario was also an edit that invalidated the data which leads to a reset. The provided reasoning: "While it might not happen to most users, it can happen to any user, and the outcome is disastrous (i.e., loss of all data)."