M A K I N G Y O U R A P P R E S I L I E N T T O N E T W O R K FA I L U R E S
O F F L I N E - F I R S T
W H O A M I ?
M A K I N G Y O U R A P P R E S I L I E N T T O N E T W O R K FA I L U R E S
O F F L I N E - F I R S T
M O B I L E W O R L DW E L I V E I N A N I N C R E A S I N G LY
B E I N G O F F L I N E I S A G I V E N , N O T A N E X C E P T I O N .
H O W C A N A P P L I C AT I O N D E V E L O P E R S H A N D L E T H I S ?
N O T M Y P R O B L E M
N O T I F Y T H E U S E RE R R O R H A N D L I N G
H A N D L E I T C A S E B Y C A S E
O F F L I N E - F I R S T D E V E L O P M E N T
S E R V I C E W O R K E R S
“A service worker is a script that your browser runs in the background, separate from a web page, opening the door to features that don't need a web page or user
interaction.”
S E R V I C E W O R K E R S
“Using service worker you can hijack connections, fabricate, and filter responses. Powerful stuff.”
https://developers.google.com/web/fundamentals/getting-started/primers/service-workers
S E R V I C E W O R K E R S
I’m not here to talk about Service Workers..
D ATA S Y N C
I ’ M H E R E T O TA L K A B O U T
C O U C H D B
F E AT U R E S
• Document database
• Versions
• Changes Feed
• Sync
S O M E O P E N - S O U R C E
• POUCH-CLERK
• https://github.com/pgte/pouch-clerk
• Example app
• https://github.com/pgte/pouch-clerk-example-app
D E M O T I M E !
TA K E - A W AY S
• Offline is a given, not an exception
• You should not handle networking errors case-by-case
• Embrace offline-first techniques
• Sync is your friend
Q U E S T I O N S ?
C R E D I T S
• Hans Kylberg - https://www.flickr.com/photos/visulogik/1619008375
• Vodafone UK slide: Jake Archibald, Google I/O
• Machinery: Franz Zajizek, Astronomical Clock Machinery - https://commons.wikimedia.org/wiki/File:Vienna_-_Vintage_Franz_Zajizek_Astronomical_Clock_machinery_-_0518.jpg
• HospitalRun images: @ Cure.org
• Monolith: Expo Murten: https://commons.wikimedia.org/wiki/File:20020719_Expo_Murten_10.JPG