Skip to content

Offline workflow

Zachary McCoy edited this page Oct 5, 2019 · 3 revisions

VIEW CONTACT/GROUP List, Details, Progress, Comments/Activites, Connections, Members

ONLINE OFFLINE
1. Auto RefreshControl 1. Auto RefreshControl
2. API Request: GET List 2. API Request: GET List (IGNORED)
3. Render List from State 3. No state change, no re-render, List remains same
4. API Response: Update State
5. Render List from State (UI event to signify update)

CREATE CONTACT/GROUP (same behavior)

ONLINE OFFLINE
1. Update State w/ Contact/Group data AND Temporary ID 1. Update State w/ Contact/Group data AND Temporary ID
2. API Request: POST Contact/Group 2. API Request: POST Contact/Group (Queued for later)
3. Display Notification to User 3. Display Notification to User
4. API Response: Update State (replace Temp. ID) 4. API Response: Update State (replace Temp. ID)
(in future when ONLINE)

EDIT CONTACT/GROUP

ONLINE OFFLINE (exists only locally) OFFLINE (+ exists in remote D.T API)
1. Update State w/ Contact/Group data (D.T ID) 1. Update State w/ Contact/Group data (Temporary ID) 1. Update State w/ Contact/Group data (D.T ID if exists, else Temporary ID)
2. API Request: POST Contact/Group data 2. API Request: POST Contact/Group data (Queued for later) Remove any existing POST Request w/ same Temp. ID in REQUEST Queue UNLESS it is the CREATE Request 2. API Request: POST Contact/Group data (Queued for later) Remove any existing POST Request w/ same ID in REQUEST Queue
3. Display Notification to User 3. Display Notification to User 3. Display Notification to User
4. API Response: Update State
(Not necessary to handle API Response bc we're pushing latest State, but we could for consistency sake)
4. API Response: Update State (replace Temp. ID, when Create request)
(Not necessary to handle API Response bc we're pushing latest State, but we could for consistency sake)
4. API Response: Update State
(Not necessary to handle API Response bc we're pushing latest State, but we could for consistency sake)

AUTHENTICATION

ONLINE OFFLINE OFFLINE (never before online)
1. Check whether local cache contains active JWT Token 1. Check whether local cache contains active JWT Token 1. Check whether local cache contains active JWT Token
2a. If YES, then Navigate to CONTACTS Screen 2a. If YES, then Navigate to CONTACTS Screen 2. Enter PIN #, then Navigate to CONTACTS Screen
2b. If NO, then Navigate to LOGIN Screen 2b. If NO, Enter PIN #, then Navigate to HOME Screen
3. API Request: POST JWT-Auth
4. API Response: Update State (local JWT cache)

Open Items (related to OFFLINE Mode)

How to best handle option values (i.e., Source, Location)?

  • Must be ONLINE at some point to download the App (unless sideloading, but we won't consider this case)
  • "Sync" app upon every ONLINE usage (issue behind the scenes GET request to pull all possible options values)

How to handle any sort of whitelabeling (i.e., organizational-specific icons/theme, language-specific icons)?

  • same as handling of option values (above)

Placeholders for OFFLINE Mode in places where there is not yet any data

  • TBD

Device Storage