-
Notifications
You must be signed in to change notification settings - Fork 116
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
[Fix] External Id hydration #1189
Open
shepherd-l
wants to merge
9
commits into
fix/operationRepoRefactor
Choose a base branch
from
fix/externalIdHydration
base: fix/operationRepoRefactor
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shepherd-l
force-pushed
the
fix/externalIdHydration
branch
5 times, most recently
from
September 9, 2024 17:14
bc29f96
to
4812749
Compare
emawby
changed the title
WIP Delay making requests to new IDs
Delay making requests to new IDs
Sep 10, 2024
shepherd-l
force-pushed
the
fix/operationRepoRefactor
branch
2 times, most recently
from
September 12, 2024 15:12
6e61697
to
7a2bcf7
Compare
jkasten2
requested changes
Sep 12, 2024
shepherd-l
force-pushed
the
fix/externalIdHydration
branch
from
September 13, 2024 16:28
4812749
to
3e8e5c6
Compare
shepherd-l
force-pushed
the
fix/operationRepoRefactor
branch
4 times, most recently
from
September 20, 2024 18:46
9992570
to
937d585
Compare
Used to keep track of creation of users and subscriptions inorder to delay operations afterwards. The delay is needed because after the server creates the user/subscription, there is a small amount of time where the data is not up to date.
Used to delay operations if the user was just created. Applied to addTag(s), removeTag(s), addAlias(es), removeAlias(es)
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. The external Id param from login() is used as the local external Id instead of the Identity Model because the Identity Model gets reset from resetModelRepoAndCache() on L89 and returns undefined.
shepherd-l
force-pushed
the
fix/externalIdHydration
branch
from
September 23, 2024 16:44
d0d39a9
to
8bb8c13
Compare
Change operationsFromCache stub to remove promise as it is not an async function and finish running timers after each test
shepherd-l
force-pushed
the
fix/externalIdHydration
branch
from
September 23, 2024 16:59
8bb8c13
to
6ec79b5
Compare
jkasten2
approved these changes
Sep 23, 2024
Update the hydrate call as well to include the local external id as the server response doesn't include it yet.
jkasten2
approved these changes
Sep 23, 2024
shepherd-l
changed the title
Delay making requests to new IDs
[Fix] external Id hydration
Sep 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
404
, delay making requests to new IDs OneSignal-iOS-SDK#1470Systems Affected
Validation
Tests
Info
Checklist
Programming Checklist
Interfaces:
Functions:
Typescript:
Other:
elem of array
syntax. PreferforEach
or usemap
context
if possible. Instead, we can pass it to function/constructor so that we don't callOneSignal.context
Screenshots
Info
Checklist
Related Tickets
This change is