Skip to main content

Network Test Findings - Console Output Analysis

Test Date: 2026-02-06 23:13:28
Business ID: a7ac092572c6fa5c
Batch ID: 0489e906-d84a-429a-a9b1-384505e99b05
Period Label: 2025-12-01

βœ… What’s Working

  1. Save Request:
    • βœ… PUT /api/v1/admin/onboarding/businesses/a7ac092572c6fa5c/save β†’ 200 OK
    • βœ… Save endpoint responds successfully
  2. Retry Logic:
    • βœ… 3 GET requests to /readiness endpoint (retry logic working)
    • βœ… All readiness requests return 200 OK
    • βœ… Retries happening as designed

πŸ”΄ Critical Issue

Problem: Readiness shows 0/113 ready after all 3 retry attempts Timeline:
  • 23:13:28 - PUT save request sent
  • 23:13:42 - PUT save response (200 OK) - 14 second delay ⚠️
  • 23:13:42 - First GET readiness β†’ 0/113 ready
  • 23:13:48 - Second GET readiness (retry) β†’ 0/113 ready
  • 23:13:51 - Third GET readiness (retry) β†’ 0/113 ready
Key Observations:
  1. 14-second delay on save - unusually long (suggests backend might be slow or blocking)
  2. All 3 readiness checks show 0/113 ready - saved business not showing as ready
  3. Retry delays: ~5s, ~2s, ~2s (longer than expected 500ms)

🎯 Root Cause Analysis

Most Likely Issue: Backend Readiness Query Not Seeing Saved Config

Possible Causes:
  1. Org ID Scope Mismatch:
    • Save writes with org_id based on business scope (SHARED β†’ NULL, ORG_SCOPED β†’ owning_org_id)
    • Readiness queries with org_id=cbs-main (from x-org-id header)
    • Readiness filter: (aa.org_id = @org_id OR aa.org_id IS NULL) should match, but might not be working correctly
  2. Business Not in Onboarding Table:
    • Readiness query starts from onboarding_businesses CTE
    • Filters: co.ignored = FALSE and org scope filters
    • If business is ignored or filtered out, readiness won’t check it
  3. Effective Date Mismatch:
    • Save writes with effective_start_date: 2025-12-01
    • Readiness queries with as_of_date: 2025-12-01
    • Filter: effective_start_date <= @as_of_date should match (2025-12-01 <= 2025-12-01 = TRUE)
  4. BigQuery Write β†’ Query Lag:
    • 14-second save delay suggests BigQuery write might be slow
    • Even after 11 seconds of retries, config still not queryable
    • Unlikely but possible

πŸ” Investigation Needed

Step 1: Check Save Request Details

In Network Tab, inspect PUT request:
  • Headers: x-org-id: cbs-main (should be present)
  • Body: period_label: 2025-12-01
  • Body: effective_start_date: 2025-12-01
  • Body: mode: AGENT_PEPM
  • Body: agent_pepm_lines: [...]

Step 2: Check Readiness Response Details

In Network Tab, inspect GET readiness response:
  • Does response include business a7ac092572c6fa5c in readiness map?
  • What does readiness['a7ac092572c6fa5c'] show?
    • is_ready: false?
    • reasons: [...]?

Step 3: Backend Logs

Check backend logs for:
  • Save write: Did it succeed? What org_id was written?
  • Readiness query: What org_id filter was used? What businesses were checked?

Step 4: Direct BigQuery Query

Run query to verify config was written:
SELECT 
  business_id,
  agent_entity_id,
  org_id,
  effective_start_date,
  effective_end_date,
  created_at
FROM `analytics.config_business_agent_assignment`
WHERE business_id = 'a7ac092572c6fa5c'
  AND tenant_id = 'creative_benefit_strategies'
ORDER BY created_at DESC
LIMIT 10
Expected: Should see rows written at 23:13:42 (after save)

πŸ“Š Summary

ComponentStatusNotes
Frontend Retry Logicβœ… Working3 retries as designed
Save Endpointβœ… WorkingReturns 200 OK
Backend Readiness Query❌ IssueNot seeing saved config
Retry Timing⚠️ Slow14s save delay, longer retry delays

🎯 Next Steps

  1. Inspect Network Tab for save request body and readiness response body
  2. Check Backend Logs for save write and readiness query details
  3. Run Direct BigQuery Query to verify config was written
  4. Verify Org ID Scope matches between save and readiness

Status: ⚠️ RETRY LOGIC WORKS, BUT BACKEND READINESS NOT SEEING SAVED CONFIG - NEED BACKEND INVESTIGATION