Open jimseah-0116 opened 2 months ago
This is a duplicate of issue #2757.
The reason why it is a duplicate is because the root of both this issue and issue 2757 is the tokenizer that parses the different prefixes. Our application is designed to ONLY split the user input using case-sensitive prefixes that are space-separated from the preceding user input text. This is so that if the previous prefix has an argument that includes the pipe symbol in its input, the application will still register it as part of the previous argument, rather than treat it as an incorrect prefix. This is a preemptive design choice that we maintained to ensure that future prefixes can use the pipe symbol as part of their argument.
Relevant methods are ArgumentTokenizer::tokenize()
and in specific findAllPrefixPositions
and findPrefixPositions
[The team marked this bug as a duplicate of the following bug]
Unable to add this
Description: Wanted to add this code "add n|John Doe p|98765432 e|johsdsdsdnd@example.com a|John street, block 123, #01-01 m|A1234567Z s|Ssdsdsd1 r|R2t|"
Although there is no space between r|R2t|, the UG didn't stated that there must be spaces between prefixes
Steps to reproduce: Enter this code add n|John Doe p|98765432 e|johsdsdsdnd@example.com a|John street, block 123, #01-01 m|A1234567Z s|Ssdsdsd1 r|R2t|
Expected: new student should be added
Actual: Error message: Reflections in the style of R1.. are accepted. The first character must be "R", followed by up to 4 digits.
Screenshots:
[original: nus-cs2103-AY2324S2/pe-interim#3474] [original labels: type.FunctionalityBug severity.Low]
[This is the team's response to the above 'original' bug]
Definitions: Before our explanation, we would like to define some key terms we will use: For an example of “add … s|S12 r|R12”
- “|”: We will refer to this as the pipe symbol.
- “r|, s|, etc.”: We will refer to these as prefixes.
- “S12, R12”: We will refer to the portion after the prefixes as arguments
Explanation: We understand that from the user perspective this might seem like the application is showing an incorrect error. However this is intended behaviour as we would want to treat the extra input as part of the studio’s argument.
Our application is designed to ONLY split the user input using the case-sensitive prefixes. This is so that if the previous prefix has an argument that includes the pipe symbol in their input, the application will still register it as part of the previous argument, rather than treat it as an incorrect prefix. This is a preemptive design choice that we maintained to ensure that future prefixes can use the pipe symbol as part of their argument rather than throw an error just because the pipe symbol is used. .
For Example: If we implemented a remarks function and wished to use “|” as part of a remark and we typed
add ….. remark| Remedial Class R| Lecture 8
to add a remark of “Remedial Class R| Lecture 8”, the app would now incorrectly throw an error when we identify the R| as part of the user input string.Considering that our application has plans to make our features more general and expand our use cases to courses beyond CS1101S, we decided that this trade off was one that we should make to handle the issue of the pipe symbol being used in arguments.
Our DG has elaborated on the parsing of user input under the “Logic” section, which would have directed any potential developer in the direction of ArgumentTokenizer if they had queries with regards to prefix parsing.
Under the UG, we have also failed to explicitly mention that prefixes are case sensitive. However, we have included a prefix table which includes every prefix that can be used, with all of the prefixes being lowercase. As such, users would very much be aware that the prefixes used should be in lowercase. We have also included examples for users to reference and modify should they encounter an error in using the application that they cannot fix and identify.
As such, we propose that this report be shifted to the domain of documentation bugs, as we are missing documentation information in both the UG and DG. We also believe that this flaw is only deserving of a “Low” tag, as once again, any misunderstandings in usage on both the developer and user side can be resolved by viewing the section on prefix parsing in the DG or looking at the examples and parameter usage provided in the UG respectively.
Additionally due to the above reasons, we also propose to change the type of this bug report to
NotInScope
.Items for the Tester to Verify
:question: Issue duplicate status
Team chose to mark this issue as a duplicate of another issue (as explained in the Team's response above)
Reason for disagreement: While the root cause of both bug reports are the same, I think these should be considered as different issues.
Looking at the other tester's input, I think it's clear that the error message was actually correct (since the reflection argument was indeed wrong and doesn't follow the specification).
My report was for a different issue, where the reflection argument WAS correct, but the prefix used was in uppercase instead. The error message to my test input definitely looks wrong and should probably mention the wrong use of prefix instead of giving an error message about the argument.
I tried using this command:
"add n|test e|test@test p|12345 a|testing s|S12 R|R12"
Expected to get an error regarding the wrong prefix used "R|" instead of "r|", however I got this error message:
Which does not address the issue. Could potentially cause some users to be stuck trying to solve the problem, by trying to fix the studio name provided, when the actual problem is in the prefix used.