Skip to content

fix(analytics): remove NODE_ENV dependency from prod gate#184

Merged
fbosch merged 1 commit intomasterfrom
fix/analytics-consent-tracking
Apr 10, 2026
Merged

fix(analytics): remove NODE_ENV dependency from prod gate#184
fbosch merged 1 commit intomasterfrom
fix/analytics-consent-tracking

Conversation

@fbosch
Copy link
Copy Markdown
Owner

@fbosch fbosch commented Apr 10, 2026

Summary

  • make analytics production gating trust NEXT_PUBLIC_VERCEL_ENV=production regardless of NODE_ENV
  • keep preview/development explicitly blocked when NEXT_PUBLIC_VERCEL_ENV is set accordingly
  • update trackEvent tests to cover the adjusted contract

Why

  • production traffic was still counted as non_production on fusion.nuzlocke.io
  • this removes an unnecessary strictness point that can misclassify real production runtime in bundled client code

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 10, 2026

Warning

Rate limit exceeded

@fbosch has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 27 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 12 minutes and 27 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48b25d30-0467-4acf-a49b-300f83cd4afe

📥 Commits

Reviewing files that changed from the base of the PR and between 66bec54 and 3d36a2c.

📒 Files selected for processing (2)
  • src/lib/analytics/__tests__/trackEvent.test.ts
  • src/lib/analytics/trackEvent.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/analytics-consent-tracking

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.

@fbosch fbosch merged commit e4c9424 into master Apr 10, 2026
9 checks passed
@fbosch fbosch deleted the fix/analytics-consent-tracking branch April 10, 2026 10:27
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.

1 participant