Skip to content

feat: SDK Compliance#2847

Merged
jose-sequeira merged 4 commits intomainfrom
jose-sequeira/sdk-compliance
Feb 4, 2026
Merged

feat: SDK Compliance#2847
jose-sequeira merged 4 commits intomainfrom
jose-sequeira/sdk-compliance

Conversation

@jose-sequeira
Copy link
Copy Markdown
Contributor

@jose-sequeira jose-sequeira commented Jan 6, 2026

Problem

No automated way to verify this SDK conforms to the shared PostHog capture API contract across SDKs.

Changes

Integrate the SDK Test Harness to validate SDK compliance against the shared capture API contract.

This adds:

  • An SDK adapter that wraps this SDK and exposes the standard REST interface for the test harness
  • A CI workflow that runs compliance tests on every PR and push to the default branch
  • A Dockerfile for running the adapter in the test harness environment

The test harness runs a mock PostHog server, exercises the SDK through the adapter, and verifies behavior matches the contract defined in CONTRACT.yaml (event format, retries, compression, deduplication, etc.).

Release info Sub-libraries affected

Libraries affected

  • All of them
  • posthog-js (web)
  • posthog-js-lite (web lite)
  • posthog-node
  • posthog-react-native
  • @posthog/react
  • @posthog/ai
  • @posthog/nextjs-config
  • @posthog/nuxt
  • @posthog/rollup-plugin
  • @posthog/webpack-plugin

Checklist

  • Tests for new code
  • Accounted for the impact of any changes across different platforms
  • Accounted for backwards compatibility of any changes (no breaking changes!)
  • Took care not to unnecessarily increase the bundle size

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 6, 2026

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

Project Deployment Actions Updated (UTC)
posthog-js Ready Ready Preview Feb 2, 2026 8:11am
posthog-nextjs-config Ready Ready Preview Feb 2, 2026 8:11am

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 6, 2026

📝 No Changeset Found

This PR doesn't include a changeset. A changeset (and the release label) is required to release a new version.

How to add a changeset

Run this command and follow the prompts:

pnpm changeset

Remember: Never use major version bumps for posthog-js as it's autoloaded by clients.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 6, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 6, 2026

Size Change: 0 B

Total Size: 5.88 MB

