Jaspertzx / pe

0 stars 0 forks source link

No error thrown when Json file has been incorrectly edited #4

Open Jaspertzx opened 2 months ago

Jaspertzx commented 2 months ago

Details: When editing the Json file incorrectly (apart from the InterviewDate field), the application will restart from a clear state. However no error message was prompted by the application.

Steps to reproduce:

  1. Have at least 1 interview application in the application
  2. Exit the application.
  3. Go to current application directory/data/addressbook.json
  4. Open the file in your file editor of choice
  5. Change the name to the tag to test such as "tag" : "test",
  6. Save the file
  7. Reopen the application.

Expected: An error message to indicate that the reading the JSON file has resulted in an error.

Actual: The application runs with no error message prompted and the state cleared.

Screenshots:

image.png

image.png

Rationale: This is not ideal as users are not perfect and may forget that special words in tags are not supported. Furthermore, no error message is prompted at all, causing them to be confused. Additionally, after Step 7, they may realize their mistake, and close the application to fix the Json file, in which case their JSON file is overridden permanently with an empty storage template, causing them to lose their pre-existing data forever.

image.png

nus-se-script commented 2 months ago

Team's Response

We did caution users against editing the json file wrongly as it may result in clearing the data

Screenshot 2024-04-20 at 5.23.39 PM.png

Items for the Tester to Verify

:question: Issue response

Team chose [response.Rejected]

Reason for disagreement: I believe that an error should still be thrown despite mentioning in the User Guide that this behavior will happen. This is an inherited behavior from AB3, where it will clear the stored items without any prompt or message. And this is not ideal as in this application (InternHub), some of the use cases require users to change the JSON storage file. (You may refer to InternHub's User Guide, 4.2.6 Point 3). This means that there is a higher probability for users to make the wrong edits in the storage.json file.

Silently clearing all data, and then overwriting the existing save file with the empty address book causes the user to lose all their pre-existing data due to their mistake. However, I gave this a severity of low as the User Guide mentioned to make a backup of the addressbook.json, ensuring that even if the save files are overridden, that the user's data is still preserved as long as they followed the instructions.

However, this causes minor inconveniences to the user, especially when no error is prompted at all and they have to figure out which line they edited wrongly, thus I believe that this warrants a severity of low.