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.
Jul 5, 202611 min read
Software Engineer
I build consumer mobile products with native iOS and Flutter, and write about the parts that only show up in production.
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.
End-to-end encryption is easy to describe and brutal to operate on real phones, where keys live in the Keychain and Keystore and survive, or vanish, in ways that surprise you.
Then we probably care about the same things. Tell me what you are working on.