ℹ️ View Unchanged
Filename Size Change
packages/ai/dist/anthropic/index.cjs 19.6 kB 0 B
packages/ai/dist/anthropic/index.mjs 19.2 kB 0 B
packages/ai/dist/gemini/index.cjs 26.2 kB 0 B
packages/ai/dist/gemini/index.mjs 26 kB 0 B
packages/ai/dist/index.cjs 160 kB 0 B
packages/ai/dist/index.mjs 159 kB 0 B
packages/ai/dist/langchain/index.cjs 45.3 kB 0 B
packages/ai/dist/langchain/index.mjs 44.8 kB 0 B
packages/ai/dist/openai/index.cjs 46 kB 0 B
packages/ai/dist/openai/index.mjs 45.7 kB 0 B
packages/ai/dist/vercel/index.cjs 34.7 kB 0 B
packages/ai/dist/vercel/index.mjs 34.7 kB 0 B
packages/browser/dist/all-external-dependencies.js 266 kB 0 B
packages/browser/dist/array.full.es5.js 318 kB 0 B
packages/browser/dist/array.full.js 418 kB 0 B
packages/browser/dist/array.full.no-external.js 437 kB 0 B
packages/browser/dist/array.js 174 kB 0 B
packages/browser/dist/array.no-external.js 188 kB 0 B
packages/browser/dist/conversations.js 40.2 kB 0 B
packages/browser/dist/crisp-chat-integration.js 2.11 kB 0 B
packages/browser/dist/customizations.full.js 18 kB 0 B
packages/browser/dist/dead-clicks-autocapture.js 13.1 kB 0 B
packages/browser/dist/element-inference.js 5.79 kB 0 B
packages/browser/dist/exception-autocapture.js 11.8 kB 0 B
packages/browser/dist/external-scripts-loader.js 3.04 kB 0 B
packages/browser/dist/intercom-integration.js 2.16 kB 0 B
packages/browser/dist/lazy-recorder.js 151 kB 0 B
packages/browser/dist/logs.js 38.8 kB 0 B
packages/browser/dist/main.js 176 kB 0 B
packages/browser/dist/module.full.js 419 kB 0 B
packages/browser/dist/module.full.no-external.js 438 kB 0 B
packages/browser/dist/module.js 176 kB 0 B
packages/browser/dist/module.no-external.js 190 kB 0 B
packages/browser/dist/posthog-recorder.js 250 kB 0 B
packages/browser/dist/product-tours-preview.js 75.8 kB 0 B
packages/browser/dist/product-tours.js 111 kB 0 B
packages/browser/dist/recorder-v2.js 113 kB 0 B
packages/browser/dist/recorder.js 113 kB 0 B
packages/browser/dist/surveys-preview.js 75.2 kB 0 B
packages/browser/dist/surveys.js 88.9 kB 0 B
packages/browser/dist/tracing-headers.js 1.93 kB 0 B
packages/browser/dist/web-vitals-with-attribution.js 12 kB 0 B
packages/browser/dist/web-vitals.js 6.6 kB 0 B
packages/browser/react/dist/esm/index.js 19.3 kB 0 B
packages/browser/react/dist/esm/surveys/index.js 2.2 kB 0 B
packages/browser/react/dist/umd/index.js 22.4 kB 0 B
packages/browser/react/dist/umd/surveys/index.js 2.98 kB 0 B
packages/core/dist/error-tracking/chunk-ids.js 2.54 kB 0 B
packages/core/dist/error-tracking/chunk-ids.mjs 1.31 kB 0 B
packages/core/dist/error-tracking/coercers/dom-exception-coercer.js 2.3 kB 0 B
packages/core/dist/error-tracking/coercers/dom-exception-coercer.mjs 993 B 0 B
packages/core/dist/error-tracking/coercers/error-coercer.js 2.02 kB 0 B
packages/core/dist/error-tracking/coercers/error-coercer.mjs 794 B 0 B
packages/core/dist/error-tracking/coercers/error-event-coercer.js 1.76 kB 0 B
packages/core/dist/error-tracking/coercers/error-event-coercer.mjs 513 B 0 B
packages/core/dist/error-tracking/coercers/event-coercer.js 1.82 kB 0 B
packages/core/dist/error-tracking/coercers/event-coercer.mjs 548 B 0 B
packages/core/dist/error-tracking/coercers/index.js 6.79 kB 0 B
packages/core/dist/error-tracking/coercers/index.mjs 326 B 0 B
packages/core/dist/error-tracking/coercers/object-coercer.js 3.46 kB 0 B
packages/core/dist/error-tracking/coercers/object-coercer.mjs 2.07 kB 0 B
packages/core/dist/error-tracking/coercers/primitive-coercer.js 1.67 kB 0 B
packages/core/dist/error-tracking/coercers/primitive-coercer.mjs 419 B 0 B
packages/core/dist/error-tracking/coercers/promise-rejection-event.js 2.25 kB 0 B
packages/core/dist/error-tracking/coercers/promise-rejection-event.mjs 904 B 0 B
packages/core/dist/error-tracking/coercers/string-coercer.js 2.01 kB 0 B
packages/core/dist/error-tracking/coercers/string-coercer.mjs 820 B 0 B
packages/core/dist/error-tracking/coercers/utils.js 2.06 kB 0 B
packages/core/dist/error-tracking/coercers/utils.mjs 716 B 0 B
packages/core/dist/error-tracking/error-properties-builder.js 5.49 kB 0 B
packages/core/dist/error-tracking/error-properties-builder.mjs 4.15 kB 0 B
packages/core/dist/error-tracking/index.js 4.11 kB 0 B
packages/core/dist/error-tracking/index.mjs 152 B 0 B
packages/core/dist/error-tracking/parsers/base.js 1.83 kB 0 B
packages/core/dist/error-tracking/parsers/base.mjs 464 B 0 B
packages/core/dist/error-tracking/parsers/chrome.js 2.73 kB 0 B
packages/core/dist/error-tracking/parsers/chrome.mjs 1.32 kB 0 B
packages/core/dist/error-tracking/parsers/gecko.js 2.47 kB 0 B
packages/core/dist/error-tracking/parsers/gecko.mjs 1.13 kB 0 B
packages/core/dist/error-tracking/parsers/index.js 4.75 kB 0 B
packages/core/dist/error-tracking/parsers/index.mjs 2.1 kB 0 B
packages/core/dist/error-tracking/parsers/node.js 3.94 kB 0 B
packages/core/dist/error-tracking/parsers/node.mjs 2.68 kB 0 B
packages/core/dist/error-tracking/parsers/opera.js 2.26 kB 0 B
packages/core/dist/error-tracking/parsers/opera.mjs 746 B 0 B
packages/core/dist/error-tracking/parsers/safari.js 1.88 kB 0 B
packages/core/dist/error-tracking/parsers/safari.mjs 574 B 0 B
packages/core/dist/error-tracking/parsers/winjs.js 1.72 kB 0 B
packages/core/dist/error-tracking/parsers/winjs.mjs 426 B 0 B
packages/core/dist/error-tracking/types.js 1.33 kB 0 B
packages/core/dist/error-tracking/types.mjs 131 B 0 B
packages/core/dist/error-tracking/utils.js 1.8 kB 0 B
packages/core/dist/error-tracking/utils.mjs 604 B 0 B
packages/core/dist/eventemitter.js 1.78 kB 0 B
packages/core/dist/eventemitter.mjs 571 B 0 B
packages/core/dist/featureFlagUtils.js 6.5 kB 0 B
packages/core/dist/featureFlagUtils.mjs 4.28 kB 0 B
packages/core/dist/gzip.js 1.88 kB 0 B
packages/core/dist/gzip.mjs 577 B 0 B
packages/core/dist/index.js 5.7 kB 0 B
packages/core/dist/index.mjs 485 B 0 B
packages/core/dist/posthog-core-stateless.js 31 kB 0 B
packages/core/dist/posthog-core-stateless.mjs 28.5 kB 0 B
packages/core/dist/posthog-core.js 35.2 kB 0 B
packages/core/dist/posthog-core.mjs 30.5 kB 0 B
packages/core/dist/process/index.js 2.77 kB 0 B
packages/core/dist/process/index.mjs 114 B 0 B
packages/core/dist/process/spawn-local.js 1.82 kB 0 B
packages/core/dist/process/spawn-local.mjs 568 B 0 B
packages/core/dist/process/utils.js 3.27 kB 0 B
packages/core/dist/process/utils.mjs 1.3 kB 0 B
packages/core/dist/testing/index.js 2.93 kB 0 B
packages/core/dist/testing/index.mjs 79 B 0 B
packages/core/dist/testing/PostHogCoreTestClient.js 3.15 kB 0 B
packages/core/dist/testing/PostHogCoreTestClient.mjs 1.74 kB 0 B
packages/core/dist/testing/test-utils.js 2.77 kB 0 B
packages/core/dist/testing/test-utils.mjs 1.09 kB 0 B
packages/core/dist/types.js 9.13 kB 0 B
packages/core/dist/types.mjs 6.67 kB 0 B
packages/core/dist/utils/bot-detection.js 3.28 kB 0 B
packages/core/dist/utils/bot-detection.mjs 1.95 kB 0 B
packages/core/dist/utils/bucketed-rate-limiter.js 3 kB 0 B
packages/core/dist/utils/bucketed-rate-limiter.mjs 1.62 kB 0 B
packages/core/dist/utils/index.js 11.9 kB 0 B
packages/core/dist/utils/index.mjs 1.98 kB 0 B
packages/core/dist/utils/logger.js 2.5 kB 0 B
packages/core/dist/utils/logger.mjs 1.22 kB 0 B
packages/core/dist/utils/number-utils.js 2 kB 0 B
packages/core/dist/utils/number-utils.mjs 735 B 0 B
packages/core/dist/utils/promise-queue.js 2 kB 0 B
packages/core/dist/utils/promise-queue.mjs 768 B 0 B
packages/core/dist/utils/string-utils.js 1.91 kB 0 B
packages/core/dist/utils/string-utils.mjs 414 B 0 B
packages/core/dist/utils/type-utils.js 7.03 kB 0 B
packages/core/dist/utils/type-utils.mjs 3.1 kB 0 B
packages/core/dist/utils/user-agent-utils.js 14.9 kB 0 B
packages/core/dist/utils/user-agent-utils.mjs 11.9 kB 0 B
packages/core/dist/vendor/uuidv7.js 8.29 kB 0 B
packages/core/dist/vendor/uuidv7.mjs 6.72 kB 0 B
packages/nextjs-config/dist/config.js 4.97 kB 0 B
packages/nextjs-config/dist/config.mjs 3.48 kB 0 B
packages/nextjs-config/dist/index.js 2.24 kB 0 B
packages/nextjs-config/dist/index.mjs 30 B 0 B
packages/nextjs-config/dist/utils.js 3.96 kB 0 B
packages/nextjs-config/dist/utils.mjs 1.85 kB 0 B
packages/node/dist/client.js 30 kB 0 B
packages/node/dist/client.mjs 28 kB 0 B
packages/node/dist/entrypoints/index.edge.js 4.25 kB 0 B
packages/node/dist/entrypoints/index.edge.mjs 723 B 0 B
packages/node/dist/entrypoints/index.node.js 5.55 kB 0 B
packages/node/dist/entrypoints/index.node.mjs 1.08 kB 0 B
packages/node/dist/experimental.js 603 B 0 B
packages/node/dist/experimental.mjs 0 B 0 B 🆕
packages/node/dist/exports.js 4.22 kB 0 B
packages/node/dist/exports.mjs 203 B 0 B
packages/node/dist/extensions/context/context.js 2.12 kB 0 B
packages/node/dist/extensions/context/context.mjs 862 B 0 B
packages/node/dist/extensions/context/types.js 603 B 0 B
packages/node/dist/extensions/context/types.mjs 0 B 0 B 🆕
packages/node/dist/extensions/error-tracking/autocapture.js 2.66 kB 0 B
packages/node/dist/extensions/error-tracking/autocapture.mjs 1.24 kB 0 B
packages/node/dist/extensions/error-tracking/index.js 4.2 kB 0 B
packages/node/dist/extensions/error-tracking/index.mjs 2.91 kB 0 B
packages/node/dist/extensions/error-tracking/modifiers/context-lines.node.js 8.81 kB 0 B
packages/node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs 7.15 kB 0 B
packages/node/dist/extensions/error-tracking/modifiers/module.node.js 2.78 kB 0 B
packages/node/dist/extensions/error-tracking/modifiers/module.node.mjs 1.45 kB 0 B
packages/node/dist/extensions/express.js 2.84 kB 0 B
packages/node/dist/extensions/express.mjs 1.25 kB 0 B
packages/node/dist/extensions/feature-flags/cache.js 603 B 0 B
packages/node/dist/extensions/feature-flags/cache.mjs 0 B 0 B 🆕
packages/node/dist/extensions/feature-flags/crypto.js 1.57 kB 0 B
packages/node/dist/extensions/feature-flags/crypto.mjs 395 B 0 B
packages/node/dist/extensions/feature-flags/feature-flags.js 32.2 kB 0 B
packages/node/dist/extensions/feature-flags/feature-flags.mjs 30.2 kB 0 B
packages/node/dist/extensions/sentry-integration.js 4.66 kB 0 B
packages/node/dist/extensions/sentry-integration.mjs 3.17 kB 0 B
packages/node/dist/storage-memory.js 1.52 kB 0 B
packages/node/dist/storage-memory.mjs 297 B 0 B
packages/node/dist/types.js 1.43 kB 0 B
packages/node/dist/types.mjs 224 B 0 B
packages/node/dist/version.js 1.21 kB 0 B
packages/node/dist/version.mjs 46 B 0 B
packages/nuxt/dist/module.mjs 4.39 kB 0 B
packages/nuxt/dist/runtime/composables/useFeatureFlagEnabled.js 566 B 0 B
packages/nuxt/dist/runtime/composables/useFeatureFlagPayload.js 597 B 0 B
packages/nuxt/dist/runtime/composables/useFeatureFlagVariantKey.js 591 B 0 B
packages/nuxt/dist/runtime/composables/usePostHog.js 128 B 0 B
packages/nuxt/dist/runtime/nitro-plugin.js 1.08 kB 0 B
packages/nuxt/dist/runtime/vue-plugin.js 1.14 kB 0 B
packages/react-native/dist/autocapture.js 5.05 kB 0 B
packages/react-native/dist/error-tracking/index.js 6.77 kB 0 B
packages/react-native/dist/error-tracking/utils.js 2.58 kB 0 B
packages/react-native/dist/frameworks/wix-navigation.js 1.3 kB 0 B
packages/react-native/dist/hooks/useFeatureFlag.js 1.49 kB 0 B
packages/react-native/dist/hooks/useFeatureFlags.js 821 B 0 B
packages/react-native/dist/hooks/useNavigationTracker.js 2.46 kB 0 B
packages/react-native/dist/hooks/usePostHog.js 467 B 0 B
packages/react-native/dist/index.js 3.12 kB 0 B
packages/react-native/dist/native-deps.js 8.16 kB 0 B
packages/react-native/dist/optional/OptionalAsyncStorage.js 299 B 0 B
packages/react-native/dist/optional/OptionalExpoApplication.js 377 B 0 B
packages/react-native/dist/optional/OptionalExpoDevice.js 347 B 0 B
packages/react-native/dist/optional/OptionalExpoFileSystem.js 386 B 0 B
packages/react-native/dist/optional/OptionalExpoFileSystemLegacy.js 423 B 0 B
packages/react-native/dist/optional/OptionalExpoLocalization.js 383 B 0 B
packages/react-native/dist/optional/OptionalReactNativeDeviceInfo.js 415 B 0 B
packages/react-native/dist/optional/OptionalReactNativeLocalize.js 303 B 0 B
packages/react-native/dist/optional/OptionalReactNativeNavigation.js 415 B 0 B
packages/react-native/dist/optional/OptionalReactNativeNavigationWix.js 443 B 0 B
packages/react-native/dist/optional/OptionalReactNativeSafeArea.js 644 B 0 B
packages/react-native/dist/optional/OptionalSessionReplay.js 455 B 0 B
packages/react-native/dist/posthog-rn.js 30.6 kB 0 B
packages/react-native/dist/PostHogContext.js 329 B 0 B
packages/react-native/dist/PostHogMaskView.js 1.66 kB 0 B
packages/react-native/dist/PostHogProvider.js 4.77 kB 0 B
packages/react-native/dist/storage.js 3.39 kB 0 B
packages/react-native/dist/surveys/components/BottomSection.js 1.46 kB 0 B
packages/react-native/dist/surveys/components/Cancel.js 909 B 0 B
packages/react-native/dist/surveys/components/ConfirmationMessage.js 1.65 kB 0 B
packages/react-native/dist/surveys/components/QuestionHeader.js 1.37 kB 0 B
packages/react-native/dist/surveys/components/QuestionTypes.js 11.8 kB 0 B
packages/react-native/dist/surveys/components/SurveyModal.js 4.01 kB 0 B
packages/react-native/dist/surveys/components/Surveys.js 7.22 kB 0 B
packages/react-native/dist/surveys/getActiveMatchingSurveys.js 2.64 kB 0 B
packages/react-native/dist/surveys/icons.js 8.86 kB 0 B
packages/react-native/dist/surveys/index.js 600 B 0 B
packages/react-native/dist/surveys/PostHogSurveyProvider.js 5.71 kB 0 B
packages/react-native/dist/surveys/surveys-utils.js 12.7 kB 0 B
packages/react-native/dist/surveys/useActivatedSurveys.js 3.67 kB 0 B
packages/react-native/dist/surveys/useSurveyStorage.js 2.16 kB 0 B
packages/react-native/dist/tooling/expoconfig.js 2.63 kB 0 B
packages/react-native/dist/tooling/metroconfig.js 2.32 kB 0 B
packages/react-native/dist/tooling/posthogMetroSerializer.js 4.86 kB 0 B
packages/react-native/dist/tooling/utils.js 4.05 kB 0 B
packages/react-native/dist/tooling/vendor/expo/expoconfig.js 70 B 0 B
packages/react-native/dist/tooling/vendor/metro/countLines.js 237 B 0 B
packages/react-native/dist/tooling/vendor/metro/utils.js 3.35 kB 0 B
packages/react-native/dist/types.js 70 B 0 B
packages/react-native/dist/utils.js 719 B 0 B
packages/react-native/dist/version.js 130 B 0 B
packages/react/dist/esm/index.js 19.3 kB 0 B
packages/react/dist/esm/surveys/index.js 2.2 kB 0 B
packages/react/dist/umd/index.js 22.4 kB 0 B
packages/react/dist/umd/surveys/index.js 2.98 kB 0 B
packages/rollup-plugin/dist/index.js 4.66 kB 0 B
packages/types/dist/capture.js 603 B 0 B
packages/types/dist/capture.mjs 0 B 0 B 🆕
packages/types/dist/common.js 603 B 0 B
packages/types/dist/common.mjs 0 B 0 B 🆕
packages/types/dist/feature-flags.js 603 B 0 B
packages/types/dist/feature-flags.mjs 0 B 0 B 🆕
packages/types/dist/index.js 603 B 0 B
packages/types/dist/index.mjs 0 B 0 B 🆕
packages/types/dist/posthog-config.js 603 B 0 B
packages/types/dist/posthog-config.mjs 0 B 0 B 🆕
packages/types/dist/posthog.js 603 B 0 B
packages/types/dist/posthog.mjs 0 B 0 B 🆕
packages/types/dist/request.js 603 B 0 B
packages/types/dist/request.mjs 0 B 0 B 🆕
packages/types/dist/segment.js 603 B 0 B
packages/types/dist/segment.mjs 0 B 0 B 🆕
packages/types/dist/session-recording.js 603 B 0 B
packages/types/dist/session-recording.mjs 0 B 0 B 🆕
packages/types/dist/survey.js 603 B 0 B
packages/types/dist/survey.mjs 0 B 0 B 🆕
packages/types/dist/toolbar.js 603 B 0 B
packages/types/dist/toolbar.mjs 0 B 0 B 🆕
packages/web/dist/index.cjs 13.8 kB 0 B
packages/web/dist/index.mjs 13.7 kB 0 B
packages/webpack-plugin/dist/config.js 2.69 kB 0 B
packages/webpack-plugin/dist/config.mjs 1.69 kB 0 B
packages/webpack-plugin/dist/index.js 6.47 kB 0 B
packages/webpack-plugin/dist/index.mjs 3.05 kB 0 B
tooling/changelog/dist/index.js 3.31 kB 0 B
tooling/rollup-utils/dist/index.js 1.17 kB 0 B

