-
Notifications
You must be signed in to change notification settings - Fork 368
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
Read-Your-Write Consistency #2168
Commits on Sep 26, 2024
-
ConsistencyManager interface & implementation
Manages read-your-write tokens. The manager works based on conditions & tokens. Tokens are stored in a nested map indexed by a unique id (e.g. `onesignalId`) and a token key (e.g. `USER`). This allows us to track tokens on a per-user basis (e.g. handle switching users). Conditions work by creating a blocking mechanism with customizable token retrieval until a pre-defined condition is met (e.g. at least two specific tokens are available). Also allows extensibility for future applications to control offset blocking mechanism in consistency use-cases.
Configuration menu - View commit details
-
Copy full SHA for 6e05278 - Browse repository at this point
Copy the full SHA 6e05278View commit details -
DI: register ConsistencyManager in UserModule
Inject ConsistencyManager where it will be used.
Configuration menu - View commit details
-
Copy full SHA for ca6fe5a - Browse repository at this point
Copy the full SHA ca6fe5aView commit details -
IamFetchReadyCondition
ImplementationMotivation: custom condition to block token retrieval until condition is met. We then return the newest token
Configuration menu - View commit details
-
Copy full SHA for 32775a0 - Browse repository at this point
Copy the full SHA 32775a0View commit details -
Add offset, retryCount, & sessionDuration to OptionalHeaders
Motivation: support passing values as headers, add comments
Configuration menu - View commit details
-
Copy full SHA for 1505d07 - Browse repository at this point
Copy the full SHA 1505d07View commit details -
Update Subscription & User backend services to return offsets
Motivation: need the offsets to be available to set in the ConsistencyManager
Configuration menu - View commit details
-
Copy full SHA for be10255 - Browse repository at this point
Copy the full SHA be10255View commit details -
Update IAM manager & backend service with retry logic, optional headers
Motivation: the IAM fetch call (`listInAppMessages`) will include the rywToken, retryCount, & secondsSinceAppOpen (tracked on backend) We update the request & related code here. Handle retry logic
Configuration menu - View commit details
-
Copy full SHA for 1a43567 - Browse repository at this point
Copy the full SHA 1a43567View commit details -
Flush track session start operation
Motivation: we want to update the user as soon as possible in order to not delay IAM fetch
Configuration menu - View commit details
-
Copy full SHA for 591bbe7 - Browse repository at this point
Copy the full SHA 591bbe7View commit details -
Motivation: to be used to index read your write tokens specific to the IamFetch consistency use case
Configuration menu - View commit details
-
Copy full SHA for c3f15f5 - Browse repository at this point
Copy the full SHA c3f15f5View commit details -
Update User & Subscription operation executors to set the tokens
Motivation: the executors call the respective backend services who's result will include the token value. We then hold in memory via `setRywToken`
Configuration menu - View commit details
-
Copy full SHA for 5b83545 - Browse repository at this point
Copy the full SHA 5b83545View commit details -
Update HttpClient to put new optional headers into request
Motivation: offset, secondsSinceAppOpen, & retryCount will be sent as headers
Configuration menu - View commit details
-
Copy full SHA for 2083bd0 - Browse repository at this point
Copy the full SHA 2083bd0View commit details
Commits on Sep 27, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 55a3e25 - Browse repository at this point
Copy the full SHA 55a3e25View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5873b16 - Browse repository at this point
Copy the full SHA 5873b16View commit details