{ "//": "Composite indexes required once drb-frontend's lib/use*.ts hooks add a where(\"org_id\",\"==\",orgId) equality filter alongside an existing range/orderBy/array-contains clause. Firestore auto-indexes single-field lookups and equality-only compound queries, but org_id==X combined with an inequality, orderBy on a different field, or array-contains needs an explicit composite index or the query fails at runtime with a FAILED_PRECONDITION 'index required' error (see SAAS_PLAN.md 2.8/B2 and the URL Firestore prints in that error, which is the fastest way to double-check this list against the live query shapes). Deploy with: firebase deploy --only firestore:indexes --project ", "indexes": [ { "collectionGroup": "calls", "queryScope": "COLLECTION", "fields": [ { "fieldPath": "org_id", "order": "ASCENDING" }, { "fieldPath": "started_at", "order": "ASCENDING" } ] }, { "collectionGroup": "calls", "queryScope": "COLLECTION", "fields": [ { "fieldPath": "org_id", "order": "ASCENDING" }, { "fieldPath": "incident_ids", "arrayConfig": "CONTAINS" } ] }, { "collectionGroup": "incidents", "queryScope": "COLLECTION", "fields": [ { "fieldPath": "org_id", "order": "ASCENDING" }, { "fieldPath": "started_at", "order": "ASCENDING" } ] }, { "collectionGroup": "alert_events", "queryScope": "COLLECTION", "fields": [ { "fieldPath": "org_id", "order": "ASCENDING" }, { "fieldPath": "triggered_at", "order": "ASCENDING" } ] }, { "collectionGroup": "alert_events", "queryScope": "COLLECTION", "fields": [ { "fieldPath": "org_id", "order": "ASCENDING" }, { "fieldPath": "acknowledged", "order": "ASCENDING" }, { "fieldPath": "triggered_at", "order": "ASCENDING" } ] } ], "fieldOverrides": [] }