You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add synchronized around all access to ServiceProvider's serviceMap.
This ensures nothing can modify this map, resulting in multiple
instance of a class being return unexpectedly.
Another critical path is the call to resolve(this), where this logic
could also take enough time that could case threading issues that is
now wrapped in this new lock.
This most likely will fix the real world problem we have been seeing
where IApplicationService.appContext is null unexpectedly. One
discovered path is ReceiveReceiptWorker is created from the Android OS
on a background thread and it calls getService() without first calling
OneSignal.initWithContext, resulting in a race condition where
two instance of IApplicationService can be created.
ReceiveReceiptWorker probably should call OneSignal.initWithContext
first, but changing this is out of scope for this commit.
0 commit comments