[VW-268] Adding update polling to settings/integrations table#136
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
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 Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR enables automatic polling of integrations data every 10 seconds with background refetch, then refines the UI to show the loading indicator only during initial load rather than during background polling updates. The changes span a configuration constant, the custom hook that drives the query, and the consuming component's loading state logic. ChangesIntegrations Polling and Loading State
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/features/integrations/components/integrations.tsx (1)
78-94:⚠️ Potential issue | 🟠 Major | ⚡ Quick winFix
isInitialLoadinIntegrationsList(dead under Suspense +useSuspenseQuery)
src/features/integrations/components/integrations.tsxcomputesisInitialLoad = isFetching && !isRefetching, butIntegrationsListis already wrapped in<Suspense fallback={<IntegrationsLoading />}>. WithuseSuspenseIntegrationsbased onuseSuspenseQuery, the component only renders once the initial fetch is resolved; at that pointisPendingis effectively false andisRefetchingtracks background fetching (isRefetching === isFetching && !isPending), soisInitialLoadstaysfalse. SinceDataTableonly usesisLoadingfor the empty-state row, this prop never enables a loading UI.🔧 Proposed simplification
- const { - data: integrations, - isFetching, - isRefetching, - } = useSuspenseIntegrations(resourceType); - const isInitialLoad = isFetching && !isRefetching; + const { data: integrations } = useSuspenseIntegrations(resourceType); const columns = useMemo(() => { return getIntegrationColumns(resourceType); }, [resourceType]); return ( <DataTable search={<IntegrationsSearch />} paginatedData={integrations} columns={columns} - isLoading={isInitialLoad} + isLoading={false} /> );🤖 Prompt for 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. In `@src/features/integrations/components/integrations.tsx` around lines 78 - 94, The isInitialLoad calculation is wrong under Suspense/useSuspenseQuery; replace its usage so DataTable receives the raw fetching state: stop computing isInitialLoad = isFetching && !isRefetching and instead pass isLoading={isFetching} (or remove isInitialLoad and use isFetching directly) from the IntegrationsList component that calls useSuspenseIntegrations; update references to isInitialLoad in integrations.tsx (the DataTable prop) so the empty-state row shows while isFetching is true.
🤖 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.
Outside diff comments:
In `@src/features/integrations/components/integrations.tsx`:
- Around line 78-94: The isInitialLoad calculation is wrong under
Suspense/useSuspenseQuery; replace its usage so DataTable receives the raw
fetching state: stop computing isInitialLoad = isFetching && !isRefetching and
instead pass isLoading={isFetching} (or remove isInitialLoad and use isFetching
directly) from the IntegrationsList component that calls
useSuspenseIntegrations; update references to isInitialLoad in integrations.tsx
(the DataTable prop) so the empty-state row shows while isFetching is true.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e4ec3bb3-b54a-421b-b667-5eb4712ebd61
📒 Files selected for processing (3)
src/config/constants.tssrc/features/integrations/components/integrations.tsxsrc/features/integrations/hooks/use-integrations.ts
Polls the Integrations tables for an update every 10 seconds (configurable in constants.ts)
I only tested this by faking an integration in the DB directly, so if someone would like to test this with a more real integration that would be lovely
Summary by CodeRabbit