New bug fix allows you to add multiple tasks without crashing
Each of the tasks can now be completed without errors, with each task's updated completion text and icon showing up.
:books: Documentation
https://github.com/StanfordSpezi/.github/blob/main/DOCUMENTATIONGUIDE.md
DETAILS:
When I try to add multiple tasks in a single day in the schedule that uses SpeziScheduler, running the app causes it to crash, with the error message "Fatal error: Duplicate keys of type 'Event' were found in a Dictionary.
This usually means either that the type violates Hashable's requirements, or
that members of such a dictionary were mutated after insertion. The template app's PICSScheduler file (our project's version of it) initially has only the single task with static var SocialSupportTask: SpeziScheduler.Task, but I modified that to include 3 tasks instead of just 1, so it now includes:
static var PHQ4Task: SpeziScheduler.Task, static var EQ5D5LTask: SpeziScheduler.Task, and static var MiniNutritionalTask: SpeziScheduler.Task
And, the final convenience init is to incorporate:
convenience init() {
self.init(tasks: [Self.PHQ4Task, Self.EQ5D5LTask, Self.MiniNutritionalTask])}
Added a new Unit Test to SpeziScheduler to check whether the two instances of Event (once when completed, and once when not completed) produce the same hash
:pencil: Code of Conduct & Contributing Guidelines
Bug Fix: SpeziScheduler multiple task app crash
:recycle: Current situation & Problem
Fixing the following issue: https://github.com/StanfordSpezi/SpeziScheduler/issues/36
:gear: Release Notes
:books: Documentation
https://github.com/StanfordSpezi/.github/blob/main/DOCUMENTATIONGUIDE.md DETAILS: When I try to add multiple tasks in a single day in the schedule that uses SpeziScheduler, running the app causes it to crash, with the error message "Fatal error: Duplicate keys of type 'Event' were found in a Dictionary. This usually means either that the type violates Hashable's requirements, or that members of such a dictionary were mutated after insertion. The template app's PICSScheduler file (our project's version of it) initially has only the single task with static var SocialSupportTask: SpeziScheduler.Task, but I modified that to include 3 tasks instead of just 1, so it now includes: static var PHQ4Task: SpeziScheduler.Task, static var EQ5D5LTask: SpeziScheduler.Task, and static var MiniNutritionalTask: SpeziScheduler.Task
And, the final convenience init is to incorporate: convenience init() { self.init(tasks: [Self.PHQ4Task, Self.EQ5D5LTask, Self.MiniNutritionalTask])}
These changes seem to have been enough to cause the error. Full details about reasoning here: https://github.com/StanfordSpezi/SpeziScheduler/issues/36
:white_check_mark: Testing
Added a new Unit Test to SpeziScheduler to check whether the two instances of Event (once when completed, and once when not completed) produce the same hash
:pencil: Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: