[Bug]: Unable to login to any other external id once user_subscription_limit has reached on previous external id
Opened this issue · 5 comments
What happened?
Library try to login with previous failed externaId.
What I did?
- OneSignal.login(
ExternalID
), whereExternalID
has reached user_subscription_limit - I getting
{
"errors": [
{
"code": "subscription-1",
"title": "Operation is not permitted due to user having the maximum number of subscriptions assigned",
"meta": {
"user_subscription_limit": 20
}
}
]
}
- Invoking OneSignal.logout()
- trying login with any
new ExternalId
but library don't make api calls - restarting application
- Invoking OneSignal.initWithContext and library make api calls (login) with previous
ExternalID
This loop is infinity.
Steps to reproduce?
- Login with ExternalID that has reached user_subscription_limit
- Call Logout method
- Login with any ExternalID
What did you expect to happen?
I expected the external id to update. Because it works well on iOS!
OneSignal Android SDK version
5.1.17
Android version
13
Specific Android models
No response
Relevant log output
HttpClient: Got Response = POST - STATUS: 409 - Body: {"errors":[{"code":"subscription-1","title":"Operation is not permitted due to user having the maximum number of subscriptions assigned","meta":{"user_subscription_limit":20}}]}
Code of Conduct
- I agree to follow this project's Code of Conduct
@mostfinance-ca Thanks for reaching out. Each time you uninstall and reinstall the app all data is lost for the app. The OneSignal SDK doesn't know this is the same device so a new push subscription is created.
- Also FCM gives the app a new pushToken, so even that can't be used to know it is the same device.
It unlikely a legitimate end-user would do this 20 times, however it possible it could happen. In this case you would have to clean up the older subscriptions by deleting them. This could be done via the OneSignal DELETE /subscriptions REST API if this comes up in the real world.
- If this is just a test user you could also simply delete old test subscriptions from the OneSignal dashboard.
We are looking into removing older push subscription automatically so this extra integration step won't be needed in the future.
- Why does the iOS SDK correctly call API requests, but the Android SDK does not?
- Android SDK remembers the previous
External_ID
and tries to repeat the login operation again and again. Even after restarting the application. On iOS, a NEWExternal_ID
is inserted into the request every time when I call OneSignal.login method
@mostfinance-ca sorry I misunderstood the issue you are seeing, this is bug then. Just to confirm the steps:
- Have 20 subscriptions on User with external_id = 'A'
- Call
OneSignal.login("A")
- Observer the expected
user_subscription_limit
error. - Call
OneSignal.login("B")
- BUG - Login "B" never happens, push subscription never transfers, due to the SDK continuing to try to login as "A".
@jkasten2
That's right, I confirm these steps.
Same problem!!!