hiivan / pe

0 stars 0 forks source link

App should detect corrupted data file when a duplicate field is added to the JSON file #1

Open hiivan opened 5 months ago

hiivan commented 5 months ago

Description By adding an additional duplicate field into the JSON data file, the program does not clear its contents as described in the DG for when the data file format is invalid, since in the DG it states that: "Expected: AssetBook will detect that the data file is corrupted, warn the user that the data file could not be loaded and that entering a command would reset it, and start with an empty list." (Page 30) Also in the UG it states that: "If the JSON file is invalid, a warning message will be shown when AssetBook is launched." (page 27). However, when a duplicate field was added into the JSON file, there was no warning message.

Unable to detect tampering/corruption of data file.

Steps to reproduce

Expected behaviour

Actual behaviour

Potential solution Note this discrepancy into the user guide / developer guide's planned enhancements.

Screenshots

image.png

image.png

image.png

nus-se-bot commented 5 months ago

Team's Response

Thank you for the detailed bug report. In this case, the json file is valid (i.e., not corrupted), and was read and processed by AssetBook successfully. This is the expected behaviour. Furthermore, we have mentioned in the UG that this feature is only for advanced users and it is the user's responsibility to ensure that their edits are valid.

image.png

If the json file were not valid, AssetBook would have been unable to read it and not have displayed the list of contacts. Furthermore, our level of implementation for handling manual edits is already higher than that of AB3, as mentioned in the course website.

image.png

We recognize that it may be useful to detect such edge cases (e.g., duplicate fields in the json file), but this is less important than other features delivered in v1.4. However, we may consider this in future development (hence response.NotInScope).

Items for the Tester to Verify

:question: Issue response

Team chose [response.NotInScope]

Reason for disagreement: [replace this with your explanation]