Skip to content

SMS Delay Investigation โ€” Phone Verification During Admin Migration โ€‹

Date: 2026-03-22

Summary โ€‹

Investigated a noticeably slow SMS verification delivery during admin account creation via the phone migration flow. The SMS eventually arrived and everything worked, but the delay was suspicious.

Investigation โ€‹

What Was Checked โ€‹

  1. Cloud Run logs for auth-api โ€” All API responses were fast:

    • /auth/phone/check-admin โ€” 0.22s
    • /auth/phone/lookup โ€” 0.05s
    • /auth/phone/token โ€” 0.17s
  2. Cold start analysis โ€” No cold start during this session. Instance was already warm from a deployment rollout. Historical data shows cold starts on /phone/lookup can add 2-3s (observed on 03/19), but this was not a factor today.

  3. Flow path โ€” No /auth/admin/provider-link/start requests were logged, confirming the PhonePinSignup flow was used (not the invite-based AdminSignup flow).

Conclusion โ€‹

The delay occurred in Firebase's SMS delivery layer, after the client calls signInWithPhoneNumber. Our backend had no role in the delay. Possible causes:

  • Carrier-side SMS queuing โ€” varies by carrier and time of day
  • Invisible reCAPTCHA risk scoring โ€” Google's risk engine can silently add time before approving the SMS send
  • Firebase project-level SMS throttling โ€” dev project may have lower quotas

Action Items โ€‹

  • If it recurs: Check Firebase Console โ†’ Authentication โ†’ Usage for SMS delivery metrics
  • If cold starts become an issue separately: Consider setting a minimum instance count on auth-api in Cloud Run
  • No code changes needed โ€” the issue is external to our stack

Built with VitePress