-
Notifications
You must be signed in to change notification settings - Fork 84
SDK-108 Route registerToken through OfflineRequestProcessor for network-failure retry #1068
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
556b3cd
SDK-108 Route registerToken through OfflineRequestProcessor for netwo…
sumeruchat fb361ff
SDK-108 Snapshot identity at register call time
sumeruchat eed546e
SDK-108 Simplify register identity capture per review
sumeruchat 86ac36e
Merge remote-tracking branch 'origin/master' into fix/SDK-108-registe…
sumeruchat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On master, register went straight to OnlineRequestProcessor and built the body synchronously after isNotificationsEnabled, so setCurrentUser read auth essentially at call time. After this PR, the build runs inside sendUsingRequestProcessor's deferred closure (after canSchedule() + a queue hop), and createRegisterTokenRequest still reads live authProvider.auth rather than a captured UserIdentitySnapshot like disableDeviceForCurrentUser does. Intentional, or should register mirror the SDK-297 snapshot pattern?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mirrored the snapshot pattern in fb361ff.
registernow capturesUserIdentitySnapshotat call time (before the async notification hop) and threads it intocreateRegisterTokenRequest, same asdisableDeviceForCurrentUser. Tests cover offline-replay and online-fallback keeping the call-time identity. 36/0.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional UserIdentitySnapshot? on six signatures + a forked branch in RequestCreator feels heavy for a race that only exists in RequestHandler.register's async hop. The disableDevice symmetry is also partial, those tasks survive handleLogout(), register doesn't. Can we fix it where the gap actually is instead of threading a parameter through every layer below it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplified in eed546e. Dropped the cross-layer snapshot threading: capture call-time auth once in
register, carry it onRegisterTokenInfo.auth, andRequestCreatorresolves it through the existing single body path.ApiClient, both processors, and the protocol no longer carry the param. You were right onhandleLogout, register tasks are purged on logout (only disableDevice is preserved), so the full symmetry was not needed. Kept a small identity guard inregisterbecause dropping it regressesonFailureon the offline no-user path. 36/0.