Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Cannot use v11 login method -- "One or more Aliases claimed by another User" #1100

Closed
bmulholland opened this issue Aug 22, 2023 · 2 comments

Comments

@bmulholland
Copy link

bmulholland commented Aug 22, 2023

What happened?

The SDK docs clearly say that login will create or find a user by that ID. Trying it the first time works, but after that the identify endpoint always returns an error "One or more Aliases claimed by another User"

What browsers are you seeing the problem on?

Firefox, Chrome (Chromium)

What operating system are you running?

latest macos

Steps to reproduce?

OneSignal.login(externalid)

Logout

OneSignal.login(externalid)

What did you expect to happen?

No error

Relevant log output

No response

@jkasten2
Copy link
Member

jkasten2 commented Aug 23, 2023

Thanks for reporting. I was able to reproduce the error showing in the JS console, but it does get handled correctly. The push subscription is transferred to the logged in User and future operations work correctly.

Here is the logging set to trace with OneSignal.Debug.setLogLevel('trace'); with the full log.

OneSignalSDK.page.es6.js?v=160001:10533     PATCH https://onesignal.com/api/v1/apps/a3268fe7-cc94-4f25-ab09-867b957d7fe2/users/by/onesignal_id/9a2a831c-96b5-490f-b328-94118f56888b/identity 409
OneSignalSDK.page.es6.js?v=160001:6880 identifyUser failed: externalId already exists. Attempting to transfer push subscription...
OneSignalSDK.page.es6.js?v=160001:6886 transfer Subscription succeeded

We definitely shouldn't be showing that as an error though, as it is very misleading, so we will get that cleaned up in a future release.

It seems a non-successful HTTP response is printed to the JS console on browsers' directly, and there isn't a way it can be suppressed from JS.
https://stackoverflow.com/a/42986081

I believe the best we can do here is to use console.error to point out the above HTTP 409 is expected and the error can be ignored safely.

@jkasten2
Copy link
Member

We have added the logging to point out the 409 is expected so this isn't a misleading message in our 160002 release.

I am not able to reproduce an issue here, the subscription is transferring and confirmed it show correctly on the OneSignal dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants