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
* Motivation: Must be careful of accessing `OneSignalUserManagerImpl.sharedInstance` before it's actually finished initializing, as the initializer for it does a lot of things!
* What was happening was that during the process of initializing the `sharedInstance`, we initialized the executors, but the executors' initializer accessed model stores via OneSignalUserManagerImpl.sharedInstance` which is a problem.
* Instead, initialize these in `start()`, but now they will be Optional.
* And we may need to note if any other areas can have the same issue.
// propertyExecutor should exist as this should be called after `start()` has been called
412
+
iflet propertyExecutor =self.propertyExecutor {
413
+
propertyExecutor.updateProperties(
414
+
propertiesDeltas: propertiesDeltas,
415
+
refreshDeviceMetadata:false,
416
+
propertiesModel: propertiesModel,
417
+
identityModel: identityModel
418
+
)
419
+
}else{
420
+
OneSignalLog.onesignalLog(.LL_ERROR, message:"OneSignalUserManagerImpl.sendPurchases with purchases: \(purchases) cannot be executed due to missing property executor.")
// propertyExecutor should exist as this should be called after `start()` has been called
468
+
iflet propertyExecutor =self.propertyExecutor {
469
+
propertyExecutor.updateProperties(
470
+
propertiesDeltas: propertiesDeltas,
471
+
refreshDeviceMetadata: refreshDeviceMetadata,
472
+
propertiesModel: propertiesModel,
473
+
identityModel: identityModel
474
+
)
475
+
}else{
476
+
OneSignalLog.onesignalLog(.LL_ERROR, message:"OneSignalUserManagerImpl.updateSession with sessionCount: \(String(describing: sessionCount)) sessionTime: \(String(describing: sessionTime)) cannot be executed due to missing property executor.")
0 commit comments