My “user admin” section for poketto.me is quite simple: it lists all registered users, shows when they first (and most recently) used the app, and lets me assign “entitlements” (features like the experimental podcasts and newsfeeds). Works perfectly well on my development instance — but in production, it kept crashing.

Turns out: with Firebase, querying documents where a field value is `in` a list of values isn’t very smart — the list may only contain up to **30 (!) values**.

session_docs = db.collection(\'user_sessions\').where(

filter=FieldFilter(\'user_id\', \'in\', user_ids)

).get()

The other thing I learned here: the **Logs Explorer** in Google Cloud works great! But: Testing in production still sucks 😅