MiloTruck / pe

0 stars 0 forks source link

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

Open MiloTruck opened 1 week ago

MiloTruck 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.

nus-pe-script commented 4 days ago

[IMPORTANT!: Please do not edit or reply to this comment using the GitHub UI. You can respond to it using CATcher during the next phase of the PE]

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

Items for the Tester to Verify

:question: Issue response

Team chose [response.Rejected]

Reason for disagreement: [replace this with your reason]