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]: after calling PushSubscription.optIn() the change event is fired twice (160001) #1089

Open
lmeurs opened this issue Aug 18, 2023 · 2 comments

Comments

@lmeurs
Copy link

lmeurs commented Aug 18, 2023

What happened?

On button click we call OneSignal.User.PushSubscription.optIn(), after that the OneSignal.User.PushSubscription change event is fired twice:

  1. The first time current.id and current.token only have changed from undefined to null
  2. Shortly after this the event is fired again, now both current.id and current.token have expected values

Since the first time the event is fired no actual changes were made, I expect this to be an error.

image

What browsers are you seeing the problem on?

Chrome (Chromium)

What operating system are you running?

W11

Steps to reproduce?

1. Clear site's data and permissions
2. Call `OneSignal.User.PushSubscription.optIn();`

What did you expect to happen?

I expected the event to only be fired once

Relevant log output

See screenshot attached
@lmeurs lmeurs changed the title [Bug]: after PushSubscription _optIn_ the _change_ event is fired twice (160001) [Bug]: after calling PushSubscription.optIn() the change event is fired twice (160001) Aug 18, 2023
@jkasten2
Copy link
Member

@lmeurs Thanks for reporting!

We have reproduce this one and are working on a fix.

@lmeurs
Copy link
Author

lmeurs commented Aug 29, 2023

Hi @jkasten2, thank you for confirming the issue! Do you have an update for us? Can you give an estimate when this will be picked up / fixed?

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

No branches or pull requests

2 participants