Skip to content

Prevent Tinybird polling when analytics is disabled#28713

Open
sawirricardo wants to merge 1 commit into
TryGhost:mainfrom
sawirricardo:fix-analytics-disabled-tinybird-polling
Open

Prevent Tinybird polling when analytics is disabled#28713
sawirricardo wants to merge 1 commit into
TryGhost:mainfrom
sawirricardo:fix-analytics-disabled-tinybird-polling

Conversation

@sawirricardo

Copy link
Copy Markdown
Contributor

Summary

  • prevent Tinybird token/query setup when analytics is disabled or stats config is missing
  • gate Stats and Post Analytics web queries, filter option loading, and token loading behind webAnalytics
  • return an empty query state when Tinybird queries are disabled to avoid stale data

Fixes #28264

Testing

  • mise exec node@22.18.0 -- pnpm --filter @tryghost/admin-x-framework exec vitest run test/unit/hooks/use-tinybird-query.test.ts test/unit/hooks/use-active-visitors.test.ts
  • mise exec node@22.18.0 -- pnpm nx run-many -t lint --projects=@tryghost/admin-x-framework,@tryghost/stats,@tryghost/posts
  • mise exec node@22.18.0 -- pnpm nx run-many -t build --projects=@tryghost/admin-x-framework,@tryghost/stats,@tryghost/posts

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0ecd915a-e24b-4200-86db-3c73e2662c33

📥 Commits

Reviewing files that changed from the base of the PR and between 73e2c7e and 7d9104a.

📒 Files selected for processing (11)
  • apps/admin-x-framework/src/hooks/use-tinybird-query.ts
  • apps/admin-x-framework/test/unit/hooks/use-active-visitors.test.ts
  • apps/admin-x-framework/test/unit/hooks/use-tinybird-query.test.ts
  • apps/posts/src/providers/post-analytics-context.tsx
  • apps/posts/src/views/PostAnalytics/Overview/overview.tsx
  • apps/posts/src/views/PostAnalytics/Web/web.tsx
  • apps/posts/src/views/PostAnalytics/components/stats-filter.tsx
  • apps/stats/src/providers/global-data-provider.tsx
  • apps/stats/src/views/Stats/Overview/overview.tsx
  • apps/stats/src/views/Stats/Web/web.tsx
  • apps/stats/src/views/Stats/components/stats-filter.tsx
 __________________________________
< Software is hard. - Donald Knuth >
 ----------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can get early access to new features in CodeRabbit.

Enable the early_access setting to enable early access features such as new models, tools, and more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tinybird integration continuously polls api_active_visitors (causing 429 errors) even when Analytics is disabled

1 participant