How to Run On-Demand Diagnostics for Firestore, Stripe, AI APIs, and Cron Jobs
Learn how super-admins can check the health of key backend systems using the app's configuration and Firebase Console.
Intro
On-demand diagnostics help you quickly identify issues with Firestore, Stripe integration, AI model pipelines, and cron-based jobs. This guide walks through the steps you can take as a super-admin to verify each system is operating correctly. The diagnostics rely on insights from system settings, AI model configurations, and Firebase logs.
Prerequisites
- A super-admin account with access to the Global Preferences area and Firebase Console.
- Familiarity with the DrawTool model override panel (optional but helpful).
- Access to the club’s Firebase Console (for Firestore and cron job logs).
Step-by-Step
- Open the Global Preferences page (from the super-admin panel) and verify the drawingModel and descriptionModel fields are set to expected values. These fields control the default AI model for diagram generation and analysis.
- Check the AI model registry by navigating to the DrawTool and opening the Model Override panel. Confirm that the listed models for drawing and describing show the correct
enabledandpriorityvalues. This ensures the fallback chain is active. - Review the bug_report_email setting in Global Preferences. Any automated alerts from Stripe or cron job failures should be sent here.
- In the Firebase Console, go to Firestore → Indexes and verify that all required composite indexes exist (especially for
sessions,players, anddrills). Mismatched indexes can cause slow queries. - Check Firebase Functions logs for recent errors from the
runModelChain()orchestrator or any cron-related functions. Look for exceptions that may indicate a failed AI call or Stripe webhook. - To test the Stripe integration manually, create a test invoice via the Finance → Invoices page using a sandbox account. Confirm the invoice appears in your Stripe dashboard.
- For cron job diagnostics, review the Communications Log (available to super-admins) to see if scheduled messages (e.g., session reminders) were dispatched. Missing logs may indicate a cron failure.
Tips & Pitfalls
- Always check the AI model registry before troubleshooting diagram generation issues. A disabled model can cause the fallback chain to skip it.
- If Stripe payments are failing, verify that the
stripe_account_idfield in your club’s document is correct and that the webhook endpoint is configured on Stripe’s side. - Cron job failures often leave no trace in the app UI. Rely on Firebase Console logs and the bug_report_email to catch silent errors.
- The guest_daily_limit setting in Global Preferences may inadvertently throttle legitimate AI usage. Increase it if diagnostics show excessive
guest_usagerecords.
Summary
Running on-demand diagnostics for Firestore, Stripe, AI APIs, and cron jobs involves checking Global Preferences, the AI model registry, Firebase Console logs, and key integration settings. Use these steps to quickly narrow down issues and ensure every backend system is healthy. For deeper monitoring, consider setting up custom alerts on the bug_report_email address.