Repository navigation
chore: sync main into capture-v1, restore lockfile versions, keep custom-encoded nested values whole (DO NOT SQUASH) - #5756
Conversation
capture-v1 had re-resolved read-yaml-file's js-yaml to 3.15.1 (GHSA-2883-xcg3-v3hh) and three @babel/parser entries to 7.29.8, below main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
✅ Security review complete — No findings above the confidence threshold, in 3 min. Add 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: +568 B (0%) Total Size: 27.6 MB 📦 View Changed
ℹ️ View Unchanged
|
Node SDK compliance v2Commit: a06d825 Capture v1 — acceptance✅ 289 passed / ❌ 8 non-passing / Drill-down: run artifacts → ❌ server_snapshot_payload_false — failed_assertionExpected native data result Code: Failed step: acceptance/public/evaluate-flags.feature:868 the public snapshot outcomes should have these semantics: ❌ server_snapshot_payload_zero — failed_assertionExpected native data result Code: Failed step: acceptance/public/evaluate-flags.feature:868 the public snapshot outcomes should have these semantics: ❌ server_snapshot_payload_null — failed_assertionExpected native data result Code: 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_assertionFlags field differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v1.feature:135 the first flags request field "geoip_disable" should equal JSON false Operation: Field: Expected: false Actual value: true ❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.dependency_error — failed_assertionGetter value differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1174 the public flag getter should return exactly JSON false Operation: Arguments: {"key":"garden-layout","distinct_id":"flags-v4-person"}
Expected: false Actual outcome: ❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.error — failed_assertionGetter value differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1213 the public flag getter should return exactly JSON false Operation: Arguments: {"key":"garden-layout","distinct_id":"flags-v4-person"}
Expected: false Actual outcome: ❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.error_with_value — failed_assertionGetter value differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1252 the public flag getter should return exactly JSON false Operation: Arguments: {"key":"garden-layout","distinct_id":"flags-v4-person"}
Expected: false Actual outcome: ❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.v1_failed — failed_assertionGetter value differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1425 the public flag getter should return exactly JSON false Operation: Arguments: {"key":"garden-layout","distinct_id":"flags-v4-person"}
Expected: false Actual outcome: Harness exit: 1; report validation exit: 1. Capture v1 — migration✅ 261 passed / ❌ 5 non-passing / Drill-down: run artifacts → ❌ migration/yaml-parity-v1/remote-flags-v1.feature::Omitted GeoIP settings default to enabled in flag requests — failed_assertionFlags field differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v1.feature:135 the first flags request field "geoip_disable" should equal JSON false Operation: Field: Expected: false Actual value: true ❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.dependency_error — failed_assertionGetter value differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1174 the public flag getter should return exactly JSON false Operation: Arguments: {"key":"garden-layout","distinct_id":"flags-v4-person"}
Expected: false Actual outcome: ❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.error — failed_assertionGetter value differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1213 the public flag getter should return exactly JSON false Operation: Arguments: {"key":"garden-layout","distinct_id":"flags-v4-person"}
Expected: false Actual outcome: ❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.error_with_value — failed_assertionGetter value differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1252 the public flag getter should return exactly JSON false Operation: Arguments: {"key":"garden-layout","distinct_id":"flags-v4-person"}
Expected: false Actual outcome: ❌ migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature::Legacy getter reads reader fixture readers.v1_failed — failed_assertionGetter value differs Code: Failed step: migration/yaml-parity-v1/remote-flags-v4-legacy-getter.feature:1425 the public flag getter should return exactly JSON false Operation: Arguments: {"key":"garden-layout","distinct_id":"flags-v4-person"}
Expected: false Actual outcome: Harness exit: 1; report validation exit: 1. |
SDK performance: posthog-node1 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.
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 |
A $set, $set_once, $groups or $group_set value with its own toJSON is no longer merged with another layer's object, so its encoding is honored and the event's value wins whole. Merging copied its fields and could send ones its toJSON hides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reading toJSON to decide whether a nested value can be merged ran its getter outside the guard that turns unreadable caller values into a content-free drop. A getter that throws now marks the value as not mergeable, so serialization drops the event without logging the error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The paired benchmark runs the merge-base SDK through this branch's fixture. It now accepts legacy /batch/ posts again, answering in the legacy format, beside capture v1 posts, so the baseline is measured instead of failing. The receiver control covers both routes and their reply formats. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The posthog-node flag consistency tests evaluate 1,000 ids each and timed out at the 5 s default on a starved runner; the browser-next eager-delivery test waited 1 s for the first analytics import. Both get longer timeouts. Assertions are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin by digest. The capture v1 suites are unchanged from 1.26.0; the new release only adds feature flag contract tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 |
turnipdabeets
left a comment
There was a problem hiding this comment.
[suggestion] The same toJSON leak survives outside this diff, at packages/node/src/client.ts:4270:
eventProperties.$groups = isPlainObject(existingGroups) ? { ...existingGroups, ...groups } : { ...groups }A properties.$groups value with its own toJSON, combined with the groups option, is spread here, which sends the fields it hides. Can we route this through isMergeableObject too, so both merge paths follow the same rule? It came in with #5413, so it's unreleased as well, and a follow-up PR is fine.
#5757 renamed posthog-node's before_send option to beforeSend, so the before_send type contract case for node failed on capture-v1. Each SDK case now names its own hook option; browser and core keep before_send. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… toJSON The groups option merged into a $groups property with a spread. A value with its own toJSON passes isPlainObject (class instances do too), so the spread copied the fields its toJSON hides onto the wire. $groups now uses the same isMergeableObject rule as the layer fills: such a value is replaced by the typed groups, as any non-plain value already was. Unreleased 6.0 behavior (#5413), so no changeset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
📝 No Changeset FoundThis PR doesn't include a changeset. A changeset is required to release a new version. How to add a changesetRun this command and follow the prompts: pnpm changesetRemember: Never use |
Problem
capture-v1's lockfile resolves four dependencies belowmain. One of them,read-yaml-file'sjs-yaml3.15.1, is affected by GHSA-2883-xcg3-v3hh (fixed in 3.15.2, whichmainuses). Squashing #5407 would bring 3.15.1 back tomain.capture-v1is also onemaincommit behind (#5755), and has since moved with #5758, #5757 and #5767.Warning
Do not squash or merge this PR with the button. After approval it lands by fast-forwarding
capture-v1to this exact head, which keeps the merge commit.Changes
4e216de9fmergesmainatfce957b9a(fix(docusaurus): Release pending changes as 2.0.7 #5755 and its release commit). It changes onlypackages/docusaurusand has no conflicts.9bae3b677sets fourpnpm-lock.yamllines back tomain's versions:js-yaml3.15.2 forread-yaml-file, and@babel/parser7.29.9 for@vue/compiler-sfcand twoast-kitentries.pnpm install --lockfile-onlyleaves the file byte-identical, andpnpm install --frozen-lockfilepasses.main's version.54694c8dedeletes.changeset/genkit-redact-model-messages.md.mainreleased that fix in@posthog/ai8.18.5 (fix(ai): redact credentials in Genkit model messages #5556) and consumed its changeset;capture-v1's port (fix(ai): redact credentials in Genkit model messages (capture-v1) #5557) kept a copy under the same name, so the next release would list it again. A drychangeset versionon this branch otherwise gives posthog-node 6.0.0,@posthog/core1.69.0,@posthog/ai8.21.0,@posthog/mcp1.3.0,@posthog/next0.11.1 and@posthog/nuxt1.9.2, with no dependency range changes.bf525245ffixes a review finding on feat(node)!: posthog-node 6 on capture v1 #5407: when the event and another layer both set$set,$set_once,$groupsor$group_set, a value with its owntoJSONwas merged by copying its fields, which could send fields itstoJSONhides. Such a value is now never merged, so its encoding is honored and the event's value wins whole. A newlayers.spec.tscase fails without the fix; posthog-node unit tests 3367/3367 andcheck-typespass. No changeset: this is unreleased 6.0 behavior.daa498e03: atoJSONgetter that throws is left to serialization, which drops the event without logging its message (Veria finding on this PR).ef704b8e3: migration guide notes anull$geoip_disableand that objects with their owntoJSONare kept whole.87d9b0402: the paired benchmark fixture accepts the merge-base SDK's legacy/batch/again, answering in the legacy format, so feat(node)!: posthog-node 6 on capture v1 #5407's benchmark measures the baseline instead of failing. The receiver control covers both routes.ba45caf97: two CPU-heavy tests get longer timeouts (the posthog-node flag consistency suite at thedescribelevel, and one browser-nextwaitFor). Both failed only on starved CI runners today; assertions are unchanged.a2595f169mergescapture-v1at71e258e5a(feat(node)!: remove callback-free enterContext #5758, feat(node)!: normalize configuration casing and narrow event options #5757, fix(node): ship migration guide in the npm package #5767), so this PR fast-forwardscapture-v1again.packages/node/MIGRATION.md: keepscapture-v1'sbeforeSendwording and this branch'snull$geoip_disablesentence.capture-v1is byte-identical to this branch's change before the merge.check-types, lint and unit tests pass for posthog-node (3363/3363 on Node 24),@posthog/core,@posthog/aiand@posthog/mcp.d7b692491: thepackages/browserbefore-send-types.test.tsnode case checksbeforeSend, the option name feat(node)!: normalize configuration casing and narrow event options #5757 gave posthog-node 6; it failedUnit testsoncapture-v1withbefore_send. Browser and core cases keepbefore_send.a06d825e8: thegroupsoption no longer merges into a$groupsproperty that has its owntoJSON(review finding,client.ts:4272). Such a value passesisPlainObject, so the spread sent the fields itstoJSONhides; it now follows the sameisMergeableObjectrule as the layer fills and is replaced by the typed groups. A newlayers.spec.tscase fails without the fix; posthog-node 3364/3364,check-typesand lint pass.7400d1cec: CI runs the compliance tests onsdk-test-harness1.31.1, pinned by digest. Its capture v1 suites are the same as 1.26.0; the new tests cover feature flags only, and the full suite passes locally against this branch.Release info Sub-libraries affected
Libraries affected
posthog-node: one fix to unreleased 6.0 behavior. Otherwise lockfile,
mainmerge and one stale changeset.Checklist
🤖 Generated with Claude Code