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]: subscription id is never set #973

Closed
2 of 3 tasks
EinfachHans opened this issue Feb 11, 2024 · 1 comment
Closed
2 of 3 tasks

[Bug]: subscription id is never set #973

EinfachHans opened this issue Feb 11, 2024 · 1 comment

Comments

@EinfachHans
Copy link

EinfachHans commented Feb 11, 2024

What happened?

Hey there,

i'm currently implementing OneSignal in an android app using Capacitor and this plugin. I have some weird things going on, that i want to report. I have not tested iOS yet, only android so far.

To understand my setup: When a user login into my app, i send the subscription id to the backend and associate with the current session. If the session is destroyed (for example after it expires) i want to "logout" the subscription from the user as well. I'm doing this, by creating a new user via the rest api and include the subscription in my payload. This is working fine so war, but seems to make problems on the device afterwards:

  1. User opens the app - OneSignal Id is available
  2. User logs in, i call .login(...) frontend side and the subscription is correctly associated to my external id
  3. User closes the app
  4. I transfer the subscription to a new user via rest api

Until here everything works as suggested. The dashboard still shows the subscription, but without external id and different onesignal id.

  1. User opens the app again
  2. App opens, subscription id is defined
  3. App tries to load the user, fails, because the session has been destroyed and calls .logout of the sdk

Here still everything is correct. The subscription exists in the dashboard, without externalId (probably it was assigned for a short time, but then removed logout was called?)

  1. User restarts the app
  2. No Subscription id is available. I read [question]: Subscription ID always return as undefined. How do I get my subscription ID? #918 and added a loop. After 20 minutes there is still no subscription id available.
  3. BUT in the onesignal dashboard the subscription id now has the external id set again

So there are two problems:

  1. The subscription id is always undefined and never set
  2. The subscription is assigned to the external user id again

Steps to reproduce?

Described above. Let me know if you need more information.

What did you expect to happen?

In this scenario i would expect the subscription id to be defined (same as before or new one - idk). Also the subscription id should not be assigned to the external user id.

OneSignal Cordova SDK version

5.0.5

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

My log seems to be too long for github. I uploaded it for you:

https://github.com/OneSignal/OneSignal-Cordova-SDK/files/14232848/onesignal-issue-logs.txt

I removed my app id from the logs, if you need it and it is safe to share - let me know

Code of Conduct

  • I agree to follow this project's Code of Conduct
@EinfachHans
Copy link
Author

Looks like i cant reproduce it in 5.1.0

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

1 participant