Skip to content

[Bug]: One or more Aliases claimed by another UserΒ #714

@jt274

Description

@jt274

What happened?

v5.0.0 throws the error after following the migration guide and using an existing user. App uninstall/reinstall does not fix the issue. Issue did not occur on Android emulator using User1 account, but did occur on physical device using User2 account.

The docs specifically state that if the user already exists when logging in, the user will be updated. If the user does not exist, they will be created.

After throwing the error, it repeatedly retries in an infinite loop.

OneSignal.initialize('APP_ID');

await OneSignal.login('USER_ID');

await OneSignal.User.pushSubscription.optIn();

Additionally, the following error is thrown:

MissingPluginException(No implementation found for method OneSignal#optIn on channel OneSignal#pushsubscription)

Steps to reproduce?

1. Upgrade onesignal_flutter from 3.5.1 to 5.0.0 using the posted migration guide.
2. Run app as logged in user

What did you expect to happen?

User should be updated according to external_id. Any anonymous user should be merged with existing user according to external_id.

OneSignal Flutter SDK version

5.0.0

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

D/OneSignal(22407): [OpRepo] IdentityOperationExecutor(operations: [{"name":"set-alias","appId":"APP_ID","onesignalId":"ONESIGNAL_ID","label":"external_id","value":"USER_ID"}])
D/OneSignal(22407): [DefaultDispatcher-worker-2] HttpClient: PATCH apps/APP_ID/users/by/onesignal_id/ONESIGNAL_ID/identity - {"identity":{"external_id":"USER_ID"}}
D/OneSignal(22407): [DefaultDispatcher-worker-10] HttpClient: PATCH apps/APP_ID/users/by/onesignal_id/ONESIGNAL_ID/identity - FAILED STATUS: 409
W/OneSignal(22407): [DefaultDispatcher-worker-10] HttpClient: PATCH RECEIVED JSON: {"errors":[{"code":"user-2","title":"One or more Aliases claimed by another User",
D/OneSignal(22407): [DefaultDispatcher-worker-10] HttpClient: POST apps/APP_ID/users - FAILED STATUS: 500
W/OneSignal(22407): [DefaultDispatcher-worker-10] HttpClient: POST RECEIVED JSON: 
D/OneSignal(22407): [OpRepo] OperationRepo: execute response = FAIL_RETRY

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions