Skip to content

feat(node)!: normalize configuration casing and narrow event options - #5757

Merged
dustinbyrne merged 4 commits into
capture-v1from
refactor/node-v6-camel-case
Nov 17, 2026
Merged

dustinbyrne merged 4 commits into
capture-v1from
refactor/node-v6-camel-case

Conversation

@dustinbyrne

@dustinbyrne dustinbyrne commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The Node 6 release is an opportunity to make SDK configuration consistently camelCase and catch invalid event-option values in TypeScript.

Changes

  • Rename before_send → beforeSend, custom_blocked_useragents → customBlockedUserAgents, disable_capture_url_hashes → disableCaptureUrlHashes, and __preview_capture_bot_pageviews → __previewCaptureBotPageviews.
  • Use an explicit EventOptions type across event, exception, alias, context, registration, prepared-event, and hook APIs: explicit boolean fields for known options, with JSDoc and a string index signature for additional JSON-valued options.
  • Preserve snake_case wire options and runtime serialization. Shared core/browser/React Native configuration is unchanged.
  • Update the migration guide, generated 6.x reference, MCP's Node 6 hook tests/documentation, and compliance/Next.js test consumers of the hook.

Targets capture-v1 (#5407); these are breaking API changes for the upcoming Node 6 major release. Includes a major changeset. The affected capture/before-send behavior remains unchanged relative to the release branch.

Validation

  • Node production/public type checks, including accepted additional JSON options and rejected invalid known-option/configuration values.
  • Node unit suite: 3,366 tests passed.
  • Edge compatibility suite: 3,366 tests passed.
  • MCP type checks and focused lib-identity suite: 9 tests passed.
  • Built ESM/CommonJS public-entry smoke checks: hook filtering, custom bot handling, and snake_case event-option delivery.
  • Next.js release fixture: the old hook name misses the captured exception; the updated fixture captures and drops it before transport.
  • Node lint, changed-file formatting, and git diff --check.

Release info

  • posthog-node — major (part of the Node 6 release).

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Implemented with Pi and independently inspected by a fresh read-only reviewer. Human review is required before merge.

@dustinbyrne
dustinbyrne requested a review from a team as a code owner November 17, 2026 00:58
@dustinbyrne
dustinbyrne requested a review from a team as a code owner November 17, 2026 00:58
@dustinbyrne dustinbyrne self-assigned this Nov 17, 2026
@veria-ai

veria-ai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

PR overview

The PR normalizes Node client configuration names to camelCase and narrows event options, including changing the event hook option from before_send to beforeSend.

One compatibility issue remains open: legacy configuration names are silently ignored for JavaScript callers and TypeScript callers that bypass strict typing. Applications upgrading without renaming before_send can stop filtering or redacting events and send previously excluded data to PostHog unchanged. No issues have been addressed yet.

Open issues (1)

Fixed/addressed: 0 · PR risk: 4/10

Reviews

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Possible changeset mismatch — 2 undeclared

This is informational — the PR is not blocked. Click the triangle above to collapse, or push a fix and this comment will auto-delete.

Modified in this PR but not in any changeset:

  • @posthog/mcp
  • @posthog/nextjs-config

If this package should ship the change, add it to the changeset frontmatter:

---
"@posthog/mcp": patch
"@posthog/nextjs-config": patch
---

Changesets in this PR:

  • posthog-node — major

@posthog-security-review-bot posthog-security-review-bot Bot added the security-review Request a security review label Nov 17, 2026
@posthog-security-review-bot

posthog-security-review-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

✅ Security review complete — 4ee1f6a72f46

1 finding posted as a review, in 6 min.

Add the security-review label to run again on the latest commit.

stamphog[bot]

This comment was marked as outdated.

// is not an error.
private _runBeforeSend(eventMessage: EventMessage, onError?: () => void): EventMessage | null {
const beforeSend = this.options.before_send
const beforeSend = this.options.beforeSend

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low: Legacy before_send silently ignored, so redaction hooks stop running

The client now reads only this.options.beforeSend, and the constructor (lines 496-519) just spreads options without checking for the old names. A JavaScript app, or a TypeScript app whose config is typed any or cast, that upgrades and still passes before_send gets no error and no warning. Its hook stops running, and events it used to drop or scrub go to PostHog unchanged. TypeScript catches this only for strictly typed callers. The same applies to disable_capture_url_hashes: the old name is silently ignored, so URL fragments are no longer stripped from captured request URLs.

The constructor already warns when POSTHOG_CAPTURE_MODE is set (warnIfCaptureModeSet). Doing the same here would surface the rename: if before_send, disable_capture_url_hashes, custom_blocked_useragents, or __preview_capture_bot_pageviews is present in options, call console.error, not the debug-only logger. Since before_send is the documented way to redact data, consider failing closed instead: disable the client, or map the old name to the new one for one major version, rather than sending events the app expects to be filtered.

@github-actions

Copy link
Copy Markdown
Contributor

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 (*.spec.md). A spec file lists the rules for one part of the code.

This check read 44 parts of the code and 7 rules.

Tip

Nothing to fix.

@posthog-security-review-bot posthog-security-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agent-driven security review - findings inline.

// is not an error.
private _runBeforeSend(eventMessage: EventMessage, onError?: () => void): EventMessage | null {
const beforeSend = this.options.before_send
const beforeSend = this.options.beforeSend

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The renamed before_send hook is silently ignored at runtime, so a 5.x-style redaction or drop hook fails open and every event is sent unfiltered

low privacy (fail-open config; defence-in-depth) (confidence 4/5)

Details

PostHogBackendClient._runBeforeSend (packages/node/src/client.ts:4375) now reads only this.options.beforeSend. The constructor (client.ts:496-514) spreads the caller's options into this.options as given. Nothing in packages/node/src reads before_send, disable_capture_url_hashes, custom_blocked_useragents or __preview_capture_bot_pageviews any more, and nothing warns when one of them is passed. TypeScript rejects the old names only in a fresh object literal (src/__tests__/types/event-options.ts). A JavaScript caller, or a config that is spread or built elsewhere, still passes them and loses them without any message.

before_send is the SDK's documented control for redacting or dropping sensitive events, and this file treats it as one. A hook that throws fails closed and drops the event (client.ts:4393-4399). A hook passed under its 5.x name fails open: it never runs, and every event goes out unfiltered. In the same way, disable_capture_url_hashes: true is ignored, so express.ts:48, fetch-request.ts:113 and nestjs.ts:114 keep URL fragments in $current_url. That matters less on the server, where clients rarely send fragments.

This PR's own update missed two JavaScript consumers in this repo, and both show the failure:

  • compliance/node/adapter.mjs:219 still sets before_send on the workspace build.
  • packages/nextjs-config/tests/integration/app/pages/api/release.js:7 sets before_send(){ return null } next to a fetch that "must never send analytics requests". run.mjs:160 packs the current workspace posthog-node, so after this change that event is no longer dropped and reaches fetch.

Impact — A JS integrator upgrades to 6.x with new PostHog(key, { before_send: scrubPII }), a config shape still shown in the 5.x Node docs. The emails, tokens or whole events that the hook was removing are then sent to the PostHog project and stored there, and no warning appears. No attacker is needed. What still holds: the TypeScript literal check, and the major version bump with its migration guide. So this is a defence-in-depth gap, not a direct exposure path.

Fix — Detect the old names at construction, as warnIfCaptureModeSet() (client.ts:993) already does for a removed setting. For the privacy hook, consider failing closed:

const RENAMED_OPTIONS = {
  before_send: 'beforeSend',
  disable_capture_url_hashes: 'disableCaptureUrlHashes',
  custom_blocked_useragents: 'customBlockedUserAgents',
  __preview_capture_bot_pageviews: '__previewCaptureBotPageviews',
} as const
for (const [oldName, newName] of Object.entries(RENAMED_OPTIONS)) {
  if (oldName in options) {
    console.error(`[PostHog] \`${oldName}\` was renamed to \`${newName}\` in posthog-node 6 and is ignored.`)
  }
}

Also consider disabling the client, or throwing, when before_send is set and beforeSend is not, so a redaction hook is never skipped without notice. Separately, update the two in-repo fixtures above.

Agent-driven security review. Traced statically end to end. No runtime probe was run, because the sandbox has no built dist or installed dependencies.

@posthog-security-review-bot posthog-security-review-bot Bot removed the security-review Request a security review label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Node SDK compliance v2

Commit: 048af60
Workflow run and artifacts

Capture v1 — acceptance

✅ 289 passed / ❌ 8 non-passing / ⚠️ 1136 not selected

Drill-down: run artifacts → node-v2-v1 → acceptance/report.json.diagnostics.json (match case_id below).

❌ server_snapshot_payload_false — failed_assertion

Expected native data result

Code: snapshot_result

Failed step: acceptance/public/evaluate-flags.feature:868

the public snapshot outcomes should have these semantics:
❌ server_snapshot_payload_zero — failed_assertion

Expected native data result

Code: snapshot_result

Failed step: acceptance/public/evaluate-flags.feature:868

the public snapshot outcomes should have these semantics:
❌ server_snapshot_payload_null — failed_assertion

Expected native data result

Code: snapshot_result

Failed step: acceptance/public/evaluate-flags.feature:868

the public snapshot outcomes should have these semantics:
❌ migration/yaml-parity-v1/remote-flags-v1.feature::Omitted GeoIP settings default to enabled in flag requests — failed_assertion

Flags field differs

Code: flag_request_field

Failed step: migration/yaml-parity-v1/remote-flags-v1.feature:135

the first flags request field "geoip_disable" should equal JSON false

Operation: /flags/

Field: geoip_disable

Expected:

false

Actual value:

true

❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.dependency_error — failed_assertion

Getter value differs

Code: flag_value

Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1174

the public flag getter should return exactly JSON false

Operation: /get_feature_flag

Arguments:

{"key":"garden-layout","distinct_id":"flags-v4-person"}

Expected:

false

Actual outcome: undefined

❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.error — failed_assertion

Getter value differs

Code: flag_value

Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1213

the public flag getter should return exactly JSON false

Operation: /get_feature_flag

Arguments:

{"key":"garden-layout","distinct_id":"flags-v4-person"}

Expected:

false

Actual outcome: undefined

❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.error_with_value — failed_assertion

Getter value differs

Code: flag_value

Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1252

the public flag getter should return exactly JSON false

Operation: /get_feature_flag

Arguments:

{"key":"garden-layout","distinct_id":"flags-v4-person"}

Expected:

false

Actual outcome: undefined

❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.v1_failed — failed_assertion

Getter value differs

Code: flag_value

Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1425

the public flag getter should return exactly JSON false

Operation: /get_feature_flag

Arguments:

{"key":"garden-layout","distinct_id":"flags-v4-person"}

Expected:

false

Actual outcome: undefined

Harness exit: 1; report validation exit: 1.

Capture v1 — migration

✅ 261 passed / ❌ 5 non-passing / ⚠️ 42 not selected

Drill-down: run artifacts → node-v2-v1 → reports/report.json.diagnostics.json (match case_id below).

❌ migration/yaml-parity-v1/remote-flags-v1.feature::Omitted GeoIP settings default to enabled in flag requests — failed_assertion

Flags field differs

Code: flag_request_field

Failed step: migration/yaml-parity-v1/remote-flags-v1.feature:135

the first flags request field "geoip_disable" should equal JSON false

Operation: /flags/

Field: geoip_disable

Expected:

false

Actual value:

true

❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.dependency_error — failed_assertion

Getter value differs

Code: flag_value

Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1174

the public flag getter should return exactly JSON false

Operation: /get_feature_flag

Arguments:

{"key":"garden-layout","distinct_id":"flags-v4-person"}

Expected:

false

Actual outcome: undefined

❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.error — failed_assertion

Getter value differs

Code: flag_value

Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1213

the public flag getter should return exactly JSON false

Operation: /get_feature_flag

Arguments:

{"key":"garden-layout","distinct_id":"flags-v4-person"}

Expected:

false

Actual outcome: undefined

❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.error_with_value — failed_assertion

Getter value differs

Code: flag_value

Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1252

the public flag getter should return exactly JSON false

Operation: /get_feature_flag

Arguments:

{"key":"garden-layout","distinct_id":"flags-v4-person"}

Expected:

false

Actual outcome: undefined

❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.v1_failed — failed_assertion

Getter value differs

Code: flag_value

Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1425

the public flag getter should return exactly JSON false

Operation: /get_feature_flag

Arguments:

{"key":"garden-layout","distinct_id":"flags-v4-person"}

Expected:

false

Actual outcome: undefined

Harness exit: 1; report validation exit: 1.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

SDK performance: posthog-node

1 change worth reviewing: 1 observed regression.

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.

Test Measurement Before PR With PR Change
Evaluate a flag (late match) Time per operation 48.78 µs/op 51.33 µs/op 5.2% more time
View all results
Test Measurement Before PR With PR Change Assessment
Capture and deliver events (32-byte payload, burst)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Capture and deliver events (32-byte payload, steady)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Queue an event (32-byte payload)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Queue an event (4,096-byte payload)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate all 10 flags
Shard: flags-scaling
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate all 100 flags
Shard: flags-scaling
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate all 1,000 flags
Shard: flags-scaling
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate one boolean flag
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a cohort-filtered flag
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a flag (early match)
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a flag (late match)
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a flag (no match)
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a property-filtered flag
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a regex-filtered flag
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a rollout flag
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Evaluate a multivariate flag
Shard: flags-single
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ V8 samples do not expose total allocation count; sample count is not object count.​; head:​ V8 samples do not expose total allocation count; sample count is not object count.​
Capture and deliver events (32-byte payload, burst)
Shard: capture
Allocated memory per operation (estimated) 17.05 KiB/op 17.44 KiB/op 2.3% more memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Time per operation 25.45 µs/op 25.55 µs/op 0.4% more time Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Idle process memory (RSS) 103.74 MiB 103.84 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Observed peak process memory (RSS) 109.33 MiB 109.38 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Managed heap after settling 10.59 MiB 10.59 MiB <0.1% less memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Process memory after settling (RSS) 108.99 MiB 109.02 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Process CPU time per operation 43.6 µs/op 43.69 µs/op 0.2% more time Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Lifetime peak process memory (RSS) 109.46 MiB 109.53 MiB <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Allocated memory per operation (estimated) 33.22 KiB/op 32.52 KiB/op 2.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Time per operation 37.15 µs/op 37.13 µs/op <0.1% less time Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Idle process memory (RSS) 106.52 MiB 106.35 MiB 0.2% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Observed peak process memory (RSS) 128.8 MiB 129.12 MiB 0.3% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Managed heap after settling 10.6 MiB 10.6 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Process memory after settling (RSS) 120.53 MiB 120.8 MiB 0.2% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Process CPU time per operation 56.49 µs/op 56.49 µs/op <0.1% less time Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Lifetime peak process memory (RSS) 128.8 MiB 129.12 MiB 0.3% more memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Allocated memory per operation (estimated) 17 KiB/op 16.69 KiB/op 1.8% less memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Time per operation 22.99 µs/op 22.92 µs/op 0.3% less time Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Idle process memory (RSS) 103.94 MiB 103.82 MiB 0.1% less memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Observed peak process memory (RSS) 109.17 MiB 109.05 MiB 0.1% less memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Managed heap after settling 10.76 MiB 10.76 MiB <0.1% less memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Process memory after settling (RSS) 109.19 MiB 108.9 MiB 0.3% less memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Process CPU time per operation 40.49 µs/op 40.52 µs/op <0.1% more time Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Lifetime peak process memory (RSS) 109.17 MiB 109.08 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Allocated memory per operation (estimated) 32.36 KiB/op 31.99 KiB/op 1.2% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Time per operation 34.46 µs/op 33.41 µs/op 3% less time Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Idle process memory (RSS) 106.17 MiB 106.29 MiB 0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Observed peak process memory (RSS) 117.63 MiB 117.75 MiB 0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Managed heap after settling 10.77 MiB 10.76 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Process memory after settling (RSS) 115.21 MiB 115.3 MiB <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Process CPU time per operation 52.8 µs/op 51.52 µs/op 2.4% less time Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Lifetime peak process memory (RSS) 117.63 MiB 117.75 MiB 0.1% more memory Not flagged
Queue an event (32-byte payload)
Shard: capture
Allocated memory per operation (estimated) 13.96 KiB/op 13.82 KiB/op 1.1% less memory Not flagged
Queue an event (32-byte payload)
Shard: capture
Time per operation 18.24 µs/op 17.73 µs/op 2.8% less time Not flagged
Queue an event (32-byte payload)
Shard: capture
Process CPU time per operation 35.05 µs/op 34.15 µs/op 2.6% less time Not flagged
Queue an event (4,096-byte payload)
Shard: capture
Allocated memory per operation (estimated) 18.03 KiB/op 17.67 KiB/op 2% less memory Not flagged
Queue an event (4,096-byte payload)
Shard: capture
Time per operation 24.01 µs/op 23.63 µs/op 1.6% less time Not flagged
Queue an event (4,096-byte payload)
Shard: capture
Process CPU time per operation 41.1 µs/op 41.12 µs/op <0.1% more time Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Allocated memory per operation (estimated) 132.63 KiB/op 132.05 KiB/op 0.4% less memory Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Time per operation 127.29 µs/op 127.27 µs/op <0.1% less time Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Process CPU time per operation 233.03 µs/op 233.6 µs/op 0.2% more time Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Allocated memory per operation (estimated) 1.23 MiB/op 1.21 MiB/op 0.9% less memory Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Time per operation 1.05 ms/op 1.04 ms/op 0.6% less time Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Process CPU time per operation 1.83 ms/op 1.82 ms/op 0.6% less time Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Allocated memory per operation (estimated) 12.1 MiB/op 12.13 MiB/op 0.3% more memory Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Time per operation 11.39 ms/op 11.45 ms/op 0.5% more time Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Process CPU time per operation 18.25 ms/op 18.3 ms/op 0.3% more time Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Idle process memory (RSS) 286.8 MiB 286.27 MiB 0.2% less memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Observed peak process memory (RSS) 297.41 MiB 297.1 MiB 0.1% less memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Managed heap after settling 9.91 MiB 9.9 MiB <0.1% less memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Process memory after settling (RSS) 297.34 MiB 297.1 MiB <0.1% less memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Lifetime peak process memory (RSS) 297.68 MiB 297.4 MiB <0.1% less memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Idle process memory (RSS) 222.2 MiB 228 MiB 2.6% more memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Observed peak process memory (RSS) 237.79 MiB 240.31 MiB 1.1% more memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Managed heap after settling 11.99 MiB 11.99 MiB <0.1% less memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Process memory after settling (RSS) 233.55 MiB 234.75 MiB 0.5% more memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Lifetime peak process memory (RSS) 240.5 MiB 241.63 MiB 0.5% more memory Not flagged
Evaluate one boolean flag
Shard: flags-single
Allocated memory per operation (estimated) 17.03 KiB/op 17.13 KiB/op 0.6% more memory Not flagged
Evaluate one boolean flag
Shard: flags-single
Time per operation 86.79 µs/op 86.25 µs/op 0.6% less time Not flagged
Evaluate one boolean flag
Shard: flags-single
Process CPU time per operation 95.5 µs/op 94.79 µs/op 0.7% less time Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Allocated memory per operation (estimated) 14.12 KiB/op 14.26 KiB/op 0.9% more memory Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Time per operation 48.43 µs/op 50.1 µs/op 3.4% more time Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Process CPU time per operation 57.57 µs/op 60.04 µs/op 4.3% more time Not flagged
Evaluate a flag (early match)
Shard: flags-single
Allocated memory per operation (estimated) 17.74 KiB/op 17.48 KiB/op 1.5% less memory Not flagged
Evaluate a flag (early match)
Shard: flags-single
Time per operation 48.45 µs/op 48.62 µs/op 0.3% more time Not flagged
Evaluate a flag (early match)
Shard: flags-single
Process CPU time per operation 56.87 µs/op 57.13 µs/op 0.5% more time Not flagged
Evaluate a flag (late match)
Shard: flags-single
Allocated memory per operation (estimated) 22.32 KiB/op 22.28 KiB/op 0.2% less memory Not flagged
Evaluate a flag (late match)
Shard: flags-single
Time per operation 48.78 µs/op 51.33 µs/op 5.2% more time Worth reviewing: observed regression
Evaluate a flag (late match)
Shard: flags-single
Process CPU time per operation 57.01 µs/op 60.41 µs/op 6% more time Not flagged
Evaluate a flag (no match)
Shard: flags-single
Allocated memory per operation (estimated) 16.96 KiB/op 16.89 KiB/op 0.4% less memory Not flagged
Evaluate a flag (no match)
Shard: flags-single
Time per operation 5.78 µs/op 5.74 µs/op 0.7% less time Not flagged
Evaluate a flag (no match)
Shard: flags-single
Process CPU time per operation 10.41 µs/op 10.36 µs/op 0.5% less time Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Allocated memory per operation (estimated) 12.63 KiB/op 12.64 KiB/op 0.1% more memory Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Time per operation 47.57 µs/op 48.61 µs/op 2.2% more time Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Process CPU time per operation 56 µs/op 57.56 µs/op 2.8% more time Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Allocated memory per operation (estimated) 18.36 KiB/op 18.15 KiB/op 1.1% less memory Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Time per operation 89.8 µs/op 93.71 µs/op 4.4% more time Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Process CPU time per operation 99.53 µs/op 104.34 µs/op 4.8% more time Not flagged
Evaluate a rollout flag
Shard: flags-single
Allocated memory per operation (estimated) 14.32 KiB/op 14.37 KiB/op 0.3% more memory Not flagged
Evaluate a rollout flag
Shard: flags-single
Time per operation 67.52 µs/op 67.87 µs/op 0.5% more time Not flagged
Evaluate a rollout flag
Shard: flags-single
Process CPU time per operation 76.12 µs/op 77.09 µs/op 1.3% more time Not flagged
Evaluate a multivariate flag
Shard: flags-single
Allocated memory per operation (estimated) 17.44 KiB/op 17.44 KiB/op <0.1% less memory Not flagged
Evaluate a multivariate flag
Shard: flags-single
Time per operation 90.14 µs/op 87.45 µs/op 3% less time Not flagged
Evaluate a multivariate flag
Shard: flags-single
Process CPU time per operation 100.02 µs/op 97.02 µs/op 3% less time Not flagged

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 8f310b87ce759f25d0b68b985acf9f5e9b00b3cf → 31db5d2ada5b49443bc66b06767f3870eb198eea.

Full report and diagnostics

102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in comparison.json, including per-runner environments, resource limits, measurement methods, samples and checkpoints.

@stamphog
stamphog Bot dismissed their stale review November 17, 2026 04:09

A new stamphog review started for this PR — the fresh verdict replaces this approval.

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approved — this change needs a human reviewer.

Re-add the stamphog label to request another review once you have addressed this.

Both reviewers' privacy concerns remain unaddressed in the current code, and no current-head review covers the public API and privacy-sensitive changes. Address the client.ts findings, then request review from Eli Reisman, Vincent (Wen Yu) Ge, or another teammate before re-requesting.

  • Author wrote 4% of the modified lines and has 92 merged PRs in these paths (familiarity MODERATE).
  • @veria-ai on packages/node/src/client.ts: the constructor preserves caller options without translating or rejecting legacy keys, while _runBeforeSend reads only the renamed hook and returns the event unchanged when it is absent. Legacy JavaScript redaction/drop hooks therefore stop running; the request integrations likewise read only the renamed URL-fragment setting. Add runtime compatibility or fail-closed handling and regression tests before re-requesting.
  • @posthog-security-review-bot on packages/node/src/client.ts: the older review's privacy concern remains present in the current code: legacy hook configuration can allow previously filtered events to be transmitted unchanged. Address that inline finding and obtain a fresh review before re-requesting.
Gate mechanics and policy version
Gate Result
prerequisites ✓ all clear
deny-list ✓ no deny categories matched
every_file_attested ✓ not a bot PR
size ✓ 136L, 11F substantive, 728L/32F incl. docs/generated/snapshots — within ceiling
tier ✓ T1-agent / T1d-complex (728L, 32F, two-areas, feat)
stamphog 2.9.0 .stamphog/policy.yml @ fbf9bff · reviewed head fbf9bff

@stamphog stamphog Bot removed the stamphog label Nov 17, 2026
@dustinbyrne
dustinbyrne merged commit f274c6f into capture-v1 Nov 17, 2026
77 of 80 checks passed
@dustinbyrne
dustinbyrne deleted the refactor/node-v6-camel-case branch November 17, 2026 15:49
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.

2 participants