Photo by Carlos Muza on Unsplash
TODO App Failure: A Postmortem
Why You Should Always Keep Up With Library Updates
Issue Summary
An outage happened as a result of an update by the Flutter and firebase that entailed updating certain libraries and dependencies that resulted in the now efficient FlutterFire platform. The developer(me) was not regularly testing the application hence did not know that there was a need to migrate from flutter with firebase to FlutterFire.
The outage lasted from 8.00a.m (utc+3.00) 17th August 2020 to 4.00p.m (utc+3.00) 21st August 2020. Had the app been in production, this would have translated to the 100% of the users losing their task lists and access to the application for 4 whole days.
Timeline
- 3.00p.m 17th August 2020: Issue connecting Firebase Auth to the Todo App
- 4.00p.m 17th August 2020: Debugging phase one - Checking for grammatical Errors
- 6.00p.m 17th August 2020: Debugging Phase one unsuccessful
- 10.00a.m 18th August 2020: Debugging Phase Two - Checking for correct dependency updates
- 12.00p.m 18th August 2020: Debugging Phase Two complete - However, still no connection
- 3.00p.m 18th August 2020: Looking for errors in developer platforms. Found out about the update to FlutterFire
- 10.00a.m 19th August 2020: Researching blog posts on the issue
- 10.00a.m 20th August 2020: Following the Migration Guide
- 3.00p.m 20th August 2020: Migration Successful but app needed some bug fixes to run
- 4.00p.m 21st August 2020: The app is running successfully - On a development environment**
The issue was detected during a routine powerup of the application to add security features to the login service, where the developer realised that the app was not communicating with Firebase Auth.
After comprehensive research into the codebase and outdated libraries, the developer(you know who) performed the migration to FlutterFire, after which the issue was resolved. This was after he tried to check for typos in hundreds of lines of code(this guy!!).
Root cause and resolution
As explained in the above sections, the Flutter and firebase teams had come together to form Flutterfire which made it easier for developers to incorporate Firebase into Flutter applications. This update meant that certain dependencies were then outdated and to use any firebase product you needed to call
Firebase.initializeApp()
Since the application lacked this section and more, as seen in the FlutterFire migration guide, we needed(me) to migrate. Although you can follow the guide, here are a few simple steps we took(still me):
Update several plugins in pubspec.yaml i.e :
cloud_firestore ^0.16.0 cloud_functions ^0.9.0 firebase_auth ^0.20.1 firebase_core ^0.7.0 firebase_crashlytics ^0.4.0 firebase_storage ^7.0.0 firebase_messaging ^8.0.0-dev.15 firebase_remote_config ^0.8.0-dev.0
Follow the steps dictated in the Migration guide. Don't be lazy, go check out FlutterFire, it's amazing!
Corrective and preventative measures
Although the app is still a side project, the major point of concern with this issue is the development team(me). They need to implement Test-driven development whilst coming up with any Software Engineered products.
Another thing that might help is ensuring the team understands the core concepts of a mobile app as opposed to using > ctrl + c and ctrl + v