jiakai-17 / pe

0 stars 0 forks source link

app: Data is not discarded when JSON file is invalid #8

Open jiakai-17 opened 11 months ago

jiakai-17 commented 11 months ago

app: Data is not discarded when JSON file is invalid

Affected Component(s)

[x] Application [x] User Guide [ ] Developer Guide

Description

UG states that data is discarded when the JSON file is invalid and will start with empty data file. However, the data file is not emptied.

Steps to reproduce

  1. make invalid JSON file
  2. relaunch the app
  3. observe that invalid data is retained in JSON file

Command(s) entered:

Expected behavior

According to UG, the data file should be empty

Actual behavior

Data file contains the invalid JSOn data

Screenshots, if any

image.png

Additional context / Potentially problematic behavior / Improvements

[x] I have checked that this has not been addressed in the Planned Enhancements of the Developer Guide.

Reason for choosing severity level:

nus-pe-script commented 11 months ago

Team's Response

This behaviour is intended, but was wrongly documented in the UG. The team thought it would be better for the data to be retained until a successful command is ran. This allows the user to make edits to the data file to rectify invalid data, after the user sees the empty data file with TEMP being loaded and are made aware of the invalid data. This gives them a chance to rectify the data before all is lost.

The UG currently says that "TAvigator will discard all data and start with an empty data file at the next run, containing an address book called “TEMP", but should have said "TAvigator will start with an empty data file at the next run containing an address book called “TEMP” and discard all original data after running any successful command".

Hence, we have accepted it as a Documentation Bug, rather than a Functionality Bug.

Items for the Tester to Verify

:question: Issue type

Team chose [type.DocumentationBug] Originally [type.FunctionalityBug]

Reason for disagreement: [replace this with your explanation]