Skip to content

Commit 005a7b6

Browse files
committed
address that missing OSID on new sessions is "OK"
* This was a todo and after thinking about it and testing, I do think this is unexpected but OK. * Any remedy to this should not be happening right here anyway
1 parent ae0ad11 commit 005a7b6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

iOS_SDK/OneSignalSDK/OneSignalUser/Source/OneSignalUserManagerImpl.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,12 @@ extension OneSignalUserManagerImpl {
549549
updateSession(sessionCount: 1, sessionTime: nil, refreshDeviceMetadata: true)
550550

551551
// Fetch the user's data if there is a onesignal_id
552-
// TODO: What if onesignal_id is missing, because we may init a user from cache but it may be missing onesignal_id. Is this ok.
553552
if let onesignalId = onesignalId {
554553
OSUserExecutor.fetchUser(aliasLabel: OS_ONESIGNAL_ID, aliasId: onesignalId, identityModel: user.identityModel, onNewSession: true)
554+
} else {
555+
// It is possible to init a user from cache who is missing the onesignalId
556+
// This can happen if any createUser or identifyUser requests are cached
557+
OneSignalLog.onesignalLog(.LL_WARN, message: "OneSignalUserManagerImpl.startNewSession() is unable to fetch user with External ID \(externalId ?? "nil") due to null OneSignal ID")
555558
}
556559
}
557560

0 commit comments

Comments
 (0)