OneSignal / OneSignal-Website-SDK

OneSignal is a push notification service for web and mobile apps. This SDK makes it easy to integrate your website with OneSignal Push Notifications. https://onesignal.com
Other
389 stars 115 forks source link

[Fix] External Id hydration #1189

Closed shepherd-l closed 1 month ago

shepherd-l commented 2 months ago

Description

1 Line Summary

Fixes outdated external ids caused by OneSignal returning the user's previous external id in its response for user GET requests when called quickly after the user was created.

Details

The server may still be updating and can return an outdated external Id from the getUser request. Instead of waiting for the updated external Id, we can hydrate the user with the local external Id as getting a response from the server means that the login was successful.

This PR also includes: Adding a delay after creating a new user or push subscription as the OneSignal's backend can return incorrect 404 responses.

Systems Affected

Validation

Tests

Info

Checklist

Programming Checklist Interfaces:

Functions:

Typescript:

Other:

Screenshots

Info

Checklist


Related Tickets



This change is Reviewable