Hey @Jacob H Racheal from the support engineer team here
I’m sorry to hear you are running into this! Are you calling logout() right before this login or update call? I have seen previous customers run into issues by calling logout() directly before registering a user. What happens is, when the user next logs in we see them as already registered because logout never ran. If that is the case, could you test out putting some time between those two calls to see if that improves things and let me know?
@Rachael no we are not. This is upon first login to a fresh app start.
Having same issue as well.
@Racheal It looks like that if we call the loginUser method any other place aside from in the didFinishLaunchingWithOptions say within our sign in routine, we get the 400 unless we specifically logout before.
@Jacob H
Are you still running into this issue? If so, do you have error logs around this that you can share? Also have you tried updating to version 15 of the SDK? If so, are you still running into the issue?
Hello, @Jacob H
I have met this issue with one of our users on Production. Initially I’ve noticed that events and data updates are sent to a wrong account (a temporary one, which was expected to be abandoned in case of an error). Digging deeper I have found that both methods - loginUser() and updateUser() - continue returning “ERROR - RHTTP 400] - User already exists.” for that user.
Analyzing what may have caused this, and the previous answers in this thread, I assume that most probably this happens in cases when no logOut() were called on this particular device before doing loginUser(), is that true?(yet I’m unsure why updateUser() doesn’t work in this case, could be because user’s id and email don’t match).
However, I can’t expect that a graceful logout will be reliably done. Users don’t always use the “Log Out” button, their network connection not always perfect when they use it, etc.
Long story short.. is there a way to determine that a user session is still active (no graceful logout was done for an unknown reason) in order to call logOut in rare cases like these? Calling logOut on each and every app launch sounds excessive, as well as the documentation doesn’t suggest anywhere to do always call logOut before performing loginUser.
Ideally it would be cool if loginUser determined this situation and performed logOut under the hood instead of returning error. But until then we, developers, need a strategy in place to reliably cover this particular edge case.
yiOS SDK version = 16.6.2]
Similar thing happening to me with updateContact API endpoint. This error is missing from the documentation. Any idea how to fix?