Repository navigation
fix(browser): omit event name from bot filter console warning - #5774
DanielVisca wants to merge 2 commits into
Conversation
The warning is always shown, outside debug mode, so it should not echo a customer-chosen event name to the console. The debug-only logger.info line still names each dropped event. Generated-By: PostHog Desktop Task-Id: 1eaa1345-36ae-488b-a7c9-9440bc741632
|
✅ Security review complete — No findings above the confidence threshold, in 4 min. Add the |
Replay incident risk checkThis diff touches code involved in past incidents. This is a heads-up, not a verdict: read the matched sections of INCIDENTS.md and answer their review questions before merging. For a judgment on whether this diff has the same failure mode, run the |
Coherence📄 0 spec file errors · ⛔ 0 broken rules · 🚪 0 unchecked inputs · 🐛 0 bugs that came back What is Coherence?Coherence compares the code with its spec files ( This check read 44 parts of the code and 7 rules. Tip Nothing to fix. |
|
Size Change: -527 B (0%) Total Size: 27.6 MB 📦 View Changed
ℹ️ View Unchanged
|
posthog-js Compliance ReportDate: 2026-11-17 22:02:26 UTC ✅ All Tests Passed!26/26 tests passed Capture Tests✅ 26/26 tests passed View Details
|
SDK performance: posthog-nodeBenchmarks completed. No changes flagged for review. Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate. View all results
Values are medians of paired measurements. Not flagged does not mean unchanged. Unavailable means a measurement could not be provided, not zero. Estimated allocation measurements retain their instrumentation uncertainty. RSS measures the whole process, not just SDK allocations; observed peaks are sampled checkpoints. Paired ranges in the diagnostics describe variability, not confidence intervals. Each shard uses its own runner; compare Before PR against With PR within a row, not across shards. Compared 102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in |
Problem
Follow-up to #5595, answering its open review thread. The "events are being dropped because the user agent looks like a bot" console warning is always shown, not only in debug mode, and it included the first dropped event's name. Event names are chosen by the customer and can be sensitive, for example when console-log autocapture records the console, so the unconditional warning should not repeat them.
Changes
(first dropped event: "<name>")from the one-timeconsole.warn. The rest of the message is unchanged. The debug-onlylogger.infoline still names each dropped event.posthog-js.Validation:
pnpm exec vitest run src/__tests__/posthog-core-also.test.tsinpackages/browser: the new assertion fails without the fix and all 142 tests pass with it. The sandbox has Node 26, so this neededNODE_OPTIONS=--no-experimental-webstorage.dist/array.jsand 5 captures: exactly one warning, with no event name in it, and 0 capture requests. Withopt_out_useragent_filter: true: no warning and 6 capture requests.Release info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Claude Code, running as the shepherd for #5595, made this change. Daniel asked for it after the production checks on #5595 showed the shipped warning still included the event name. Edits from a stale pre-merge worktree were discarded, and the change was made fresh on current
main. The test was written first and failed before the fix was applied.🤖 Generated with Claude Code
Created with PostHog Desktop from a PostHog Desktop task