compressed-size-action

@github-actions
Copy link
Copy Markdown
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@github-actions github-actions Bot added the stale label Jan 13, 2026
@jose-sequeira
Copy link
Copy Markdown
Contributor Author

WIP

@jose-sequeira jose-sequeira force-pushed the jose-sequeira/sdk-compliance branch from 4310f51 to a29f437 Compare January 21, 2026 11:51
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 21, 2026

posthog-node Compliance Report

Date: 2026-01-21 11:57:52 UTC
Duration: 71419ms

⚠️ Some Tests Failed

15/17 tests passed, 2 failed


Capture Tests

⚠️ 15/17 tests passed, 2 failed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 91ms
Format Validation.Event Has Uuid 14ms
Format Validation.Event Has Lib Properties 12ms
Format Validation.Distinct Id Is String 16ms
Format Validation.Token Is Present 17ms
Retry Behavior.Retries On 503 11023ms
Retry Behavior.Does Not Retry On 400 5021ms
Retry Behavior.Does Not Retry On 401 5019ms
Retry Behavior.Respects Retry After Header 8019ms
Retry Behavior.Implements Backoff 24030ms
Deduplication.Generates Unique Uuids 20ms
Deduplication.Preserves Uuid On Retry 8020ms
Deduplication.Different Events Have Different Uuids 14ms
Compression.Sends Gzip When Enabled 7ms
Batch Format.Uses Proper Batch Structure 9ms
Error Handling.Does Not Retry On 413 2011ms
Error Handling.Retries On 408 8018ms

