Skip to content

fix: allow Jam uploads in CSP and drop ignored sendDefaultPii - #28

Merged
Programcode merged 1 commit into
mainfrom
fix/jam-csp-connect-src-and-sentry-datacollection
Sep 1, 2026
Merged

Programcode merged 1 commit into
mainfrom
fix/jam-csp-connect-src-and-sentry-datacollection

Conversation

@Programcode

@Programcode Programcode commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

Follow-up review of the PRs merged 2026-08-31. Two gaps survived that batch.

Jam recorder cannot upload

PR #15 added https://*.jam.dev to script-src and frame-src, and @jam.dev/sdk
is a production dependency wired into AuthProvider, so bootstrap.ts loads the
recorder for real users. But connect-src was never updated — the recorder loads
and then has no route to send a capture.

Added the origin to connect-src in both vercel.json and nginx.conf. The
existing config test already asserts the two policies are byte-identical, so
they cannot drift.

sendDefaultPii was dead config

At the pinned @sentry/core 10.65.0, sendDefaultPii is deprecated and, per its
own type docs, "if both sendDefaultPii and dataCollection are set,
sendDefaultPii will be ignored." Since dataCollection is set, the line was a
PII control that did nothing — worse than absent, because it reads as protection.
Removed; dataCollection is now the single source of truth.

Note: queryParams is correct at 10.65.0. urlQueryParams does not exist
until 10.68.0, so no rename here.

Verification

Both fixes have an assertion that fails without them (confirmed by reverting each
fix with the tests in place — both went red, then green again once restored).

  • lint: clean
  • typecheck: clean
  • vitest: 97 files, 966 tests passed, coverage thresholds met
  • deno edge tests: 116 passed
  • build: succeeds

Summary by CodeRabbit

  • New Features

    • Enabled secure connections and embedded content from Jam.dev services for recording functionality.
  • Bug Fixes

    • Updated privacy configuration by removing a deprecated Sentry option while preserving existing data-collection controls.
  • Tests

    • Updated observability and deployment checks to verify the revised privacy settings and Content Security Policy permissions.

PR #15 added https://*.jam.dev to script-src and frame-src, so the recorder
loads in production, but connect-src was never updated. The recorder had no
route to upload a capture. Add the origin to connect-src in both vercel.json
and nginx.conf, which the config test already requires to stay identical.

Sentry ignores sendDefaultPii entirely whenever dataCollection is set, so the
line read as a PII control that does nothing. Remove it and leave the
dataCollection block as the single source of truth. queryParams is correct at
the pinned @sentry/core 10.65.0; urlQueryParams does not exist until 10.68.

Both fixes get an assertion that fails without them.
@vercel

vercel Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
debate-navigator Ready Ready Preview Sep 1, 2026 2:51pm UTC

@coderabbitai

coderabbitai Bot commented Sep 1, 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: Team

Run ID: 843f36cf-d9e8-4a1a-869d-2fa6cee88659

📥 Commits

Reviewing files that changed from the base of the PR and between edff2e7 and 71b7ad1.

📒 Files selected for processing (5)
  • nginx.conf
  • src/lib/observability.ts
  • src/test/observability.test.ts
  • src/test/vercel-deployment-config.test.ts
  • vercel.json

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


📝 Walkthrough

Walkthrough

The change adds Jam.dev origins to CSP directives and removes the deprecated Sentry sendDefaultPii option. Tests verify both configuration updates.

Changes

Configuration updates

Layer / File(s) Summary
Jam.dev CSP allowlists
nginx.conf, vercel.json, src/test/vercel-deployment-config.test.ts
The CSP configurations allow Jam.dev connections and frames. The deployment test checks the Jam.dev recorder connection allowance.
Sentry privacy configuration
src/lib/observability.ts, src/test/observability.test.ts
Sentry initialization removes sendDefaultPii: false. The test verifies that sendDefaultPii is absent when dataCollection is configured.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 71b7a

The PR adds the required Jam upload origin to the connection policy and removes an ineffective Sentry setting; no actionable merge-blocking risk remains after 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 summarizes both main changes: allowing Jam uploads through CSP and removing the deprecated sendDefaultPii setting.
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 3 files. (2 skipped: 2 …
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.
Full details: Docstring Coverage

Explanation

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 3 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@Programcode
Programcode merged commit 79b65ca into main Sep 1, 2026
7 checks passed
@Programcode
Programcode deleted the fix/jam-csp-connect-src-and-sentry-datacollection branch September 1, 2026 15:06
Programcode added a commit that referenced this pull request Sep 6, 2026
* docs: rewrite plans around remaining work only

Rewrite eleven plans to cover only missing work, trim the bug backlog to
four reproducible items, add the PR #11 salvage plan, and delete completed
and obsolete plans.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: reconcile plans with merged work through PR #28

Delete five plans whose implementations shipped and were verified against
origin/main at 79b65ca: admin announcements (#19, #26), agent verification
loop (#21, #26, #27), analytics and error tracking (#16, #18, #22-#25, #28),
animation polish (#20), and search quality (#17).

Trim the Supabase staging plan to the admin environment switcher, the only
unshipped code in it. Refresh snapshot headers on the remaining plans after
confirming PRs #16-#28 did not touch their scope, and re-verify all four
bug backlog items and their line references.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: bump dependencies, GitHub Actions, and CI tool versions

Upgrades react-router-dom (6->7), pdfjs-dist (5->6), @capacitor/cli,
Deno/Supabase CLI versions in CI, and pins Actions to their latest
major releases (checkout, setup-node, upload/download-artifact,
Docker actions). Updates tests and the Deno assert shim import for
the router v7 API and jsr:@std/assert.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Programcode added a commit that referenced this pull request Sep 6, 2026
* docs: rewrite plans around remaining work only

Rewrite eleven plans to cover only missing work, trim the bug backlog to
four reproducible items, add the PR #11 salvage plan, and delete completed
and obsolete plans.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: reconcile plans with merged work through PR #28

Delete five plans whose implementations shipped and were verified against
origin/main at 79b65ca: admin announcements (#19, #26), agent verification
loop (#21, #26, #27), analytics and error tracking (#16, #18, #22-#25, #28),
animation polish (#20), and search quality (#17).

Trim the Supabase staging plan to the admin environment switcher, the only
unshipped code in it. Refresh snapshot headers on the remaining plans after
confirming PRs #16-#28 did not touch their scope, and re-verify all four
bug backlog items and their line references.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: rebuild project documentation

* fix: address documentation review findings

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 71b7ad13 Deployed Sep 1, 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