Skip to content

V1 release - DO NOT MERGE - #231

Draft
marandaneto wants to merge 66 commits into
mainfrom
v1
Draft

marandaneto wants to merge 66 commits into
mainfrom
v1

Conversation

@marandaneto

Copy link
Copy Markdown
Member

💡 Motivation and Context

Closes #207

💚 How did you test it?

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran sampo add to generate a changeset file

eli-r-ph and others added 11 commits August 20, 2026 13:01
Deletes the V0 capture implementation and the `capture-v1` Cargo feature.
Capture V1 (`POST /i/v1/analytics/events`) is now the only capture path and
compiles unconditionally. No V1 logic, retry policy, buffering, or
option-extraction behavior changes — the V1 code is byte-identical, it just
stops being `#[cfg]`-gated.

- Delete `src/client/v0_capture.rs`, the V0 transport pipeline, the V0 retry
  decisions (`should_retry_v0` and friends), the V0 wire format's
  `BatchRequest`, and both `send_immediate` V0 bodies.
- Drop the `capture-v1` feature; `brotli` and `zstd` become unconditional
  dependencies. All four codecs the endpoint accepts (gzip/deflate/br/zstd)
  now work by default instead of silently degrading to uncompressed.
- Compliance adapter advertises `capture_v1` unconditionally and reports as
  `posthog-rs`; delete the V0 adapter image and its workflow. The
  `capture_v1` capability string is a frozen harness contract key.
- Collapse the CI build/test matrices, whose V0 and V1 entries became
  duplicates, and drop `--features capture-v1` from `check-public-api.sh`.

`Event::prepare_for_v0` and `InnerEvent` are retained temporarily as test-only
scaffolding; the tests that depend on them are ported to the V1 builder in the
next commit, which then deletes them.

Verified against a pre-change baseline: 379/316/356 tests pass for the default,
blocking, and blocking+error-tracking configs — identical counts to the same
suites under `--features capture-v1` before this change. Public API snapshot
unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rewrites the tests that depended on the V0 serialization scaffolding, then
deletes that scaffolding, so nothing V0 remains in the tree.

- `src/error_tracking.rs`: `built_event_json` now serializes through
  `V1Event::from_event`, so all 33 tests assert the shape actually sent. Two
  assertions move `$process_person_profile` from `properties` to the typed
  `options` object and additionally pin that it is stripped from `properties`.
- `src/event.rs`: 10 `v0_*` tests ported to assert the V1 shape and renamed
  without the version marker. `v0_adds_lib_properties` and
  `v0_preserves_existing_lib_properties` are dropped instead — the V1 builder
  never touches `$lib`/`$lib_version`, which now travel in the
  `posthog-sdk-info` header and are covered by
  `build_headers_sdk_info_is_canonical_lib_slash_version`.
- Delete `Event::prepare_for_v0`, `Event::apply_minimal_flag_called_allowlist`,
  and `InnerEvent`. The shared `is_minimal_flag_called_property` predicate is
  kept — the V1 path uses it. `semver` was only used by `prepare_for_v0`, so it
  is dropped as a dependency.
- Port the orphaned integration assertions that had no V1 twin, in both the
  async and blocking variants: `Event::with_flags` attaching flag properties
  without a second `/flags` fetch, `$is_server` on `$feature_flag_called`,
  client-level `ErrorTrackingOptions` applying to `capture_exception`, and the
  blank/whitespace API-key noop path.

Test totals move 379/316/356 -> 381/317/358 for the default, blocking, and
blocking+error-tracking configs: four ported tests added per applicable config,
less the two `$lib` tests whose behavior moved to the header. Public API
snapshot unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The `V1` markers existed only to scope the new pipeline during the dual-use
period. With V0 gone they are noise, so this adopts plain capture names —
including the pre-existing public `Endpoint::Capture`. Mechanical rename only:
no logic, retry, buffering, or option-extraction behavior changes, and no
existing test's assertions were altered.

Breaking:
- `V1ErrorResponse` -> `CaptureErrorResponse`, which also re-signatures the
  public `CaptureFailure::error_response()`.
