Skip to content

Commit 0291cfa

Browse files
committed
[nits]
* Use the existing `isCurrentUser` method * remove extraneous logging that make the logs messy
1 parent af02758 commit 0291cfa

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

iOS_SDK/OneSignalSDK/OneSignalOSCore/Source/OSEventProducer.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public class OSEventProducer<THandler>: NSObject {
3333
var subscriber: THandler?
3434

3535
public func subscribe(_ handler: THandler) {
36-
OneSignalLog.onesignalLog(.LL_VERBOSE, message: "OSEventProducer.subscribe() called with handler: \(handler)")
3736
// TODO: UM do we want to synchronize on subscribers
3837
subscriber = handler // TODO: UM style, implicit or explicit self?
3938
}

iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSUserRequests.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,6 @@ class OSUserExecutor {
191191
identityModel.hydrate(identityObject)
192192
}
193193

194-
// On success, check if the current user is the same as the one in the request
195-
// If user has changed, don't hydrate, except for push subscription
196-
let modelInStore = OneSignalUserManagerImpl.sharedInstance.identityModelStore.getModel(key: OS_IDENTITY_MODEL_KEY)
197-
198194
// TODO: Determine how to hydrate the push subscription, which is still faulty.
199195
// Hydrate by token if sub_id exists?
200196
// Problem: a user can have multiple iOS push subscription, and perhaps missing token
@@ -214,8 +210,10 @@ class OSUserExecutor {
214210
}
215211
}
216212
}
217-
218-
guard modelInStore?.modelId == identityModel.modelId else {
213+
214+
// Check if the current user is the same as the one in the request
215+
// If user has changed, don't hydrate, except for push subscription above
216+
guard OneSignalUserManagerImpl.sharedInstance.isCurrentUser(identityModel) else {
219217
return
220218
}
221219

0 commit comments

Comments
 (0)