Failures

retry_behavior.does_not_retry_on_400

Expected 1 requests, got 2

retry_behavior.does_not_retry_on_401

Expected 1 requests, got 2

@github-actions
Copy link
Copy Markdown
Contributor

posthog-js Compliance Report

Date: 2026-01-21 12:04:01 UTC
Duration: 75502ms

⚠️ Some Tests Failed

9/17 tests passed, 8 failed


Capture Tests

⚠️ 9/17 tests passed, 8 failed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 2152ms
Format Validation.Event Has Uuid 2019ms
Format Validation.Event Has Lib Properties 2014ms
Format Validation.Distinct Id Is String 2016ms
Format Validation.Token Is Present 2015ms
Retry Behavior.Retries On 503 7018ms
Retry Behavior.Does Not Retry On 400 4021ms
Retry Behavior.Does Not Retry On 401 4018ms
Retry Behavior.Respects Retry After Header 7022ms
Retry Behavior.Implements Backoff 17031ms
Deduplication.Generates Unique Uuids 2025ms
Deduplication.Preserves Uuid On Retry 7019ms
Deduplication.Different Events Have Different Uuids 2015ms
Compression.Sends Gzip When Enabled 2013ms
Batch Format.Uses Proper Batch Structure 2012ms
Error Handling.Does Not Retry On 413 4016ms
Error Handling.Retries On 408 7017ms

Failures

format_validation.event_has_required_fields

Expected distinct_id='test_user', got 'None'

format_validation.distinct_id_is_string

Expected distinct_id='test_user_123', got 'None'

format_validation.token_is_present

'list' object has no attribute 'get'

retry_behavior.retries_on_503

Expected at least 3 requests, got 2

retry_behavior.respects_retry_after_header

Retry delay too short: 44ms < 2500ms

compression.sends_gzip_when_enabled

Header 'Content-Encoding' with value 'gzip' not found in requests

batch_format.uses_proper_batch_structure

Batch format missing 'api_key' field at root level

error_handling.retries_on_408

Expected at least 2 requests, got 1

@jose-sequeira jose-sequeira marked this pull request as ready for review January 28, 2026 13:42
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, 8 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +289 to +291

const { distinct_id, event, properties } = req.body

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

register() sets persistent properties across all events, not the distinct_id for a single capture. Use identify() to set distinct_id, or pass it directly in the capture call via $distinct_id in properties.

Suggested change
const { distinct_id, event, properties } = req.body
// Identify the user if distinct_id provided
if (distinct_id) {
state.instance.identify(distinct_id)
}
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/browser/sdk_compliance_adapter/adapter.js
Line: 289:291

Comment:
`register()` sets persistent properties across all events, not the `distinct_id` for a single capture. Use `identify()` to set distinct_id, or pass it directly in the capture call via `$distinct_id` in properties.

```suggestion
        // Identify the user if distinct_id provided
        if (distinct_id) {
            state.instance.identify(distinct_id)
        }
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +130 to +134

try {
// Set distinct_id if provided
if (distinct_id) {
state.posthog.register({ distinct_id })
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

register() sets persistent properties across all events, not the distinct_id for a single capture. Use identify() to set distinct_id, or pass it directly in the capture call.

Suggested change
try {
// Set distinct_id if provided
if (distinct_id) {
state.posthog.register({ distinct_id })
// Set distinct_id if provided
if (distinct_id) {
state.posthog.identify(distinct_id)
}
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/browser/sdk_compliance_adapter/adapter.ts
Line: 130:134

Comment:
`register()` sets persistent properties across all events, not the `distinct_id` for a single capture. Use `identify()` to set `distinct_id`, or pass it directly in the capture call.

```suggestion
        // Set distinct_id if provided
        if (distinct_id) {
            state.posthog.identify(distinct_id)
        }
```

How can I resolve this? If you propose a fix, please make it concise.

- test-network

test-harness:
image: posthog-sdk-test-harness:debug
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hardcoded image posthog-sdk-test-harness:debug requires manual build or pull. Consider adding build instructions to README or using a published image tag.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/browser/sdk_compliance_adapter/docker-compose.yml
Line: 12:12

Comment:
Hardcoded image `posthog-sdk-test-harness:debug` requires manual build or pull. Consider adding build instructions to README or using a published image tag.

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

- test-network

test-harness:
image: posthog-sdk-test-harness:debug
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hardcoded image posthog-sdk-test-harness:debug requires manual build or pull. Consider adding build instructions to README or using a published image tag.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/node/sdk_compliance_adapter/docker-compose.yml
Line: 12:12

Comment:
Hardcoded image `posthog-sdk-test-harness:debug` requires manual build or pull. Consider adding build instructions to README or using a published image tag.

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +306 to +308
const lastEvent = state.capturedEvents[state.capturedEvents.length - 1]

res.json({ success: true, uuid: lastEvent?.uuid || 'generated-uuid' })
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2-second hardcoded delay may be insufficient for high-latency networks or cause slow tests. Consider making this configurable via environment variable or using a retry/polling strategy to check if events were sent.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/browser/sdk_compliance_adapter/adapter.js
Line: 306:308

Comment:
2-second hardcoded delay may be insufficient for high-latency networks or cause slow tests. Consider making this configurable via environment variable or using a retry/polling strategy to check if events were sent.

How can I resolve this? If you propose a fix, please make it concise.

Comment thread packages/browser/sdk_compliance_adapter/adapter.ts Outdated
Comment thread compliance/browser/adapter.js Outdated
Comment thread compliance/node/adapter.js
Comment thread .github/workflows/sdk-compliance-tests-browser.yml
Comment thread .github/workflows/sdk-compliance-tests-node.yml
Comment thread .github/workflows/sdk-compliance-tests-browser.yml
Comment thread .github/workflows/sdk-compliance-tests-node.yml
Comment thread compliance/browser/adapter.js
Comment thread compliance/browser/Dockerfile
Comment thread compliance/browser/adapter.js Fixed
@jose-sequeira
Copy link
Copy Markdown
Contributor Author

@hpouillot Addressed your comments

Copy link
Copy Markdown
Contributor

@hpouillot hpouillot left a comment

Choose a reason for hiding this comment

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

I'm not a big fan of requiring from dist 😬 but we can change that later

@jose-sequeira jose-sequeira merged commit a73d16b into main Feb 4, 2026
43 checks passed
@jose-sequeira jose-sequeira deleted the jose-sequeira/sdk-compliance branch February 4, 2026 09: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.

3 participants