- `Endpoint::Batch` removed; `Endpoint` is now `#[non_exhaustive]`.
- `Endpoint::Capture` re-points from `/i/v0/e/` to `/i/v1/analytics/events`.
  Callers of `Endpoint::Capture.path()` compile unchanged but see a different
  URL — the one change here with no compile-time signal.

Internal:
- `V1Event` -> `CaptureEvent` (not `Event`, which is taken by the public input
  type), `V1BatchRequest{,Ref}` -> `BatchRequest{,Ref}`, `PreparedV1` ->
  `Prepared`.
- `src/event_v1.rs` -> `src/capture_event.rs`, `src/client/v1_capture.rs` ->
  `src/client/capture.rs`. The former cannot be `event.rs` — the public `Event`
  lives there.
- `V1_CAPTURE_PATH` is deleted; both call sites now go through
  `build_url(Endpoint::Capture)`, which is byte-identical output since
  `build_custom_url` only normalized a leading slash that was already present.
- Tests renamed to match: `test_v1_capture.rs` -> `test_capture.rs`,
  `test_v1_blocking.rs` -> `test_capture_blocking.rs` (not `test_blocking.rs`,
  which survives), `test_error_tracking_v1.rs` -> `test_error_tracking.rs`.
- `compliance/v1/` -> `compliance/harness/`, and the compliance workflow drops
  its `-v1` suffixes.

The harness contract keys are deliberately untouched: the `capture_v1`
capability advertised by the adapter and the `--suite capture_v1` argument are
external strings the test harness matches on.

Adds the major-release changeset. Test counts are unchanged from the previous
commit (381/317/358), and the public API diff is exactly the three intended
items with nothing else moving.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`compliance/harness/Dockerfile` does `COPY . .` from the repo root, so with no
.dockerignore the build context included the whole local `target/` tree — 33GB
after a few cargo runs here — and the build died with ResourceExhausted while
hardlinking incremental artifacts. CI never hit this because a fresh checkout
has no `target/`, which is why the documented local compose path was quietly
broken for anyone who had built the crate.

Excluding target/, .git/, and .github/ drops the context from 33GB to 1.14MB,
which also trims the CI build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Porting the V0 tests left `event.rs` asserting the capture wire shape, which
`capture_event.rs` already owns — six were straight duplicates (timestamp
normalization, the anon/group/explicit `$process_person_profile` cases, and
`$groups`).

Wire-shape assertions now live only in `capture_event.rs`, next to the builder
they exercise; `event.rs` keeps just its `Event`-level timestamp tests. The four
assertions that were genuinely unique moved across rather than being dropped:
`distinct_id` at the root (with no legacy `$distinct_id` and no duplicate in
properties), auto-generated and caller-overridden `uuid`, and
`$process_person_profile` being absent from *both* options and properties when
unset. The `$lib`-coverage note moved with them.

Net -6 tests per config (375/311/352) — the duplicates, nothing else.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…h exists

The v0/v1 split left scaffolding that no longer earns its keep.

- Drop `--suite capture_v1` from the local compose. That filter existed only to
  pick v0 and v1 apart; with one capture path the harness selects suites from
  the adapter's advertised /health capabilities, which is what CI already does
  (it passes no --suite). Local runs were silently narrower than CI as a result
  — 94 tests instead of 111, skipping feature_flags entirely.
- Flatten `compliance/harness/` back to `compliance/`. The extra directory level
  only existed to hold the two per-mode variants.

Verified from the new layout: 111/111, capabilities `capture_v1, encoding_gzip`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* refactor!: remove deprecated APIs

* refactor!: rename local evaluation secret key field

* fix local evaluation API fallback

* preserve local-only evaluation privacy
* feat!: mark evaluate flags options as non-exhaustive

* fix non-exhaustive options call sites
# Conflicts:
#	.github/workflows/sdk-compliance-tests-v1.yml
#	.github/workflows/sdk-compliance-tests.yml
@github-actions

github-actions Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

posthog-rs Compliance Report

Date: 2026-08-31 08:00:38 UTC
Duration: 22994ms

✅ All Tests Passed!

111/111 tests passed


Capture_V1 Tests

✅ 94/94 tests passed

View Details
Test Status Duration
Endpoint And Method.Targets V1 Endpoint ✅ 145ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 145ms
Required Headers.Has Authorization Bearer Header ✅ 144ms
Required Headers.Has Content Type Json ✅ 143ms
Required Headers.Has Posthog Sdk Info Format ✅ 143ms
Required Headers.Has Posthog Attempt Header ✅ 143ms
Required Headers.Has Posthog Request Id ✅ 143ms
Required Headers.Has Posthog Request Timestamp ✅ 144ms
Required Headers.Has User Agent ✅ 142ms
Body Format.Body Has Created At And Batch ✅ 144ms
Body Format.No Api Key In Body ✅ 131ms
Body Format.No Sent At In Body ✅ 132ms
Event Format.Event Has Required Root Fields ✅ 131ms
Event Format.Event Uuid Is Valid ✅ 132ms
Event Format.Event Timestamp Is Rfc3339 ✅ 135ms
Event Format.Distinct Id Is String ✅ 130ms
Event Format.Distinct Id At Root Not Properties ✅ 130ms
Event Format.Custom Properties Preserved ✅ 131ms
Event Format.Set Properties Preserved ✅ 129ms
Event Format.Set Once Properties Preserved ✅ 130ms
Event Format.Groups Properties Preserved ✅ 125ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 123ms
Event Format.Event Has Required Root Fields Batch ✅ 154ms
Event Format.Event Uuid Is Valid Batch ✅ 156ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 156ms
Event Format.Distinct Id Is String Batch ✅ 167ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 166ms
Event Format.Custom Properties Preserved Batch ✅ 167ms
Event Format.Set Properties Preserved Batch ✅ 154ms
Event Format.Set Once Properties Preserved Batch ✅ 151ms
Event Format.Groups Properties Preserved Batch ✅ 140ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 139ms
Batch Behavior.Multiple Events In Single Batch ✅ 168ms
Batch Behavior.Batch Envelope Smoke ✅ 164ms
Batch Behavior.Flush With No Events Sends Nothing ✅ 72ms
Batch Behavior.Flush At Triggers Batch ✅ 1122ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 92ms
Deduplication.Generates Unique Uuids ✅ 198ms
Deduplication.Different Events Same Content Different Uuids ✅ 143ms
Deduplication.Preserves Uuid On Retry ✅ 5116ms
Deduplication.Preserves Timestamp On Retry ✅ 5086ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5119ms
Deduplication.No Duplicate Events In Batch ✅ 135ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 62ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 10070ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 5074ms
Header Behavior On Retry.Different Requests Have Different Request Ids ✅ 2064ms
Header Behavior On Retry.Request Timestamp Changes On Retry ✅ 5068ms
Response Format Validation.Success Response Has Uuid Keyed Results ✅ 41ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 30ms
Response Format Validation.Success No Retry After When All Ok ✅ 28ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 30ms
Response Format Validation.Success No Retry After When Drop Only ✅ 31ms
Response Format Validation.Response Echoes Request Id ✅ 29ms
Retry Behavior.Retries On 408 ✅ 5037ms
Retry Behavior.Retries On 500 ✅ 5024ms
Retry Behavior.Retries On 503 ✅ 5025ms
Retry Behavior.Retries On 504 ✅ 5023ms
Retry Behavior.Retryable Errors Have Retry After ✅ 2026ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 8024ms
Retry Behavior.Does Not Retry On 400 ✅ 2030ms
Retry Behavior.Does Not Retry On 401 ✅ 2035ms
Retry Behavior.Does Not Retry On 402 ✅ 2027ms
Retry Behavior.Does Not Retry On 413 ✅ 2028ms
Retry Behavior.Does Not Retry On 415 ✅ 2027ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 2025ms
Retry Behavior.Implements Backoff ✅ 15031ms
Retry Behavior.Max Retries Respected ✅ 15024ms
Partial Batch Handling.Handles 200 Full Success ✅ 2029ms
Partial Batch Handling.Handles 200 With All Ok ✅ 3036ms
Partial Batch Handling.Does Not Retry Dropped Events ✅ 3032ms
Partial Batch Handling.Does Not Retry Limited Events ✅ 3034ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 5034ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 5025ms
Partial Batch Handling.Retries Only Retry Events From Partial ✅ 5028ms
Partial Batch Handling.Partial Retry Preserves Uuids ✅ 5024ms
Partial Batch Handling.Partial Retry Attempt Header Increments ✅ 5030ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 5035ms
Partial Batch Handling.Respects Retry After On Partial ✅ 5024ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 3024ms
Partial Batch Handling.Mixed Ok Drop Limited No Retry ✅ 3032ms
Compression.Sends Gzip Content Encoding ✅ 25ms
Compression.No Content Encoding When Disabled ✅ 22ms
Compression.Compressed Body Is Decompressible ✅ 22ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 2023ms
Event Options.Cookieless Mode Override ✅ 23ms
Event Options.Disable Skew Correction Override ✅ 23ms
Event Options.Process Person Profile Override ✅ 23ms
Event Options.Product Tour Id Override ✅ 22ms
Event Options.Unset Options Omitted ✅ 22ms
Event Options.Options Override In Batch ✅ 25ms
Geoip And Historical Migration.Geoip Disable Injected Into Properties ✅ 22ms
Geoip And Historical Migration.Historical Migration Set In Body ✅ 22ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 22ms

