Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

app-help and app-exit gives an error when entering it as the first command #1

Open
halfwhole opened this issue Nov 15, 2019 · 1 comment

Comments

@halfwhole
Copy link
Owner

halfwhole commented Nov 15, 2019

How to reproduce:

  • Start the app.
  • Enter as the first command app-help or app-exit.

Result:

  • Error: Command attempted to make changes but is not a MutatorCommand

one.png

It works on subsequent tries though, but not the first one.

[EDIT: this probably works on many/all commands here on my side, so changing the severity to High.]

@halfwhole halfwhole changed the title app-help gives error when entering it as the first command app-help and app-exit gives an error when entering it as the first command Nov 15, 2019
@nus-pe-bot
Copy link

Team's Response

Accepted.

The bug only happens:

  1. When the app is first started up
  2. On the first command
  3. When that first command is a non-data-modifying command

As this is a very specific scenario (and the user will be able to continue using the application after the initial error; all subsequent command execute properly), the severity it set at medium.

This bug happens because some code attempts to sort the staged appointment book upon startup, resulting in the staged appointment book being different from the base appointment book. If a non-data-modifying command is executed as the first command, the change (sorting) is attributed to that command, and the app defensively prevents the change by reverting the staged appointments to the base appointments and producing the error message.

The bug can be fixed by modifying the code at this location: https://github.com/AY1920S1-CS2103-F10-1/main/blob/569608fee9380a1f1cdcb455bbf0af88a4f253c3/src/main/java/cs/f10/t1/nursetraverse/model/ModelManager.java#L93

Items for the Tester to Verify

❓ Issue severity

Team chose [severity.Medium].
Originally [severity.High].

  • I disagree

Reason for disagreement: [replace this with your reason]


Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants