Skip to content

fix: disable unused PostHog remote features - #23

Merged
Programcode merged 1 commit into
mainfrom
t3code/posthog-csp-cleanup
Aug 31, 2026
Merged

Programcode merged 1 commit into
mainfrom
t3code/posthog-csp-cleanup

Conversation

@Programcode

@Programcode Programcode commented Aug 31, 2026 •

Copy link
Copy Markdown
Owner

Outcome

Removes production CSP console errors without widening script-src or expanding telemetry collection.

Changes

  • disable PostHog remote flags because DebateLab does not use them
  • disable surveys and external dependency loading
  • retain privacy-safe manual product-event capture
  • assert the tightened initialization contract

Verification

  • focused observability tests: 10 passed
  • lint and typecheck passed
  • Node 22 coverage suite: 94 files / 957 tests passed
  • coverage: 90.62% statements, 83.13% branches, 91.46% functions, 94.04% lines
  • production build passed
  • host Playwright: 124 tests passed across desktop and mobile Chromium
  • independent Luna/xhigh standards and behavior reviews completed; one test-title finding fixed

CI note

GitHub Actions currently cannot allocate runners because the account is out of Actions minutes. The local release-equivalent checks above cover the current head. Vercel preview will be used for the real configured CSP/telemetry browser check.

Summary by CodeRabbit

  • Privacy & Security
    • Improved analytics privacy by disabling surveys, external dependency loading, and advanced feature flags.
  • Tests
    • Updated coverage to verify that these analytics capabilities remain disabled.

@vercel

vercel Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
debate-navigator Ready Ready Preview Aug 31, 2026 5:59pm

@coderabbitai

coderabbitai Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ae94f9c2-e154-422f-9176-9a4f27cdf7d3

📥 Commits

Reviewing files that changed from the base of the PR and between d0ba608 and 0296de5.

📒 Files selected for processing (2)
  • src/lib/observability.ts
  • src/test/observability.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

PostHog initialization now disables surveys, external dependency loading, and advanced feature flags. Observability tests verify the new settings and describe the selected capability coverage.

Changes

Observability configuration

Layer / File(s) Summary
PostHog capability restrictions
src/lib/observability.ts, src/test/observability.test.ts
PostHog disables three additional capabilities. Initialization tests verify the settings and use a narrower capability-focused name.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 0296d

This PR tightens PostHog initialization to disable unused remote features while preserving manual product-event capture. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: disabling unused PostHog remote features.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@Programcode
Programcode merged commit 4828c68 into main Aug 31, 2026
3 of 4 checks passed
@Programcode
Programcode deleted the t3code/posthog-csp-cleanup branch August 31, 2026 18:02

This branch was successfully deployed

1 active deployment
Preview — 0296de58 Deployed Aug 31, 2026 by vercel[bot]
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