StanfordSpezi / SpeziScheduler

Scheduler Module for the Stanford Spezi Ecosystem
https://swiftpackageindex.com/StanfordSpezi/SpeziScheduler/documentation/
MIT License
3 stars 3 forks source link

New Spezi Standard Implementation #24

Closed niallkehoe closed 11 months ago

niallkehoe commented 11 months ago

New Spezi Standard Implementation

:recycle: Current situation & Problem

Currently, the SpeziScheduler module lacks support for the new Spezi Standard released in Spezi 0.7.0 This PR implements the improvements mentioned in [https://github.com/https://github.com/StanfordSpezi/Spezi/pull/73](Pull 73)

:bulb: Proposed solution

Update the codebase to the newest Spezi 0.7.0

:gear: Release Notes

This feature will allow for greater flexibility when using Spezi Questionnaire.

/// an example Standard used for the configuration.
actor ExampleStandard: Standard, ObservableObjectProvider, ObservableObject { }

Related PRs

See [https://github.com/https://github.com/StanfordSpezi/Spezi/pull/73](Pull 73) in Spezi for details

Testing

Passes all tests

Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

vishnuravi commented 11 months ago

Nice work @niallkehoe!

niallkehoe commented 11 months ago

@PSchmiedmayer Interesting that this fails the tests on the Github Action but passes all tests on my machine. Any ideas? TestAppUITests.testSchedulerBackgroundNotifications() TestAppUITests.testSchedulerNotifications() TestAppUITests.testSchedulerNotificationsBeforePermissions()

PSchmiedmayer commented 11 months ago

@niallkehoe I have taken a look at the testing issues and it seems like this is related to a runtime crash due to some async overloads of the UNUserNotificationCenterDelegate protocol.

I could reproduce the crashes in the UI tests using Xcode 15 and using an iOS 17 simulator.

I have moved the code to the completion-based version of the methods in this commit: https://github.com/StanfordSpezi/SpeziScheduler/pull/24/commits/aa271b81bceaf831ab060c8f00b794edb9245f75

codecov[bot] commented 11 months ago

Codecov Report

Merging #24 (aa271b8) into main (8688e48) will increase coverage by 0.44%. Report is 1 commits behind head on main. The diff coverage is 100.00%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/StanfordSpezi/SpeziScheduler/pull/24/graphs/tree.svg?width=650&height=150&src=pr&token=0VQNE0E1Wp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi)](https://app.codecov.io/gh/StanfordSpezi/SpeziScheduler/pull/24?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) ```diff @@ Coverage Diff @@ ## main #24 +/- ## ========================================== + Coverage 90.50% 90.93% +0.44% ========================================== Files 5 5 Lines 442 452 +10 ========================================== + Hits 400 411 +11 + Misses 42 41 -1 ``` | [Files Changed](https://app.codecov.io/gh/StanfordSpezi/SpeziScheduler/pull/24?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) | Coverage Δ | | |---|---|---| | [Sources/SpeziScheduler/Scheduler.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziScheduler/pull/24?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aVNjaGVkdWxlci9TY2hlZHVsZXIuc3dpZnQ=) | `90.75% <100.00%> (+1.97%)` | :arrow_up: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/StanfordSpezi/SpeziScheduler/pull/24?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/StanfordSpezi/SpeziScheduler/pull/24?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). Last update [5bb5e67...aa271b8](https://app.codecov.io/gh/StanfordSpezi/SpeziScheduler/pull/24?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi).