ScheduleManager.saveSchedule - EXC_BAD_ACCESS crash#4534
ScheduleManager.saveSchedule - EXC_BAD_ACCESS crash#4534
Conversation
Prevent native EXC_BAD_ACCESS crash in ScheduleManager.saveSchedule by catching exceptions from the AwesomeNotifications plugin. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a try-catch block around the AwesomeNotifications.createNotification call to prevent a native crash on iOS. This is a good defensive measure. My review includes a suggestion to improve the error handling within the new catch block to ensure that these failures are properly logged and tracked, rather than being silently ignored in debug logs.
| } catch (e) { | ||
| Logger.debug('Failed to create notification: $e'); | ||
| } |
There was a problem hiding this comment.
While adding a try-catch block is the correct approach to prevent the app from crashing, logging the error at the debug level is insufficient for an issue that was causing a native crash. Such failures should be logged as errors to ensure they are tracked in error monitoring services like Crashlytics. This will help in monitoring the frequency of this failure and verifying that the fix is effective.
Please change the catch block to capture the stack trace and use Logger.handle to report it as a proper error.
| } catch (e) { | |
| Logger.debug('Failed to create notification: $e'); | |
| } | |
| } catch (e, s) { | |
| Logger.handle(e, s, message: 'Failed to create notification'); | |
| } |
|
closed in #4628 |
|
Hey @aaravgarg 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! 💜 |
Summary
AwesomeNotifications.createNotificationcall in try-catchEXC_BAD_ACCESScrash inScheduleManager.saveSchedule(internal AwesomeNotifications pod method)Crash Stats
Test plan
🤖 Generated with Claude Code