Feature_Flags Tests

✅ 17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id ✅ 14ms
Request Payload.Flags Request Uses V2 Query Param ✅ 14ms
Request Payload.Flags Request Hits Flags Path Not Decide ✅ 14ms
Request Payload.Flags Request Omits Authorization Header ✅ 14ms
Request Payload.Token In Flags Body Matches Init ✅ 16ms
Request Payload.Groups Round Trip ✅ 15ms
Request Payload.Groups Default To Empty Object ✅ 14ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False ✅ 14ms
Request Payload.Disable Geoip Omitted Defaults To False ✅ 14ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key ✅ 14ms
Request Lifecycle.No Flags Request On Init Alone ✅ 11ms
Request Lifecycle.No Flags Request On Normal Capture ✅ 24ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests ✅ 18ms
Request Lifecycle.Mock Response Value Is Returned To Caller ✅ 16ms
Retry Behavior.Retries Flags On 502 ✅ 221ms
Retry Behavior.Retries Flags On 504 ✅ 218ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event ✅ 24ms

marandaneto and others added 18 commits August 24, 2026 14:21
# Conflicts:
#	api/public-api.txt
#	src/event.rs
* refactor: unify feature flag evaluation engine

* test: consolidate feature evaluation cases
# Conflicts:
#	api/public-api.txt
#	src/event.rs
* refactor(error-tracking): centralize debug image filtering

* fix: avoid self-joining transport worker on drop

* refactor: unify feature flag evaluation engine

* refactor: share feature flag retry classifier

* refactor: centralize capture preprocessing

* refactor: share feature flag event host

* refactor: share feature flag evaluation state

* refactor: centralize capture enqueue policy

* test: consolidate malformed capture responses

* test: consolidate client runtime assertions

* test: consolidate feature evaluation cases

* fix: avoid async shutdown worker deadlock

* style: format shutdown regression test

* fix: avoid async shutdown worker deadlock
* fix: avoid self-joining transport worker on drop

* refactor: share feature flag retry classifier

* fix: avoid async shutdown worker deadlock
* fix: avoid self-joining transport worker on drop

* refactor: share feature flag retry classifier

* refactor: centralize capture preprocessing

* fix: avoid async shutdown worker deadlock
* fix: avoid self-joining transport worker on drop

* refactor: share feature flag retry classifier

* refactor: centralize capture preprocessing

* refactor: share feature flag event host

* fix: avoid async shutdown worker deadlock
* fix: avoid self-joining transport worker on drop

* refactor: share feature flag retry classifier

* refactor: centralize capture preprocessing

* refactor: share feature flag event host

* refactor: share feature flag evaluation state

* fix: avoid async shutdown worker deadlock
* fix: avoid self-joining transport worker on drop

* refactor: share feature flag retry classifier

* refactor: centralize capture preprocessing

* refactor: share feature flag event host

* refactor: share feature flag evaluation state

* refactor: centralize capture enqueue policy

* fix: avoid async shutdown worker deadlock
* fix: avoid self-joining transport worker on drop

* refactor: share feature flag retry classifier

* refactor: centralize capture preprocessing

* refactor: share feature flag event host

* refactor: share feature flag evaluation state

* refactor: centralize capture enqueue policy

* test: consolidate client runtime assertions

* fix: avoid async shutdown worker deadlock
* fix: avoid self-joining transport worker on drop

* refactor: share feature flag retry classifier

* refactor: centralize capture preprocessing

* refactor: share feature flag event host

* refactor: share feature flag evaluation state

* refactor: centralize capture enqueue policy

* test: consolidate malformed capture responses

* fix: avoid async shutdown worker deadlock
# Conflicts:
#	src/client/async_client.rs
#	src/client/blocking.rs
#	tests/test_group_identify.rs
* ci: run compliance tests against sdk-test-harness 1.13.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: allow deprecated fetch_update so Clippy passes on Rust 1.99

Rust 1.99 renames AtomicUsize::fetch_update to try_update. The crate's
minimum Rust (1.78) has no try_update, so keep the old name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@eli-r-ph eli-r-ph self-assigned this Oct 1, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

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.

…ption (#279)

* feat!: stop forcing person processing for groups; new_anon sets the option

* test: pin legacy option properties surviving minimal flag events

* feat!: add SDK values before before_send; caller values win

$os, $os_version, $is_server and $geoip_disable now go in before the
before_send hooks, only for keys the event leaves unset. The hook sees
them and can remove them; the wire builder no longer adds them again.

Event::with_flags keeps flag properties the event already has, and
add_group groups merge into a $groups property key by key.

* fix(capture): strip caller-set $lib and $lib_version before send

Capture sets both from the PostHog-Sdk-Info header and appends them after
the event's keys, so a copy left in properties is a duplicate JSON key.

Also corrects two migration guide lines: new_anon differs from every 0.x
build, and the default V0 path already added $os before before_send.

* docs: note group person processing on exceptions and show insert_option

@posthog posthog Bot left a comment

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.

PostHog Review · Standard · reviewed c809f88: 5 Should fix. This pull request is large, so the review ran in 4 parts with less depth than usual.

This is the only automatic review while this pull request is a draft. Comment @posthog review to review new changes sooner. Otherwise, a review of the new changes runs when you mark it ready for review.

Comment thread src/client/transport.rs
Comment thread compliance/adapter/src/main.rs
Comment thread compliance/adapter/src/main.rs
Comment thread src/client/transport.rs Outdated
Comment thread src/capture_event.rs Outdated
marandaneto and others added 5 commits October 16, 2026 10:08
# Conflicts:
#	.github/workflows/ci.yaml
#	.github/workflows/codeql.yml
#	.github/workflows/posthog-upgrade.yml
#	.github/workflows/release.yml
#	.github/workflows/sdk-compliance-tests-v0.yml
#	.github/workflows/sdk-compliance-tests-v1.yml
#	src/client/transport.rs
# Conflicts:
#	.github/workflows/sdk-compliance-tests-v0.yml
#	.github/workflows/sdk-compliance-tests-v1.yml
* fix(capture): drop oversize AI events locally on the immediate path

capture_ai_immediate and capture_ai_batch_immediate now apply the 8 MiB per-event limit before sending, like the background AI lane. An event over the limit is not sent and gets a local drop verdict with the detail ai_event_too_big in the returned CaptureSummary.

* fix(retry): default to 4 capture attempts from 100 ms and give /flags its own backoff

max_capture_attempts now defaults to 4 and retry_initial_backoff_ms to 100. Remote /flags retries use a fixed backoff of 300 ms, doubling up to 30 s, instead of the capture retry options.

* test: set explicit uuids in the immediate size-ceiling test

The test read each event's uuid before capture; setting it explicitly keeps
the test independent of when the SDK assigns uuids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…lank ids as anonymous (#287)

A cloned or reused Event no longer sends one uuid twice: the client assigns
the uuid when it takes the event, unless set_uuid was called. set_timestamp
no longer rejects future timestamps; PostHog clamps them. Event::new with an
empty or whitespace-only distinct id creates an anonymous event.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A phx_ key passed as the project api_key disables the client with one error
log, as an empty key does, so a key PostHog always rejects is never sent.
The empty-key message moves to error level, and an explicitly disabled
client logs nothing about its key.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/client/mod.rs Fixed
eli-r-ph and others added 8 commits October 18, 2026 10:53
…iB (#288)

Capture V1 refuses an analytics body over 10 MiB, and the SDK sends bodies
uncompressed by default, so a count-only batch of large events could fail
whole. The analytics lane now splits each send by serialized bytes with the
check-before-append rule. Events are still built at send time, so
before_send timing is unchanged; immediate batches stay one request.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix: add jitter to capture retry waits

Each capture retry wait is scaled by a random factor between 0.75 and 1.25,
then clamped to retry_max_backoff_ms, so clients that fail together do not
retry together. A Retry-After header stays the minimum wait. Feature flag
retries are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: draw capture retry jitter with fastrand

fastrand is tiny, has no dependencies and supports Rust 1.63, so the jitter
factor is one plain call instead of bits from the std hasher.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: draw retry jitter from std instead of fastrand

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* docs: explain that the sdk-info header sets $lib on 1.0

* docs: complete the 1.0 migration guide and changesets

Covers the event ID rules, the $lib strip and the removed $lib_version
parts, AI lane size limits, the C compiler need, retryable statuses and
the no-hook log line, newly non-exhaustive types, and $debug_images.
Adds changesets for capture_ai, the TLS features, the non-exhaustive
types and the SDK identity header, and uses real per-event quota tags in
test fixtures.

* docs: the immediate AI variants also drop events over 8 MiB locally
…298)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…299)

* docs: note the 200-byte distinct ID limit in the 1.0 migration guide

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: drop product_tour_id from the guide; PostHog owns the $ai_ prefix

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: note the 200-byte event name limit in the 1.0 migration guide

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	src/feature_flags.rs
* fix: report capture's dropped duplicate copies as drops

Capture v1 keeps the first event for each uuid in a request and drops later
copies, reporting the count as duplicates_dropped on the uuid's result. The
SDK now treats those copies as terminal drops: it never resends them, and
counts them as lost in on_error (drop/duplicate_event_uuid) and in
CaptureSummary::not_persisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: note the retry gap and older capture's 400 for duplicate uuids

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
eli-r-ph and others added 6 commits October 26, 2026 19:25
)

A `$trace_id` or `$span_id` set as an exception property now wins over the
trace context provider, and setting either one stops the SDK adding both
provider IDs, so an event never mixes IDs from two trace contexts. An
explicit `CaptureExceptionOptions::trace_context` still wins over both.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…e-origin redirects only (#307)

* fix: run before_send after groups and the flag-event trim, follow same-origin redirects only

Merge typed groups into $groups and trim minimized $feature_flag_called
events before before_send, so the hook sees groups and its additions are
sent. SDK-built HTTP clients follow only 307/308 redirects to the first
request's origin, at most 5 times. Shutdown and queue-full drop warnings
name the capture endpoint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: list $product_tour_id among the legacy option properties

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: reverse proxy checklist for capture v1 in the migration guide

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: shutdown drops reach on_error once a batch has used all its attempts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	.github/workflows/ci.yaml
#	.github/workflows/sdk-compliance-tests-v0.yml
#	.github/workflows/sdk-compliance-tests-v1.yml
#	Cargo.lock
#	Cargo.toml
#	scripts/check-public-api.sh
#	src/client/transport.rs
#	src/error_tracking.rs
#	tests/test_async.rs
#	tests/test_blocking.rs
#	tests/test_capture.rs
#	tests/test_capture_blocking.rs
#	tests/test_capture_immediate.rs
#	tests/test_error_tracking.rs
#	tests/test_error_tracking_v1.rs
#	tests/test_evaluate_flags.rs
#	tests/test_v0_blocking_retry.rs
#	tests/test_v0_retry.rs
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore: run the capture v1 compliance suites from harness 1.23.0

Declare the adapter capabilities harness 1.23.0 uses to gate tests:
event_uuid_override, bounded_retries, disable_geoip and historical_migration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: support the harness reported_drops, log_capture, generated_payloads, property_layers and fail_open features

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: run the capture v1 compliance suites from harness 1.25.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

Prepare and release posthog-rs| posthog v1.0

3 participants