Skip to content

Commit 8c28fba

Browse files
committed
No need to hydrate identity model twice
* I noticed we were always hydrating the same identity model twice. * This is because we are parsing a fetch user response, we end up hydrating the identity model twice, unnecessarily, which drives caching it twice as well. * We already hydrate the identity model attached to the request. * Here, we were hydrating it again if the current user is the same. However, if the current user is the same, the model is the same and has already been hydrated.
1 parent 8cdf446 commit 8c28fba

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

iOS_SDK/OneSignalSDK/OneSignalUser/Source/Executors/OSUserExecutor.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,6 @@ extension OSUserExecutor {
520520
return
521521
}
522522

523-
if let identityObject = parseIdentityObjectResponse(response) {
524-
OneSignalUserManagerImpl.sharedInstance.user.identityModel.hydrate(identityObject)
525-
}
526-
527523
if let propertiesObject = parsePropertiesObjectResponse(response) {
528524
OneSignalUserManagerImpl.sharedInstance.user.propertiesModel.hydrate(propertiesObject)
529525
}

0 commit comments

Comments
 (0)