optimizely / android-sdk

Android SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/android-sdk
Apache License 2.0
55 stars 39 forks source link

fix(EventRescheduler): catch exception for event service restart #446

Closed jaeopt closed 1 year ago

jaeopt commented 1 year ago

Summary

Rare exceptions (IllegalStateException: "WorkManager is not initialized properly...") when WorkManager.getInstance() is called even without any custom WorkManager configuration. It looks like a WorkManager timing issue. Those rare exceptions are gracefully handled with this fix. It's safe since event-dispatch service will be scheduled again on next events.

Test plan

Issues

jaeopt commented 1 year ago

Overall changes lgtm. Just a minor concern, that this seems like a quick but temporary fix, we might have to identify the root cause of exception instead of suppressing it. But I am approving it so this could get merged soon as possible.

A good point. We'll keep following on this issue.