Keeping a Long-Lived gRPC Stream Alive on Flutter
FlutterOpening the realtime stream was the easy part; keeping the socket alive on a phone that suspends, switches networks, and lies about being connected was the hard part.
Practical lessons from 12+ years of building and shipping mobile apps.
Opening the realtime stream was the easy part; keeping the socket alive on a phone that suspends, switches networks, and lies about being connected was the hard part.
Building offline-first chat meant our on-device SQLite store and the server had to agree on reality after a reconnect, and the first version got that agreement spectacularly wrong.
A single Sync message once fired three alerts on one phone; here is how I hunted down duplicate, late, and missing push notifications on the device.
The doctor dashboard felt janky and killed the tablet battery by lunch; the culprit was thousands of needless widget rebuilds hiding behind a live data stream.
Patient symptom photos kept vanishing when the app was backgrounded or killed, so we handed the uploads to the OS itself.
Our patients live on flaky 3G in elevators and rural clinics, so we stopped assuming the network works and built an app that survives it losing.
After 6 years of native iOS development, I switched to Flutter. Here are the most surprising things.