OneSignal-Website-SDK icon indicating copy to clipboard operation
OneSignal-Website-SDK copied to clipboard

[Bug]: after calling PushSubscription.optIn() the change event is fired twice (160001)

Open lmeurs opened this issue 2 years ago • 2 comments

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 avatar Aug 18 '23 09:08 lmeurs

@lmeurs Thanks for reporting!

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

jkasten2 avatar Aug 18 '23 18:08 jkasten2

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?

lmeurs avatar Aug 29 '23 09:08 lmeurs