[Technical Questions] Exception in a random thread after sending local notification #150
Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
-
I think the issue might be related to your delegate here: https://github.com/CS342/2025-NeutroFeverGuard/pull/30/files#diff-67157db90c025c91e9b6504b9d0eda7bf9848c7fae501328262a25c255305464R12. You will need to create a Spezi |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In what area do you have a technical challenge?
Swift
Description
Every time new data is added to HealthKit, I check the fever and lab values. If certain conditions are met, I send a local notification (trigger: nil) and display it as a banner when the app is in the foreground. Everything works fine up until the local notification is received. However, immediately after receiving the notification, Xcode/Simulator throws an exception in a thread. I suspect the issue is related to my design and how I handle actors, but I haven’t been able to pinpoint or resolve it.
Reproduction
If you review this PR, you can check out my code. Take a look at NotificationManager, NeutroFeverGuardStandard, FeverMonitoring, and LabResultsManager.
When you build and run the app (with local firebase running), triggering the notification condition (ANC < 500, fever > 101.4), you'll see the notification appear and then encounter the error. (Apologies, I don’t have a formal test case for this yet.)
Expected behavior
Receiving notifications seamlessly and continuing normal operations without any thread exceptions.
Additional context
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions