nus-cs2103-AY2425S1 / pe-dev-response

0 stars 0 forks source link

Editing a person's role leaves leftover links in the other party's data #1112

Open nus-pe-bot opened 1 week ago

nus-pe-bot commented 1 week ago

Description:

The user guide states that editing a person's role causes existing links to be deleted, and presents a workaround for it:

Screenshot 2024-11-15 161500.png

However, when a person's role is edited, the link will still exist in the other party's data. For example, if there is a link between Alice and Bob, editing Alice's role will only remove the link in Alice's data. Bob's data will still display Alice's NRIC under patients/caregivers.

This is problematic as there is no way to unlink Alice from Bob's data. Using deletelink will display that the link does not exist.

Steps to reproduce:

Enter the following commands:

add n/Alex Y nric/S6283947C p/88888888 e/Alex@example.com a/311, Clementi Ave 2, #02-25 t/backPain t/diabetic role/patient
add n/Bernice nric/S6382947A p/98765432 e/bernice@example.com a/311, Clementi Ave 2, #02-25 t/backPain t/diabetic role/caregiver
link patient/S6283947C caregiver/S6382947A
edit S6283947C role/caregiver
deletelink patient/S6283947C caregiver/S6382947A

The deletelink command will output the following error message:

This link does not exist in CareLink

However, running find n/Bernice will still display the NRIC of Alex under her patients. There is no way to delete this link to Alex in Bernice's data.


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

lavanyagarg112 commented 1 week ago

Team's Response

The team would like to reject this bug due to the following reasons:

  1. The tester has attempted to run deletelink with patient prefix for S6283947C, after changing S6283947C's role to caregiver. As such, running deletelink patient/S6283947C caregiver/S6382947A seems unreasonable.

  2. We have stated under planned enhancements explicitly that we plan on fixing this same issue. The edit command currently deletes that person's existing links, as stated below. As such executing deletelink will naturally give an error that the link does not exist.

As mentioned in the workaround, this can be fixed by relinking the patient and the caregiver, assuming the role of the patient is not changed.

add n/Alex Y nric/S6283947C p/88888888 e/Alex@example.com a/311, Clementi Ave 2, #02-25 t/backPain t/diabetic role/patient
add n/Bernice nric/S6382947A p/98765432 e/bernice@example.com a/311, Clementi Ave 2, #02-25 t/backPain t/diabetic role/caregiver
link patient/S6283947C caregiver/S6382947A
edit S6283947C n/David
link patient/S6283947C caregiver/S6382947A

this executes successfully.

Changing the role to that of caregiver (as done by the tester), will naturally not allow to link between 2 caregivers.

Additionally, below is the screenshot from the planned enhancements section which addresses the above issues:

image.png

Duplicate status (if any):

--