-
Notifications
You must be signed in to change notification settings - Fork 371
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
Make use of ryw_delay
to minimize retries on IAM fetch
#2207
Merged
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
rgomezp
force-pushed
the
ryw-follow-up
branch
3 times, most recently
from
October 25, 2024 17:13
c71182e
to
bb4a0b7
Compare
jkasten2
requested changes
Oct 28, 2024
...al/core/src/main/java/com/onesignal/user/internal/backend/impl/SubscriptionBackendService.kt
Outdated
Show resolved
Hide resolved
OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/consistency/models/ICondition.kt
Outdated
Show resolved
Hide resolved
...al/core/src/main/java/com/onesignal/user/internal/backend/impl/SubscriptionBackendService.kt
Outdated
Show resolved
Hide resolved
...al/core/src/main/java/com/onesignal/user/internal/backend/impl/SubscriptionBackendService.kt
Outdated
Show resolved
Hide resolved
.../onesignal/core/src/main/java/com/onesignal/user/internal/backend/impl/UserBackendService.kt
Outdated
Show resolved
Hide resolved
OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/consistency/RywData.kt
Outdated
Show resolved
Hide resolved
...lSDK/onesignal/core/src/main/java/com/onesignal/common/consistency/IamFetchReadyCondition.kt
Show resolved
Hide resolved
rgomezp
force-pushed
the
ryw-follow-up
branch
from
October 30, 2024 19:47
4c60fbd
to
f6e4a90
Compare
jkasten2
requested changes
Oct 30, 2024
...al/core/src/main/java/com/onesignal/user/internal/backend/impl/SubscriptionBackendService.kt
Outdated
Show resolved
Hide resolved
...al/core/src/main/java/com/onesignal/user/internal/backend/impl/SubscriptionBackendService.kt
Outdated
Show resolved
Hide resolved
...al/core/src/main/java/com/onesignal/user/internal/backend/impl/SubscriptionBackendService.kt
Outdated
Show resolved
Hide resolved
...al/core/src/main/java/com/onesignal/user/internal/backend/impl/SubscriptionBackendService.kt
Outdated
Show resolved
Hide resolved
.../onesignal/core/src/main/java/com/onesignal/user/internal/backend/impl/UserBackendService.kt
Outdated
Show resolved
Hide resolved
.../onesignal/core/src/main/java/com/onesignal/user/internal/backend/impl/UserBackendService.kt
Outdated
Show resolved
Hide resolved
.../java/com/onesignal/user/internal/operations/impl/executors/SubscriptionOperationExecutor.kt
Outdated
Show resolved
Hide resolved
.../java/com/onesignal/user/internal/operations/impl/executors/SubscriptionOperationExecutor.kt
Outdated
Show resolved
Hide resolved
...in/java/com/onesignal/user/internal/operations/impl/executors/UpdateUserOperationExecutor.kt
Outdated
Show resolved
Hide resolved
rgomezp
force-pushed
the
ryw-follow-up
branch
from
October 30, 2024 23:04
bafb8d9
to
ec5e3dd
Compare
jkasten2
approved these changes
Oct 30, 2024
Motivation: we need to keep the two values together in order to know how much to delay by (based on what rywToken is newest)
Motivation: it's unclear from the previous method name that we are expecting something to be returned.
Motivation: make use of the new object to pull out the `rywDelay` value & delay by that amount. By doing so we help minimize the number of retries that will hit the backend.
Motivation: update all usages of `rywToken` to now make use of the new `RywData` object. In `ConsistencyManager` we also renamed the method `setRywToken` to `setRywData`
Motivation: we switched to return a RywData object so method name didn't make sense any more
Motivation: add clarity on why the method maxOrNull (which uses lexicographic evaulation for strings) works for this use case.
Motivation: rywData shouldn't be considered a valid rywData object if rywToken is undefined. We update usage across the board to account for this type change.
rgomezp
force-pushed
the
ryw-follow-up
branch
from
October 31, 2024 16:09
ec5e3dd
to
7149908
Compare
Merged
This was referenced Nov 5, 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
One Line Summary
Encapsulate
rywToken
andrywDelay
into aRywData
class and update usage throughout the codebase including delaying IAM fetch by the specified delay.Details
Motivation
This update introduces the RywData class to group
rywToken
andrywDelay
into a single data object. This ensures both values are handled together, allowing for accurate delay management based on the most recentrywToken
.Along with
ryw_token
,ryw_delay
is returned by user & subscription create & update endpoints. It essentially says "this is about when we expect the change will be ready". The goal is to minimize retries.Scope
rywToken
andrywDelay
into the newRywData
class to centralize their usage.String
(rywToken
) are replaced with the newRywData
object.setRywToken
method tosetRywData
to reflect this change.rywDelay
value fromRywData
. A fallback mechanism ensures minimal retries to the backend.Testing
Unit testing
Tests were updated & passed.
Manual testing
Tested accurate segment membership calculation & display of IAMs. e.g:
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is