Our billing code logged store_ready on every cold start.
On some starts, that event never reached the server.
The billing layer was fine. Our own analytics wrapper was throwing the events away. This is a short write-up of that bug from our Flutter fortune app, and the small fix.
The setup
The app has a small analytics wrapper, Backend.event(name, props) . It only sends when the backend session is live:
bool get _live => ready && _api . usable ;
Future < void > event ( String name , [ Map < String , dynamic > props = const { } ] ) async { if ( ! _live ) return ; // no session yet -> drop // ...send }
Enter fullscreen mode
Exit fullscreen mode
For screen events that is fine. A user who has not signed in yet has not seen a screen worth measuring.
The billing layer is different. On a cold start it queries the store for products right away, with a retry loop.…