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]: Trying to logout gives error #43

Closed
vamsi-kleargroup opened this issue Sep 5, 2024 · 2 comments
Closed

[Bug]: Trying to logout gives error #43

vamsi-kleargroup opened this issue Sep 5, 2024 · 2 comments

Comments

@vamsi-kleargroup
Copy link

What happened?

As the user logs in to our web app, we are calling $oneSignal.login(userId). After that we set up a few subscriptions to email and sms channels if the user toggles in our settings section.

When the user;ogs out we call $oneSignal.logout();. This call is giving the following error
image (2)

We are using the following package version:
"@onesignal/onesignal-vue3": "^2.0.1"

What browsers are you seeing the problem on?

Chrome (Chromium)

What operating system are you running?

Windows 10

Steps to reproduce?

1. Login using `$oneSignal.login(userId)`
2. Set email subscription using `$oneSignal.User.addEmail(email);`
3. logout using `$oneSignal.logout();`

What did you expect to happen?

The logout should work

Relevant log output

Uncaught (in promise) TypeError: Cannot read OSModelStore.js:32 properties of undefined (reading 'modelId')
at Ji.subscribeUpdateListener (OSModelStore.js:32:41)
at Ji.add (OSModelStore.js:16:14)
at en.add (CoreModuleDirector.js:106:32)
at tn.<anonymous> (LoginManager.js:113:9) at Generator.next (<anonymous>)
at r (tslib.es6.js:118:58)
@jkasten2
Copy link
Member

Thanks for reporting, we are able to reproduce this issue when OneSignal.logout() is called. It happens if a push subscription has not been created yet. We will look making a fix for this scenario.

@jkasten2
Copy link
Member

jkasten2 commented Oct 9, 2024

This has been fixed in this release:
https://github.com/OneSignal/OneSignal-Website-SDK/releases/tag/160203

This update is automatic, the JS library this depends on always points the latest production WebSDK on cdn.onesignal.com.

@jkasten2 jkasten2 closed this as completed Oct 9, 2024
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