pusher / push-notifications-web

Beams Browser notifications
MIT License
39 stars 20 forks source link

Fix race condition in DeviceStateStore #15

Closed jonathanlloyd closed 5 years ago

jonathanlloyd commented 5 years ago

The onSuccess method was not returning the promise from .clear on line 26: https://github.com/pusher/push-notifications-web/pull/15/files#diff-8160ad4db965670fc8045a32fe2b7a71L26 This meant that resolve could be called before the state was cleared

jonathanlloyd commented 5 years ago

I don't understand the race condition. It seems like you just define the onerror later.

Can you update the PR description to explain what the problem was?

Done