Skip to content

Commit baba4c1

Browse files
committed
no need to fetch user if we successfully identify user
* If the anonymous user has been identified, that means a user with that external_id did not already exist * So no further action needed, no need to fetch that user
1 parent aed0524 commit baba4c1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSUserRequests.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,8 @@ class OSUserExecutor {
209209

210210
static func executeIdentifyUserRequest(_ request: OSRequestIdentifyUser) {
211211
OneSignalClient.shared().execute(request) { _ in
212-
// the anonymous user has been identified, still need to Fetch User
213-
// TODO: Is the above true, do we need to Fetch? If the anon user is identified, then no user with this external_id existed, correct?
214-
fetchUser(aliasLabel: OS_EXTERNAL_ID, aliasId: request.aliasId, identityModel: request.identityModelToUpdate)
215-
216-
executePendingRequests() // TODO: Here or after fetch or after transfer?
217-
212+
// the anonymous user has been identified, no further action needed, no need to fetch user
213+
executePendingRequests()
218214
} onFailure: { error in
219215
// Returns 409 if any provided (label, id) pair exists on another User, so the SDK will switch to this user.
220216
if error?._code == 409 {

0 commit comments

Comments
 (0)