You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix/implement caching for iams pulled on session (#630)
* Added IAM caching from on_session request
* Now IAMs from the on_session request response will be persisted and used in the case where an on_session is not called and we have no IAMs to reference
* Using the codeable data method in the OneSignalUserDefaults class and required to setup decoder and encoder for the OSInAppMessage and OSTrigger class
* Now we try to init IAMs with the cached IAMs just in case
Added two unit tests in relation to this added functionality
* First test checks that on_session we start using the IAMs and persist them
* Second test makes sure that on_session is called, IAMs are cached, and then cold start without a new on_session
* This should result in the app using the cached IAMs
* Added a little deeper logic into the on_session IAM unit tests
* First test now checks for persisted IAMs before and after the test runs
* Second test now checks for persisted IAMs at the start, and the network check at the end verifies the IAMs came from cache instead of request response
* Fixing unit test request count for 2 on_session IAM tests
* Added IAM cache logic down same path as a on_session IAM receive
* Comment fix, missing space
* Split up on_session IAMs and cache inits
* Return early in the case where we use the session for IAMs
* Only need to call eval after getting cached IAMs
* Fixed unit tests related to pausing IAMs
0 commit comments