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
Caching is the process of storing information locally so that it can retrieved without having to make network calls. Currently our app makes API calls to get the necessary information for a page. For example if I go from the sessions page to the profile page a get request is made. This is fine when the app is connected to a network however when it's offline and the user is logged in, they should be able to still navigate the app.
This can be resolved by using a swift library for storing information called NSCache. It works kind of a like a map (or dictionary if you like python terminology) in that it stores information in key value pairs. All information that is in some way being displayed on the app should be cached. This includes sessions and user profile information.
Note another thing that needs to be implemented is that the pre- and pos- session note feature should still work when offline. In others words, responses should be stored locally on the cache when offline and once the app is online the necessary API calls need to be made. It's up to you how you want to implement this whether it be refreshing the app or detecting when a network is available to make the calls.
For simplicity, we are not going to implement offline features in regards to scheduling sessions (booking, reschedule, cancel, etc.) For now if a user tries to use these features when offline throw the network error custom alert.
Also, Login should not work when offline. This should already have been set up by PR #151
Tasks
Store all relevant information locally in a cache object
Ensure that pre- and post- session features work even when offline (store responses in cache).
Once app is back online make necessary API calls to properly update server
Add network error alert when trying to access calendly stuff offline
Description of Issue
Caching is the process of storing information locally so that it can retrieved without having to make network calls. Currently our app makes API calls to get the necessary information for a page. For example if I go from the sessions page to the profile page a get request is made. This is fine when the app is connected to a network however when it's offline and the user is logged in, they should be able to still navigate the app.
This can be resolved by using a swift library for storing information called NSCache. It works kind of a like a map (or dictionary if you like python terminology) in that it stores information in key value pairs. All information that is in some way being displayed on the app should be cached. This includes sessions and user profile information.
Note another thing that needs to be implemented is that the pre- and pos- session note feature should still work when offline. In others words, responses should be stored locally on the cache when offline and once the app is online the necessary API calls need to be made. It's up to you how you want to implement this whether it be refreshing the app or detecting when a network is available to make the calls.
For simplicity, we are not going to implement offline features in regards to scheduling sessions (booking, reschedule, cancel, etc.) For now if a user tries to use these features when offline throw the network error custom alert.
Also, Login should not work when offline. This should already have been set up by PR #151
Tasks
Helpful Links
Youtube video on basic caching
Documentation on using NSCache
Another article on caching using Swift
See PR #151 on how to deal with Network Handling
FYI: This issue will also handle optimizing Models/ModelView on Frontend
The text was updated successfully, but these errors were encountered: