-
Notifications
You must be signed in to change notification settings - Fork 262
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
[5.0.0] Push subscription related fixes (3) #1289
Commits on Aug 8, 2023
-
check for push subscription updates on new sessions
* Properties on the push subscription can change between app opens such as app version, SDK version, or device OS * These changes aren't driven by changes in the SDK and previously wouldn't be detected as changed * Now, on each new session, we will ask the push subscription model to check itself for updates and enqueue those changes.
Configuration menu - View commit details
-
Copy full SHA for b7f070c - Browse repository at this point
Copy the full SHA b7f070cView commit details -
Create the push sub model with a notification type
- Create the push sub model with the notification_types at time of creation - This is so that on the first app open, we can receive push prompt IAMs (server expects to have an appropriate notification_type to determine eligibility)
Configuration menu - View commit details
-
Copy full SHA for 2fe55b3 - Browse repository at this point
Copy the full SHA 2fe55b3View commit details -
Recreate a push subscription when we detect it is removed
* On a new session, we fetch the user. If we detect our push subscription missing from the user (indicating the push subscription may be deleted), we send a create subscription request for the device's push sub.
Configuration menu - View commit details
-
Copy full SHA for ea6c30c - Browse repository at this point
Copy the full SHA ea6c30cView commit details -
Add convenience accessor to the push subscription model
* On the user manager * We access the push subscription model via the model store instead of via `user.pushSubscriptionModel`. * If privacy consent is set in a wrong order, we may have sent requests, but hydrate on a mock user. * However, we want to set tokens and subscription ID on the actual push subscription model.
Configuration menu - View commit details
-
Copy full SHA for 7d7f13d - Browse repository at this point
Copy the full SHA 7d7f13dView commit details -
Allow the operation repo to be paused
* If a createUser fails, let's pause the operation repo. We will still poll, but we won't flush it is paused. * After a create user request is uncached, update the `originalPushToken` property to be the push token associated with this request. Because, we update the push subscription before sending this request.
Configuration menu - View commit details
-
Copy full SHA for 0d033d4 - Browse repository at this point
Copy the full SHA 0d033d4View commit details -
On new session, user executor executes, and unpause operation repo
* On a new session, we will trigger the user executor to execute any pending requests, in case there is a failed create user request that should be retried. We can't rely on the operation repo flushing to trigger the user executor as it bypasses the operation repo.
Configuration menu - View commit details
-
Copy full SHA for ec27d63 - Browse repository at this point
Copy the full SHA ec27d63View commit details -
Configuration menu - View commit details
-
Copy full SHA for af02758 - Browse repository at this point
Copy the full SHA af02758View commit details -
* Use the existing `isCurrentUser` method * remove extraneous logging that make the logs messy
Configuration menu - View commit details
-
Copy full SHA for 0291cfa - Browse repository at this point
Copy the full SHA 0291cfaView commit details
Commits on Aug 9, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 9641884 - Browse repository at this point
Copy the full SHA 9641884View commit details
Commits on Aug 10, 2023
-
Ignore the second JS dismiss event
The JS dismiss event is being sent to the SDK twice. Make sure we don't dismiss twice or the second IAM in the queue will be dismissed before it is displayed
Configuration menu - View commit details
-
Copy full SHA for c34fc63 - Browse repository at this point
Copy the full SHA c34fc63View commit details -
* Each executor manages its own background task * For attributed sessions, define another background task to send the session_time to update user (in addition to the existing request to the outcomes endpoint)
Configuration menu - View commit details
-
Copy full SHA for f9ac55d - Browse repository at this point
Copy the full SHA f9ac55dView commit details -
Background flush of operation repo
* When app is backgrounded, flush the operation repo and let each executor and request manage its background task * don't end background tasks until requests return * Processing the queues will take in another flag called `inBackground`
Configuration menu - View commit details
-
Copy full SHA for ff6c5fa - Browse repository at this point
Copy the full SHA ff6c5faView commit details -
Background sending of session ending outcomes
* Add callbacks before ending the background task to send attributed session time, and save unsent time as zero only after a success callback * This waits 30 seconds in the background
Configuration menu - View commit details
-
Copy full SHA for 5a309b1 - Browse repository at this point
Copy the full SHA 5a309b1View commit details -
Update background sending session_time to user
* When app is backgrounded, create a background task and send the session_time to the user endpoint * Have callbacks, bypassing the operation repo * This is done both for unattributed sessions that send the request right away and for attributed sessions that wait 30 seconds before sending
Configuration menu - View commit details
-
Copy full SHA for c6cfcda - Browse repository at this point
Copy the full SHA c6cfcdaView commit details -
* Remove messy logging * Add informational log for background task expiring
Configuration menu - View commit details
-
Copy full SHA for 2202fe7 - Browse repository at this point
Copy the full SHA 2202fe7View commit details -
Don't handle addAlias conflict
* When we set tags and it goes over limit, we don't delete them locally. * Let's do the same for added aliases that can't be added to the user due to conflict * The SDK will refresh itself on new sessions * We will need better systematic way to address these types of failure cases
Configuration menu - View commit details
-
Copy full SHA for eb16f40 - Browse repository at this point
Copy the full SHA eb16f40View commit details -
Merge pull request #1300 from OneSignal/5.0.0/rehaul_background_tasks
[5.0.0] Fix background tasks
Configuration menu - View commit details
-
Copy full SHA for cc22dee - Browse repository at this point
Copy the full SHA cc22deeView commit details -
Merge pull request #1294 from OneSignal/user_model/fix_in_app_display
[User model] Fix in app display
Configuration menu - View commit details
-
Copy full SHA for c2a9be3 - Browse repository at this point
Copy the full SHA c2a9be3View commit details -
Merge pull request #1290 from OneSignal/5.0.0/create_user_error
[5.0.0] Allow the SDK the chance to recover from failed Create User
Configuration menu - View commit details
-
Copy full SHA for be65c89 - Browse repository at this point
Copy the full SHA be65c89View commit details -
[nits] rename Background Task Delegate to Handler
* Rename `OSBackgroundTaskManagerDelegate` -> `OSBackgroundTaskHandler` because it is not truly a delegate, but is a concrete implementation that is injected
Configuration menu - View commit details
-
Copy full SHA for 1c8f185 - Browse repository at this point
Copy the full SHA 1c8f185View commit details -
Configuration menu - View commit details
-
Copy full SHA for bef92f7 - Browse repository at this point
Copy the full SHA bef92f7View commit details