fix(deploy): accept pending/syncing/degraded provider states as connected#132
Conversation
Cloud's deriveProviderState (provider-status.ts:214) emits one of: ready | pending | syncing | degraded | error. The preflight matcher only accepted "ready", which forced users to wait for Nango's initial sync to complete between OAuth completion and their first usable deploy — every freshly-connected integration sits in `pending` or `syncing` for a few minutes and tripped the "not connected" branch. Concretely the failure mode is: user runs `agentworkforce login`, deploys (gets prompted for github + slack, completes OAuth, deploy succeeds because the deploy run itself proceeds past the prompt), then re-deploys minutes later — preflight queries /me/integrations, sees status="pending"/"syncing", rejects, prompts OAuth a second time even though the connections are fully real. Fix: accept ready | pending | syncing | degraded. Reject only `error` and missing rows. From a persona's runtime perspective these all represent a live OAuth grant — writes go through immediately; sync-backed reads return data once Nango finishes. `error` stays rejected so users can repair a broken integration via fresh OAuth. Added test coverage for each of the 4 accepted states + the rejected error state. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Follow-up to #131. The strict preflight introduced there only accepts `status: ready` from the cloud's `deriveProviderState` output, but that function actually emits five states and `ready` is reached only after Nango's initial sync completes. Fresh OAuth grants sit in `pending` (queued) or `syncing` (running) for a few minutes — both real, usable connections — and the preflight rejects them.
Concrete failure mode: user runs `agentworkforce login` + `agentworkforce deploy` (gets prompted for github + slack, completes OAuth, deploy succeeds). Two minutes later they re-deploy — preflight queries `/me/integrations`, sees `status: pending`/`syncing`, prompts OAuth a second time despite the connections being fully real.
Cloud's emitted states
`cloud/packages/web/lib/integrations/provider-status.ts:214` returns one of:
Personas with declared integrations can use a `pending`/`syncing` connection at runtime — writes go through immediately; sync-backed reads return data once Nango finishes. `error` stays rejected so the user can repair a broken integration via fresh OAuth.
Test plan
🤖 Generated with Claude Code