jacobcuison / pe

0 stars 0 forks source link

Creating duplicate contacts in the JSON file will clear all data #5

Open jacobcuison opened 9 months ago

jacobcuison commented 9 months ago

Problem

Creating duplicate contacts in the JSON data file will cause an error that clears all data in MedBook. I believe this is of High severity because clearing all patient records will be a huge inconvenience to doctors and medical admin staff.

Furthermore, it is explicitly pointed out in the DG that advanced users are expected to able to directly edit the JSON file.

image.png

Hence, MedBook should be expected to handle this situation, for example by issuing a warning to users when the app is relaunched, rather than clearing all the data.

Steps to Reproduce

  1. Type in the command: addpatient n/John Doe i/T1234567A e/johndoe@gmail.com p/12345678 g/M a/26 bt/AB+ al/Penicillin.

  2. Type in the command: addpatient n/John Doe i/T0234567A e/johndoe@gmail.com p/12345678 g/M a/26 bt/AB+ al/Penicillin (same as command in Step 1, except for NRIC field).

At this stage, MedBook should look like this:

image.png

  1. Close MedBook.

  2. Open the JSON file.

  3. Change the NRIC for the second John Doe to match the first John Doe.

image.png

  1. Relaunch MedBook.

  2. MedBook data is cleared as duplicate patients have been found.

image.png

soc-se-bot commented 9 months ago

Team's Response

image.png

According to our user guide, we have provided sufficient warnings about the danger of editing the data file manually. Furthermore, NRIC is unique in a real-world context and hence a typical user would not make such an edit to the data file and is deemed as an extreme case. In addition, users can fix this error by simply changing the NRIC back to the original NRIC. However, we acknowledge that this can be improved with an error message and hence we chose to respond with NotInScope.

Items for the Tester to Verify

:question: Issue response

Team chose [response.NotInScope]

Reason for disagreement: [replace this with your explanation]


## :question: Issue severity Team chose [`severity.Low`] Originally [`severity.High`] - [ ] I disagree **Reason for disagreement:** [replace this with your explanation]