feat(error-tracking): read and write autocapture opt-in from settings (phase 2) - #70970
feat(error-tracking): read and write autocapture opt-in from settings (phase 2)#70970ablaszkiewicz wants to merge 2 commits into
Conversation
👀 Auto-assigned reviewersThese soft owners were skipped because they only have minor changes here. Nothing blocks merge, so self-assign if you'd like a look:
Soft owners come from each directory's |
|
Reviews (1): Last reviewed commit: "chore(error-tracking): drop redundant au..." | Re-trigger Greptile |
🤖 CI report
|
| File | Size | Δ vs base |
|---|---|---|
render-query/src/render-query/render-query.js |
21.33 MiB | 🔺 +2.8 KiB (+0.0%) |
exporter/src/lib/components/ActivityLog/describers.js |
129.4 KiB | 🔺 +1.2 KiB (+0.9%) |
posthog-app/src/lib/components/ActivityLog/describers.js |
132.2 KiB | 🔺 +1.2 KiB (+0.9%) |
Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report
✅ Eager graph — within budget
How much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy import() / React.lazy chunks are not counted.
| Root | Eager (shipped) | Δ vs base | Budget |
|---|---|---|---|
entry (logged-out pages, app bootstrap)src/index.tsx |
1.23 MiB · 22 files | no change | ███░░░░░░░ 28.6% of 4.29 MiB |
authenticated shell (every logged-in page)src/scenes/AuthenticatedShell.tsx |
8.16 MiB · 2,988 files | 🔺 +50 B (+0.0%) | █████████░ 88.2% of 9.25 MiB |
🟢 node_modules/monaco-editor/ stays out of src/index.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 node_modules/monaco-editor/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
Largest files eagerly shipped from src/index.tsx
| Size | File |
|---|---|
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 24.6 KiB | ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js |
| 6.3 KiB | ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js |
| 4.5 KiB | ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js |
| 3.9 KiB | ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js |
| 1.4 KiB | ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js |
| 1.3 KiB | src/RootErrorBoundary.tsx |
| 912 B | ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js |
| 789 B | src/scenes/ChunkLoadErrorBoundary.tsx |
| 762 B | src/index.tsx |
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
| Size | File |
|---|---|
| 281.3 KiB | ../node_modules/.pnpm/posthog-js@1.404.0/node_modules/posthog-js/dist/rrweb.js |
| 267.7 KiB | ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 235.5 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 223.2 KiB | ../node_modules/.pnpm/posthog-js@1.404.0/node_modules/posthog-js/dist/module.js |
| 164.0 KiB | src/queries/validators.js |
| 154.3 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 105.8 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
| 93.2 KiB | ../packages/quill/packages/quill/dist/index.js |
Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479
✅ Dist folder size — 🔺 +175.0 KiB (+0.0%)
Total size of the built frontend/dist folder (all assets), compared against the base branch.
Total: 1341.79 MiB · 🔺 +175.0 KiB (+0.0%)
ℹ️ MCP UI apps size — 31 app(s), 16602.7 KB JS
Built size of each MCP UI app (main.js + styles.css).
| App | JS | CSS |
|---|---|---|
| debug | 599.5 KB | 187.4 KB |
| action | 457.8 KB | 187.4 KB |
| action-list | 564.3 KB | 187.4 KB |
| cohort | 456.8 KB | 187.4 KB |
| cohort-list | 563.3 KB | 187.4 KB |
| email-template | 456.6 KB | 187.4 KB |
| error-details | 472.4 KB | 187.4 KB |
| error-issue | 457.5 KB | 187.4 KB |
| error-issue-list | 564.2 KB | 187.4 KB |
| experiment | 561.5 KB | 187.4 KB |
| experiment-list | 565.1 KB | 187.4 KB |
| experiment-results | 563.2 KB | 187.4 KB |
| feature-flag | 567.1 KB | 187.4 KB |
| feature-flag-list | 570.9 KB | 187.4 KB |
| feature-flag-testing | 461.0 KB | 187.4 KB |
| insight-actors | 562.1 KB | 187.4 KB |
| invite-email-preview | 456.0 KB | 187.4 KB |
| llm-costs | 559.5 KB | 187.4 KB |
| session-recording | 458.6 KB | 187.4 KB |
| session-summary | 463.9 KB | 187.4 KB |
| survey | 458.4 KB | 187.4 KB |
| survey-global-stats | 562.2 KB | 187.4 KB |
| survey-list | 565.0 KB | 187.4 KB |
| survey-stats | 562.2 KB | 187.4 KB |
| trace-span | 457.2 KB | 187.4 KB |
| trace-span-list | 564.2 KB | 187.4 KB |
| workflow | 457.1 KB | 187.4 KB |
| workflow-list | 563.7 KB | 187.4 KB |
| query-results | 744.8 KB | 187.4 KB |
| render-ui | 825.3 KB | 187.4 KB |
| visual-review-snapshots | 461.6 KB | 187.4 KB |
✅ ClickHouse migration SQL — none
No ClickHouse migrations in the latest push.
🦔 Hogbox preview · ✅ ready▶ Open the preview
commit |
PR overviewThis pull request adds support for reading and writing the exception autocapture opt-in setting through the error tracking settings endpoint. It updates the settings presentation layer so the autocapture preference can be managed alongside other error tracking settings. One authorization issue remains open: the new write path allows users with error-tracking write/editor access to enable exception autocapture, whereas the prior control required project admin privileges. This could let a non-admin project member change deployed SDK telemetry behavior and cause exception data to be collected without the intended administrative approval. No issues have been fixed yet, so the PR still needs an access-control adjustment before it is in a safer state. Open issues (1)
Fixed/addressed: 0 · PR risk: 6/10 |
|
@PostHog/team-error-tracking I increased scope of this PR to also include writes. This is safe as we have double writes on both sides (if you update it via team, it propagates to ET settings and vice versa but without infinite loop lol) so this will be safe as pods start rolling out |
|
👋 Visual changes detected for this PR. Review and approve in PostHog Visual Review If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix. |
e7730d4 to
92f550c
Compare
Move autocapture exceptions opt-in reads to ErrorTrackingSettings with dual writes back to Team, drop the team fallback, and update generated API types and describers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
92f550c to
125eeb4
Compare
|
You're right — I conflated the model's |
… rebuild Mirror autocapture opt-in onto the deprecated Team column via a queryset update() instead of Team.save(). Saving Team fired its post_save mirror back into ErrorTrackingSettings, doubling the write and dispatching a second remote config rebuild. The settings row is the source of truth and already triggers the rebuild, matching the rebuild-hangs-off-this-model comment. Also narrow log.detail before indexing in the activity test to satisfy mypy. Generated-By: PostHog Code Task-Id: a8d3ae8f-8131-4930-810f-7e773786ed84
|
Heads-up on CI: the 🦉 via talyn.dev |
move reads to the new table. Do dual writes
Ran backfills both in EU and US today and there's no drift