A-MoreErrorHandling: catch duplicates, bad input - #8
Merged
Merged
Conversation
Echo would silently accept a second copy of the same task, break a deadline/event's clause detection on extra whitespace around /by, /from, /to, and let a description containing the save file's own field separator corrupt a later reload. Add Task#isDuplicateOf (case-insensitive, description + type, plus date(s) for Deadline/Event), exposed via TaskList#containsDuplicateOf and checked in Echo#addTask before adding. Make Parser's /by, /from, /to splits whitespace-tolerant (\s+ instead of a literal single space) without touching whitespace inside descriptions themselves. Reject any description containing Task.FILE_FORMAT_SEPARATOR before it reaches storage. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds duplicate-task detection, whitespace-tolerant clause parsing,
and a guard against descriptions containing the save file's field
separator.
See commit message for details.