fix(providers): expose unhealthy data sources - #2270
Conversation
Separate connection from authorization health and surface dataset failures and freshness on web and iOS. Fixes #2071
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
Reviewer's GuideSeparates provider connection vs authorization health across web and mobile, introduces a reusable provider-health model, enhances processing status widgets to always expose unhealthy datasets with freshness and actionable errors, and wires reconnect-specific flows and UI (including modals and buttons) for various auth types while extending tests and stories. Flow diagram for providerHealth connection and authorization status computationflowchart TD
A[providerHealth input
authorized
needsReauth
requiresAuthorization] --> B{authorized?}
B -->|true| C[connection = Connected
status = healthy]
B -->|false| D[connection = Not connected
status = neutral]
C --> E{needsReauth?}
D --> E
E -->|true| F[authorization = Reconnect required
status = warning
requiresReconnect = true]
E -->|false| G{requiresAuthorization?}
G -->|true| H{authorized?}
G -->|false| I[authorization = Not required
status = neutral
requiresReconnect = false]
H -->|true| J[authorization = Active
status = healthy
requiresReconnect = false]
H -->|false| K[authorization = Not connected
status = neutral
requiresReconnect = false]
F:::out
I:::out
J:::out
K:::out
classDef out fill:#e3f2fd,stroke:#1e88e5,stroke-width:1;
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
PR Summary by QodoExpose provider authorization and dataset health
AI Description
Diagram
High-Level Assessment
Files changed (17)
|
📝 WalkthroughWalkthroughProvider health is separated into connection and authorization states, reconnect flows use provider-specific modals, and web/mobile processing widgets now expose dataset status, freshness, and failure details. ChangesProvider health and reconnect flow
Dataset processing status
Estimated code review effort: 4 (Complex) | ~45 minutes Assessment against linked issues
Sequence Diagram(s)sequenceDiagram
participant ProviderDetailPage
participant providerHealth
participant ProcessingStatusWidget
participant DataSourcesAuthModals
ProviderDetailPage->>providerHealth: derive connection and authorization status
providerHealth-->>ProviderDetailPage: return health and reconnect requirement
ProviderDetailPage->>ProcessingStatusWidget: render dataset status and freshness
ProviderDetailPage->>DataSourcesAuthModals: open provider-specific reconnect form
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
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 |
Mobile PreviewScan to open on device:
To test on device:
|
|
Storybook previews for This comment updates automatically on each PR push. |
Code Review by Qodo
Context used✅ Compliance rules (platform):
182 rules✅ Skills:
fix-provider, write-tests, cloudflare 1.
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/mobile/app/providers/`[id].tsx:
- Around line 903-907: Update the provider health and reconnect button
visibility logic in the provider screen to use the `requiresReconnect` value
returned by `providerHealth`, rather than deriving the decision from
`provider?.needsReauth`. Replace the duplicate check in the button visibility
path around the existing health calculation, preserving the current behavior for
other health conditions.
In `@packages/web/src/components/ProcessingStatusWidget.tsx`:
- Around line 112-126: Update the dataset error derivation and rendering in
ProcessingStatusWidget so historical failures are resolved and displayed only
when the current dataset status is failed or blocked. Apply the same status
guard to the mobile rendering path, preserving equivalent web and mobile
behavior, and ensure a failed-then-ready timeline shows the ready state without
the obsolete error.
In `@packages/web/src/pages/ProviderDetailPage.tsx`:
- Around line 605-634: Split ProviderDetailPage by extracting the SyncHistory UI
and records browser into focused modules with direct imports, keeping their
existing behavior and interfaces unchanged. Update ProviderDetailPage to use
those extracted components and ensure no TypeScript file exceeds 1,000 lines; do
not introduce a barrel file.
- Around line 261-269: Update the reconnect handling in ProviderDetailPage,
including the unavailable-token branch that calls captureException and
setSyncMessage, to store a reconnect-specific error state and render it beside
the Reconnect action outside the provider authorized-controls gate. Ensure the
state is cleared on a successful reconnect or new attempt as appropriate, and
add coverage verifying disconnected token providers see the error.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 9ca83d9d-18cd-4583-8954-ee2b6c317757
📒 Files selected for processing (17)
packages/mobile/app/providers/[id].test.tsxpackages/mobile/app/providers/[id].tsxpackages/mobile/components/ProcessingStatusWidget.stories.tsxpackages/mobile/components/ProcessingStatusWidget.test.tsxpackages/mobile/components/ProcessingStatusWidget.tsxpackages/mobile/components/SourceProcessingStatusCard.tsxpackages/providers-meta/package.jsonpackages/providers-meta/src/processing-status.test.tspackages/providers-meta/src/processing-status.tspackages/providers-meta/src/provider-health.test.tspackages/providers-meta/src/provider-health.tspackages/web/src/components/ProcessingStatusWidget.stories.tsxpackages/web/src/components/ProcessingStatusWidget.test.tsxpackages/web/src/components/ProcessingStatusWidget.tsxpackages/web/src/components/SourceProcessingStatusCard.tsxpackages/web/src/pages/ProviderDetailPage.test.tsxpackages/web/src/pages/ProviderDetailPage.tsx
…issue-2071-provider-health
…issue-2071-provider-health
|
LGTM! The changes cleanly introduce 🤖 Reviewed by codereviewbot.ai - Catch bugs before your team does. |
Summary
Validation
pnpm test:changed(907 files, 14,322 tests)pnpm typecheckpnpm lintcode/policy gatespnpm lint:analytics-sqlwith workspace-isolated ClickHousepnpm --dir packages/web buildpnpm --dir packages/web build-storybookpnpm --dir packages/mobile build-storybookFixes #2071
Summary by Sourcery
Clarify provider connection versus authorization health across web and mobile and surface dataset-level processing problems and freshness on provider and metric screens.
New Features:
Enhancements:
Tests:
Summary by cubic
Separate provider connection status from authorization health and surface unhealthy datasets with freshness and actionable errors on web and iOS. Fixes #2071 and promotes clear reconnect flows to restore data sync.
New Features
@dofek/providers/provider-healthwith Connection/Authorization indicators andrequiresReconnect.alwaysVisiblestill shows readiness/freshness when overall status is ready.Bug Fixes
Written for commit 9993703. Summary will update on new commits.
Summary by CodeRabbit
New Features
Bug Fixes