Skip to content

feat(emails): schedule a send with scheduled_at - #1240

Open
Silthus wants to merge 35 commits into
mainfrom
feat/email-scheduled-send
Open

Silthus wants to merge 35 commits into
mainfrom
feat/email-scheduled-send

Conversation

@Silthus

@Silthus Silthus commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

A send from code can now wait up to 7 days before it goes out: emails.send(..., scheduled_at=...). PostHog Cloud already parks a scheduled send like a workflow delay step and answers status and scheduled_at on the 202 (behind workflows-email-scheduled-sends). This adds the public field to the Python SDK, and nothing more.

This PR was first written as schedule, move, cancel and list. It is now cut down to the agreed v1 scope: scheduled_at on send only, with the old scheduling_unsupported fallback removed. Cancel, move and list come in a follow-up.

Impact

Scheduled sends close a gap for teams moving from Resend, where call sites schedule with scheduledAt. The usage bar: a quarter of code-sending orgs schedule at least once within 60 days of GA, read from the scheduled property on the transactional email api send event. The SDK carries no flag of its own; the server flag decides who can schedule.

What changes

  • scheduled_at on Emails.send and AsyncEmails.send, both forms (template and code). It takes an aware datetime or an ISO 8601 string: a date, a T or a space, a time, and Z or a ±HH:MM offset. None counts as left out.
  • Refuse, never send early:
    • A naive datetime, or a string in any other shape, raises ValueError before any request: no offset, an offset out of range such as +01:60 (which Python's fromisoformat would carry into the next hour), the basic format 20261201T090000Z, any other separator, and a time past the latest datetime.
    • A client whose app host isn't PostHog Cloud (US or EU) raises scheduling_requires_cloud before any request, naming the host. A self-hosted PostHog from before scheduled sends would drop the field and send at once, which no answer check could undo.
    • The time is rounded up to the next millisecond once, sent on every retry, and compared as an instant at millisecond precision. The client matches a string against its own pattern and reads the seconds fraction itself, so a string reads the same on Python 3.10 through 3.14 and digits past microseconds round up. Nanoseconds below a microsecond, on a pandas Timestamp or Google's DatetimeWithNanoseconds, round up too. emails.get keeps main's time parser. Tests cover microseconds, nanoseconds, a carry into the next day, non-UTC offsets and a datetime subclass such as a pandas Timestamp.
    • The answer is checked: a 202 must confirm the requested instant with status: scheduled, or answer scheduled_at: null with status: queued for a time at most 60 seconds ahead of the client's clock at the send's first attempt (the time had passed, so it goes out now). A slow answer or a retry doesn't widen that window, as in every PostHog SDK. Anything else raises schedule_not_confirmed, with the email's id on the new EmailError.message_id, including a 202 without the scheduled_at key and a send-now answer for a time further ahead.
    • A 400 on scheduled_at surfaces as an error. There is no fallback to sending now.
  • SendEmailResult gains scheduled_at and a derived status property ("queued" or "scheduled", typed as a Literal). A send without scheduled_at keeps today's result, with status reading "queued".
  • EmailStatus documents scheduled.

No cross-SDK spec in PostHog/sdk-specs covers scheduling yet; the error codes and the 60-second rule are the ones every PostHog SDK uses. The Python API still owes its API review: the names scheduling_requires_cloud, schedule_not_confirmed, EmailError.message_id, SendEmailResult.status and SendEmailResult.scheduled_at are open to it, and posthog-node should match them.

Warning

🟡 Merge risk: medium · one-way door once released: the public names scheduled_at, SendEmailResult.status, SendEmailResult.scheduled_at, EmailError.message_id, schedule_not_confirmed and scheduling_requires_cloud

  • Merge reaches no one: scheduled_at is a new optional argument, and the server flag workflows-email-scheduled-sends gates scheduling on PostHog's side. Once a maintainer approves the release, posthog and posthoganalytics on PyPI fix the names above, so the Python API review comes first.
  • Every send without scheduled_at keeps its request bytes and result values; the existing send tests cover it, and a result now also reads status == "queued" and scheduled_at=None.
  • A send scheduled about 5 minutes ahead on Cloud US went out on time, once, with the time PostHog confirmed (see How did you test it). Cloud EU sends the same request but had no live run.
  • A past or near-future time that PostHog answers as sent now runs on unit tests only. A client clock more than 60 seconds behind can read a correct send-now answer as schedule_not_confirmed (Known issues).
  • Switch-off: the server flag workflows-email-scheduled-sends, which answers 400 to scheduled_at while off. None in the SDK: fix forward.
  • Tier: non-critical
Path Who takes it Base HEAD
send without scheduled_at every SDK send posts the body, parses the 202 same request bytes and parse, covered by the existing send tests; the result adds status="queued"
send with scheduled_at on Cloud callers who opt in, once the server flag is on for their project TypeError: unknown argument posts scheduled_at, checks the answer
send with scheduled_at off Cloud none can today TypeError scheduling_requires_cloud before any request
send with a past scheduled_at on Cloud callers whose time passed before the request TypeError reads PostHog's queued with scheduled_at: null as sent now; covered by unit tests, not run on real Cloud
a send-now answer for a time more than 60 s ahead none expected: PostHog schedules a future time TypeError raises schedule_not_confirmed with the message ID instead of reporting the email as sent; unit tests only
send with scheduled_at on Cloud EU EU callers who opt in TypeError same request as US; the live run covered US only
an answer that doesn't confirm the time none expected: PostHog confirms to the millisecond TypeError raises schedule_not_confirmed after PostHog accepted the email; a caller who resends without the same idempotency_key sends a second email, so the error's fix says to read emails.get first

Rollout

  • Stages: merge; the server flag on for an internal project, then staged on the server side; then the SDK release, with a maintainer's approval, once customers can use scheduled sends. posthog-node ships the same names.
  • Decided: the Python API review comes before the release; a send-now answer for a time more than 60 seconds ahead raises in every PostHog SDK.
  • Watch: no alert pages on scheduled sends. Watch schedule_not_confirmed reports and scheduled emails whose status_at precedes their scheduled_at in the server's email status rows.

💚 How did you test it?

Unit tests in posthog/test/test_emails.py through a fake requests adapter and httpx.MockTransport, the seams the existing send tests use: the wire value per input form, refusals before any request, the Cloud-host check (standalone and through Posthog(app_host=...)), retries sending the same bytes and key, each answer shape the check accepts or refuses, a refused scheduled_at without fallback, and the async client. Locally: ruff format --check, ruff check, mypy with the baseline, the full pytest suite, make public_api_check and .github/scripts/check_strict_types.sh pass.

Live run on PostHog Cloud US at f6a2e6b, the head (the SDK release gate): a send scheduled about 5 minutes ahead went out as .124Z for a .123456 time, PostHog confirmed the same instant, a same-key resend returned the same email with replayed: true, emails.get read scheduled and then delivered 0.91 s after the requested time, and the mailbox holds exactly one email. Earlier runs at ebd9ce9 and 6b3b639 showed the same. Not run live: a past time, a send-now answer, and the EU region.

Known issues

  • A client clock more than 60 seconds behind PostHog's can read a correct send-now answer, for a time PostHog saw as passed, as schedule_not_confirmed. The error carries the message ID and says to read emails.get before sending again, so no email goes out twice.

Server behavior seen in the live runs on PostHog Cloud, not SDK bugs; the SDK reports what PostHog answers:

  • emails.get right after a scheduled send can answer 404 not_found for a few seconds, because PostHog writes the status row asynchronously; a later read returns scheduled.

📝 Checklist

  • All commits are signed (see Commit signing)
  • 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

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Claude Code (Opus 5.5) cut the earlier schedule, move, cancel and list work down to scheduled_at on send: it merged main, reset the scheduling files to main's key-scoped routes, and rebuilt the scope test-first. Reviews run through a cross-family panel.

Question Answer Who Where
v1 scope scheduled_at on send only; move, cancel and list wait for a follow-up; no scheduling_unsupported fallback 👍 spec v7
String times accept an ISO 8601 string with an offset and send it normalized to UTC milliseconds. Rejected: sending the caller's string as given 🤖 this PR
Unconfirmed answer raise schedule_not_confirmed with message_id, not retried. Rejected: returning a result with a warning 🤖 this PR
Result status status is derived from scheduled_at, so the two can't disagree. Rejected: two stored fields 🤖 review round 12
String parsing scheduled_at strings and PostHog's echo of them get their own strict pattern, then fromisoformat on the rebuilt time, so every supported Python reads them the same; status reads keep main's _timestamp. Rejected: one parser shared with emails.get, which changed how status times read 🤖 final reads 4 and 5

🤖 Generated with Claude Code

How did you test this code?

Merge card: medium, one-way door · 12 rounds, 9 final reads · gaps: prod-shape (🤖 agent d-fa7906d2) · 2 known issues · 14800 min opened to ready

Proof What ran Result Commit
live-run Real scheduled send at f6a2e6b on Cloud US: a send 5 minutes ahead, a same-key resend, status reads to delivery scheduled at the millisecond-rounded time, replay kept the email and time, delivered 0.91 s after the requested time, one email in the mailbox eacf325 (reused from f6a2e6b)
prod-shape not run gap, accepted
cross-version xver.py on Python 3.10.22, 3.12.3 and 3.14.7: scheduled_at inputs to the wire, PostHog echoes, answers with and without scheduled sends, and status reads Same line on all three versions for every scheduled_at input, echo and answer; status reads differ only where main's parser does eacf325 (reused from e94fc42)
shadow-diff shadow.py: 18 send/get/error scenarios through Emails with a fake requests adapter, main 84fc9e0 vs head e94fc42 Only diff: send results gain scheduled_at null (7 lines), the same diff as at ebd9ce9; all requests, errors and get results identical eacf325 (reused from e94fc42)
Review 5-lens panel (gpt-6.1-sol, claude-opus-5-5, gemini-4-neon, gpt-6.2-sol), round 2, final read 1, round 3, round 4, round 5, round 6, round 7, round 8, round 9, round 10, round 11, round 12, final read 2, round 13, final read 3, final read 4, final read 5, final read 6, final read 7, final read 8, final read 9 67 findings: 47 fixed, 19 rejected, 1 other ef74081 to eacf325
Proof judge an independent model reads the evidence against the diff ✅ passed at eacf325
PR Review rounds Production lines Sanity pass Skipped proofs
#1240 12 rounds, 9 final reads unknown → 309; tests unknown → 653; docs unknown → 5 cut at ebd9ce9: Already cut at afc641d to spec v7 scope: scheduled_at on send only; move, cancel, list and the fallback are gone. Since afc641d the production diff shrank further (round 12 removed _ISO_TIME, _iso_time, _offset and _schedule); posthog/emails.py now adds 249 production lines, about half docstrings, against 616 before the cut. prod-shape: Since the v7 scope cut emails.list, cancel and move, the PR reads no stored production records: it adds scheduled_at to one send request and reads that request's own answer. The answer shape (scheduled_at to the millisecond, null with status queued for a passed time) is PostHog's serializer contract, read from PostHog/posthog master; the earlier count of US email_status_events (no scheduled rows) is at afa81b7. The real Cloud send owed as live-run reads the production answer. (🤖 agent d-fa7906d2)

Not checked: none recorded
Full receipt: https://artifacts.posthog.com/a/KuQKAGAW0JVHfC8JTpWvLS

Silthus and others added 3 commits November 12, 2026 11:37
send() takes scheduled_at, an aware datetime or an ISO 8601 string with an
offset, and refuses a naive datetime before any request. Emails and
AsyncEmails gain update(), cancel() and list(). Cancel and update retry like
a send; list never retries.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Silthus Silthus self-assigned this Nov 12, 2026
@Silthus
Silthus requested a review from a team November 12, 2026 11:45

@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 8a365d2: no findings.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

posthog-python Compliance Report

Date: 2026-11-13T13:27:57.608446+00:00
Duration: 253758ms

✅ All Tests Passed!

270/270 tests passed


Capture_V1 Tests

✅ 95/95 tests passed

View Details
Test Status Duration
Endpoint And Method.Targets V1 Endpoint ✅ 515ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 508ms
Required Headers.Has Authorization Bearer Header ✅ 509ms
Required Headers.Has Content Type Json ✅ 508ms
Required Headers.Has Posthog Sdk Info Format ✅ 509ms
Required Headers.Has Posthog Attempt Header ✅ 508ms
Required Headers.Has Posthog Request Id ✅ 509ms
Required Headers.Has Posthog Request Timestamp ✅ 508ms
Required Headers.Has User Agent ✅ 509ms
Body Format.Body Has Created At And Batch ✅ 508ms
Body Format.No Api Key In Body ✅ 509ms
Body Format.No Sent At In Body ✅ 508ms
Event Format.Event Has Required Root Fields ✅ 508ms
Event Format.Event Uuid Is Valid ✅ 509ms
Event Format.Event Timestamp Is Rfc3339 ✅ 508ms
Event Format.Non Utc Event Timestamp Is Converted To Utc ✅ 523ms
Event Format.Distinct Id Is String ✅ 508ms
Event Format.Distinct Id At Root Not Properties ✅ 509ms
Event Format.Custom Properties Preserved ✅ 508ms
Event Format.Set Properties Preserved ✅ 509ms
Event Format.Set Once Properties Preserved ✅ 508ms
Event Format.Groups Properties Preserved ✅ 509ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 508ms
Event Format.Event Has Required Root Fields Batch ✅ 511ms
Event Format.Event Uuid Is Valid Batch ✅ 511ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 512ms
Event Format.Distinct Id Is String Batch ✅ 511ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 510ms
Event Format.Custom Properties Preserved Batch ✅ 512ms
Event Format.Set Properties Preserved Batch ✅ 511ms
Event Format.Set Once Properties Preserved Batch ✅ 512ms
Event Format.Groups Properties Preserved Batch ✅ 512ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 511ms
Batch Behavior.Multiple Events In Single Batch ✅ 515ms
Batch Behavior.Batch Envelope Smoke ✅ 513ms
Batch Behavior.Flush With No Events Sends Nothing ✅ 505ms
Batch Behavior.Flush At Triggers Batch ✅ 1009ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 510ms
Deduplication.Generates Unique Uuids ✅ 514ms
Deduplication.Different Events Same Content Different Uuids ✅ 511ms
Deduplication.Preserves Uuid On Retry ✅ 6517ms
Deduplication.Preserves Timestamp On Retry ✅ 6514ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 6517ms
Deduplication.No Duplicate Events In Batch ✅ 514ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 509ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 13525ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 6513ms
Header Behavior On Retry.Different Requests Have Different Request Ids ✅ 3017ms
Header Behavior On Retry.Request Timestamp Changes On Retry ✅ 6513ms
Response Format Validation.Success Response Has Uuid Keyed Results ✅ 509ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 512ms
Response Format Validation.Success No Retry After When All Ok ✅ 510ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 1514ms
Response Format Validation.Success No Retry After When Drop Only ✅ 510ms
Response Format Validation.Response Echoes Request Id ✅ 509ms
Retry Behavior.Retries On 408 ✅ 6513ms
Retry Behavior.Retries On 500 ✅ 6517ms
Retry Behavior.Retries On 503 ✅ 8521ms
Retry Behavior.Retries On 504 ✅ 6518ms
Retry Behavior.Retries On 404 ✅ 6517ms
Retry Behavior.Retries On 429 ✅ 6514ms
Retry Behavior.Retries On 502 ✅ 6519ms
Retry Behavior.Retryable Errors Have Retry After ✅ 3513ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 11519ms
Retry Behavior.Does Not Retry On 400 ✅ 2511ms
Retry Behavior.Does Not Retry On 401 ✅ 2512ms
Retry Behavior.Does Not Retry On 402 ✅ 2512ms
Retry Behavior.Does Not Retry On 413 ✅ 2511ms
Retry Behavior.Does Not Retry On 415 ✅ 2511ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 2511ms
Retry Behavior.Implements Backoff ✅ 19530ms
Partial Batch Handling.Handles 200 Full Success ✅ 2511ms
Partial Batch Handling.Handles 200 With All Ok ✅ 3513ms
Partial Batch Handling.Does Not Retry Dropped Events ✅ 3511ms
Partial Batch Handling.Does Not Retry Warning Events ✅ 3512ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 6519ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 6518ms
Partial Batch Handling.Retries Only Retry Events From Partial ✅ 6517ms
Partial Batch Handling.Partial Retry Preserves Uuids ✅ 6519ms
Partial Batch Handling.Partial Retry Attempt Header Increments ✅ 6515ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 6515ms
Partial Batch Handling.Respects Retry After On Partial ✅ 8515ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 3512ms
Partial Batch Handling.Mixed Ok Drop Warning No Retry ✅ 3517ms
Compression.Sends Gzip Content Encoding ✅ 509ms
Compression.No Content Encoding When Disabled ✅ 508ms
Compression.Compressed Body Is Decompressible ✅ 509ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 2511ms
Event Options.Cookieless Mode Override ✅ 509ms
Event Options.Disable Skew Correction Override ✅ 510ms
Event Options.Process Person Profile Override ✅ 508ms
Event Options.Product Tour Id Override ✅ 508ms
Event Options.Unset Options Omitted ✅ 509ms
Event Options.Options Override In Batch ✅ 511ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 509ms

Capture_Ai Tests

✅ 5/5 tests passed

View Details
Test Status Duration
Routing.Capture Ai Posts To Ai Endpoint ✅ 509ms
Routing.Capture Does Not Reroute Ai Named Events ✅ 508ms
Identity.Capture Ai Event Has Uuid ✅ 508ms
Identity.Capture Ai Keeps Supplied Uuid ✅ 509ms
Timestamp Format.Non Utc Event Timestamp Is Converted To Utc ✅ 509ms

Feature_Flags Tests

✅ 17/17 tests passed

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

Feature_Flags_V4 Tests

✅ 149/149 tests passed

View Details
Test Status Duration
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Complete Split] ✅ 10ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Partial Split Missing Config Version] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Partial Split Missing Rule Type] ✅ 9ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Partial Split Missing Rule Id] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Partial Split Missing Variant Key] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Split Wrong Type Config Version] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Split Wrong Type Rule Type] ✅ 9ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Split Wrong Type Rule Id] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Split Wrong Type Experiment Id] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Split Extra Experiment Id] ✅ 9ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Split Wrong Type Variant Key] ✅ 9ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Wrong Rule Type Literal] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Unknown Fields] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Old Server Variant] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Old Server Boolean] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Old Server Null Variant] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Old Server False] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.V4 Value Takes Precedence] ✅ 9ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Missing Flag] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Targeting Match Targeted Release] ✅ 9ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Targeting Match Percentage Rollout] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Rollout Miss Percentage Rollout] ✅ 9ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Rollout Miss Experiment] ✅ 9ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Experiment Paused] ✅ 7ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Holdout] ✅ 9ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Holdout Variant Key] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.No Rule Match] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Missing Group Key] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Dependency Error] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Error] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Error With Value] ✅ 8ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Malformed Sibling Isolation] ✅ 9ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Partial Split String Value] ✅ 9ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.V1 At V4] ✅ 9ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.V1 Failed] ✅ 10ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Integral Json Number Context] ✅ 9ms
Legacy Getters.Legacy Getter Reads Reader Fixture[Readers.Flag Key Seed] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.String.Target] ✅ 9ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.String.Rollout Hit] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.String.Miss Return Default] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.String.Miss Return Default Null] ✅ 9ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.String.Miss Continue] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.String.No Match Default] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.String.No Match Null] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.String.Order First Match] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.String.Order Targeting Miss] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.Target] ✅ 33ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.Rollout Hit] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.Miss Return Default] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.Miss Return Default Null] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.Miss Continue] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.No Match Default] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.No Match Null] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.Order First Match] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.Order Targeting Miss] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Object.Target] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Object.Rollout Hit] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Object.Miss Return Default] ✅ 9ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Object.Miss Return Default Null] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Object.Miss Continue] ✅ 10ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Object.No Match Default] ✅ 9ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Object.No Match Null] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Object.Order First Match] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Object.Order Targeting Miss] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.String.Unicode] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.String.Looks Boolean] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.Zero] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.Negative Decimal] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.Short Decimal] ✅ 9ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.Exponent] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.Max Safe Integer] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Number.Min Safe Integer] ✅ 9ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Object.Empty] ✅ 8ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Object.Nested] ✅ 10ms
Legacy Getters.Legacy Getter Reads Typed Value[V2 Value.Object.Max Depth] ✅ 9ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Complete Split] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Partial Split Missing Config Version] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Partial Split Missing Rule Type] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Partial Split Missing Rule Id] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Partial Split Missing Variant Key] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Split Wrong Type Config Version] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Split Wrong Type Rule Type] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Split Wrong Type Rule Id] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Split Wrong Type Experiment Id] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Split Extra Experiment Id] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Split Wrong Type Variant Key] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Wrong Rule Type Literal] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Unknown Fields] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Old Server Variant] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Old Server Boolean] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Old Server Null Variant] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Old Server False] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.V4 Value Takes Precedence] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Missing Flag] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Targeting Match Targeted Release] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Targeting Match Percentage Rollout] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Rollout Miss Percentage Rollout] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Rollout Miss Experiment] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Experiment Paused] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Holdout] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Holdout Variant Key] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.No Rule Match] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Missing Group Key] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Dependency Error] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Error] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Error With Value] ✅ 6ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Malformed Sibling Isolation] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Partial Split String Value] ✅ 8ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.V1 At V4] ✅ 7ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Integral Json Number Context] ✅ 8ms
Legacy Payloads.Legacy Payload Reads Reader Fixture[Readers.Flag Key Seed] ✅ 7ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.String.Target] ✅ 8ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.String.Rollout Hit] ✅ 7ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.String.Miss Return Default] ✅ 7ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.String.Miss Return Default Null] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.String.Miss Continue] ✅ 7ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.String.No Match Default] ✅ 8ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.String.No Match Null] ✅ 7ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.String.Order First Match] ✅ 7ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.String.Order Targeting Miss] ✅ 7ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.Target] ✅ 7ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.Rollout Hit] ✅ 7ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.Miss Return Default] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.Miss Return Default Null] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.Miss Continue] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.No Match Default] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.No Match Null] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.Order First Match] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.Order Targeting Miss] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Object.Target] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Object.Rollout Hit] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Object.Miss Return Default] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Object.Miss Return Default Null] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Object.Miss Continue] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Object.No Match Default] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Object.No Match Null] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Object.Order First Match] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Object.Order Targeting Miss] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.String.Unicode] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.String.Looks Boolean] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.Zero] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.Negative Decimal] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.Short Decimal] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.Exponent] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.Max Safe Integer] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Number.Min Safe Integer] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Object.Empty] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Object.Nested] ✅ 6ms
Legacy Payloads.Legacy Payload Is The Typed Value[V2 Value.Object.Max Depth] ✅ 6ms

Feature_Flags_Local_Evaluation Tests

✅ 4/4 tests passed

View Details
Test Status Duration
Versioned Boolean Matching.Matching Version Missing ✅ 56ms
Versioned Boolean Matching.Matching Version 1 ✅ 54ms
Versioned Boolean Matching.Matching Version 2 ✅ 55ms
Versioned Boolean Matching.Version Only Reload 1 2 1 2 Missing ✅ 33ms

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

SDK performance: posthog-python

Benchmarks completed. No changes flagged for review.

Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate.

View all results
Test Measurement Before PR With PR Change Assessment
Capture and deliver events (32-byte payload, burst)
Shard: capture
Managed heap after settling — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CPython has no uninstrumented total managed-heap byte counter; tracing would distort this RSS pass.​; head:​ CPython has no uninstrumented total managed-heap byte counter; tracing would distort this RSS pass.​
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Managed heap after settling — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CPython has no uninstrumented total managed-heap byte counter; tracing would distort this RSS pass.​; head:​ CPython has no uninstrumented total managed-heap byte counter; tracing would distort this RSS pass.​
Capture and deliver events (32-byte payload, steady)
Shard: capture
Managed heap after settling — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CPython has no uninstrumented total managed-heap byte counter; tracing would distort this RSS pass.​; head:​ CPython has no uninstrumented total managed-heap byte counter; tracing would distort this RSS pass.​
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Managed heap after settling — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CPython has no uninstrumented total managed-heap byte counter; tracing would distort this RSS pass.​; head:​ CPython has no uninstrumented total managed-heap byte counter; tracing would distort this RSS pass.​
Queue an event (32-byte payload)
Shard: capture
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Background preparation has no public completion boundary before flush; see capture.​drain for full-pipeline allocations.​; head:​ Background preparation has no public completion boundary before flush; see capture.​drain for full-pipeline allocations.​
Queue an event (32-byte payload)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Background preparation has no public completion boundary before flush; see capture.​drain for full-pipeline allocations.​; head:​ Background preparation has no public completion boundary before flush; see capture.​drain for full-pipeline allocations.​
Queue an event (4,096-byte payload)
Shard: capture
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Background preparation has no public completion boundary before flush; see capture.​drain for full-pipeline allocations.​; head:​ Background preparation has no public completion boundary before flush; see capture.​drain for full-pipeline allocations.​
Queue an event (4,096-byte payload)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Background preparation has no public completion boundary before flush; see capture.​drain for full-pipeline allocations.​; head:​ Background preparation has no public completion boundary before flush; see capture.​drain for full-pipeline allocations.​
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Managed heap after settling — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CPython has no uninstrumented total managed-heap byte counter; tracing would distort this RSS pass.​; head:​ CPython has no uninstrumented total managed-heap byte counter; tracing would distort this RSS pass.​
Refresh 1,000 flag definitions
Shard: flags-memory
Managed heap after settling — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ CPython has no uninstrumented total managed-heap byte counter; tracing would distort this RSS pass.​; head:​ CPython has no uninstrumented total managed-heap byte counter; tracing would distort this RSS pass.​
Capture and deliver events (32-byte payload, burst)
Shard: capture
Allocated memory per operation 133.67 KiB/op 133.67 KiB/op No observed change Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Allocations per operation 1,345.51 count/op 1,345.51 count/op No observed change Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Time per operation 78.32 µs/op 78.97 µs/op 0.8% more time Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Idle process memory (RSS) 37.68 MiB 37.59 MiB 0.2% less memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Observed peak process memory (RSS) 40.12 MiB 40.04 MiB 0.2% less memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Process memory after settling (RSS) 40.12 MiB 40.04 MiB 0.2% less memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Process CPU time per operation 80.21 µs/op 81.72 µs/op 1.9% more time Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Lifetime peak process memory (RSS) 40.45 MiB 40.45 MiB No observed change Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Allocated memory per operation 185.75 KiB/op 185.75 KiB/op <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Allocations per operation 1,337.51 count/op 1,337.52 count/op <0.1% more Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Time per operation 102.08 µs/op 102.01 µs/op <0.1% less time Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Idle process memory (RSS) 41.18 MiB 41.29 MiB 0.3% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Observed peak process memory (RSS) 46.96 MiB 47.08 MiB 0.2% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Process memory after settling (RSS) 46.96 MiB 47.08 MiB 0.2% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Process CPU time per operation 99.74 µs/op 99.58 µs/op 0.2% less time Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Lifetime peak process memory (RSS) 51.39 MiB 51.44 MiB 0.1% more memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Allocated memory per operation 138.73 KiB/op 138.73 KiB/op <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Allocations per operation 1,390.3 count/op 1,390.3 count/op <0.1% more Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Time per operation 90.58 µs/op 90.39 µs/op 0.2% less time Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Idle process memory (RSS) 37.62 MiB 37.57 MiB 0.1% less memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Observed peak process memory (RSS) 37.8 MiB 37.76 MiB 0.1% less memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Process memory after settling (RSS) 37.8 MiB 37.76 MiB 0.1% less memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Process CPU time per operation 91.23 µs/op 91.79 µs/op 0.6% more time Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Lifetime peak process memory (RSS) 40.45 MiB 40.45 MiB No observed change Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Allocated memory per operation 190.9 KiB/op 190.9 KiB/op <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Allocations per operation 1,382.19 count/op 1,382.2 count/op <0.1% more Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Time per operation 109.15 µs/op 107.95 µs/op 1.1% less time Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Idle process memory (RSS) 41.09 MiB 41.07 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Observed peak process memory (RSS) 41.54 MiB 41.56 MiB <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Process memory after settling (RSS) 41.15 MiB 41.15 MiB No observed change Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Process CPU time per operation 105.49 µs/op 105.69 µs/op 0.2% more time Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Lifetime peak process memory (RSS) 41.48 MiB 41.46 MiB <0.1% less memory Not flagged
Queue an event (32-byte payload)
Shard: capture
Caller-thread CPU time per operation 57.61 µs/op 57.69 µs/op 0.1% more time Not flagged
Queue an event (32-byte payload)
Shard: capture
Time per operation 57.74 µs/op 57.69 µs/op <0.1% less time Not flagged
Queue an event (4,096-byte payload)
Shard: capture
Caller-thread CPU time per operation 57.05 µs/op 57.37 µs/op 0.6% more time Not flagged
Queue an event (4,096-byte payload)
Shard: capture
Time per operation 57.06 µs/op 57.37 µs/op 0.5% more time Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Allocated memory per operation 233.85 KiB/op 233.85 KiB/op No observed change Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Allocations per operation 2,352.93 count/op 2,352.93 count/op No observed change Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Time per operation 85.37 µs/op 84.64 µs/op 0.9% less time Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Process CPU time per operation 85.35 µs/op 84.64 µs/op 0.8% less time Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Allocated memory per operation 2.25 MiB/op 2.25 MiB/op No observed change Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Allocations per operation 23,148.75 count/op 23,148.75 count/op No observed change Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Time per operation 793.34 µs/op 796.36 µs/op 0.4% more time Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Process CPU time per operation 793.37 µs/op 796.36 µs/op 0.4% more time Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Allocated memory per operation 22.45 MiB/op 22.45 MiB/op No observed change Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Allocations per operation 231,005.5 count/op 231,005.5 count/op No observed change Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Time per operation 7.94 ms/op 7.88 ms/op 0.8% less time Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Process CPU time per operation 7.94 ms/op 7.88 ms/op 0.8% less time Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Idle process memory (RSS) 43.91 MiB 43.81 MiB 0.2% less memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Observed peak process memory (RSS) 44.22 MiB 44.19 MiB <0.1% less memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Process memory after settling (RSS) 44.22 MiB 44.19 MiB <0.1% less memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Lifetime peak process memory (RSS) 43.94 MiB 43.88 MiB 0.1% less memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Idle process memory (RSS) 43.06 MiB 43.16 MiB 0.2% more memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Observed peak process memory (RSS) 43.06 MiB 43.17 MiB 0.2% more memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Process memory after settling (RSS) 43.06 MiB 43.17 MiB 0.2% more memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Lifetime peak process memory (RSS) 42.83 MiB 42.99 MiB 0.4% more memory Not flagged
Evaluate one boolean flag
Shard: flags-single
Allocated memory per operation 15.74 KiB/op 15.74 KiB/op No observed change Not flagged
Evaluate one boolean flag
Shard: flags-single
Allocations per operation 162.77 count/op 162.77 count/op No observed change Not flagged
Evaluate one boolean flag
Shard: flags-single
Time per operation 9.93 µs/op 9.8 µs/op 1.3% less time Not flagged
Evaluate one boolean flag
Shard: flags-single
Process CPU time per operation 9.93 µs/op 9.81 µs/op 1.3% less time Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Allocated memory per operation 25.28 KiB/op 25.28 KiB/op No observed change Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Allocations per operation 245.28 count/op 245.28 count/op No observed change Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Time per operation 13.44 µs/op 13.53 µs/op 0.6% more time Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Process CPU time per operation 13.44 µs/op 13.53 µs/op 0.6% more time Not flagged
Evaluate a flag (early match)
Shard: flags-single
Allocated memory per operation 41.36 KiB/op 41.36 KiB/op No observed change Not flagged
Evaluate a flag (early match)
Shard: flags-single
Allocations per operation 401.77 count/op 401.77 count/op No observed change Not flagged
Evaluate a flag (early match)
Shard: flags-single
Time per operation 19.38 µs/op 19.48 µs/op 0.5% more time Not flagged
Evaluate a flag (early match)
Shard: flags-single
Process CPU time per operation 19.38 µs/op 19.48 µs/op 0.5% more time Not flagged
Evaluate a flag (late match)
Shard: flags-single
Allocated memory per operation 63.34 KiB/op 63.34 KiB/op No observed change Not flagged
Evaluate a flag (late match)
Shard: flags-single
Allocations per operation 608.27 count/op 608.27 count/op No observed change Not flagged
Evaluate a flag (late match)
Shard: flags-single
Time per operation 27.64 µs/op 27.76 µs/op 0.4% more time Not flagged
Evaluate a flag (late match)
Shard: flags-single
Process CPU time per operation 27.64 µs/op 27.76 µs/op 0.4% more time Not flagged
Evaluate a flag (no match)
Shard: flags-single
Allocated memory per operation 61.97 KiB/op 61.97 KiB/op No observed change Not flagged
Evaluate a flag (no match)
Shard: flags-single
Allocations per operation 591.77 count/op 591.77 count/op No observed change Not flagged
Evaluate a flag (no match)
Shard: flags-single
Time per operation 26.79 µs/op 26.5 µs/op 1.1% less time Not flagged
Evaluate a flag (no match)
Shard: flags-single
Process CPU time per operation 26.79 µs/op 26.49 µs/op 1.1% less time Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Allocated memory per operation 19.38 KiB/op 19.38 KiB/op No observed change Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Allocations per operation 195.27 count/op 195.27 count/op No observed change Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Time per operation 11.03 µs/op 10.99 µs/op 0.4% less time Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Process CPU time per operation 11.03 µs/op 10.99 µs/op 0.3% less time Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Allocated memory per operation 21.01 KiB/op 21.01 KiB/op No observed change Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Allocations per operation 200.77 count/op 200.77 count/op No observed change Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Time per operation 11.83 µs/op 11.77 µs/op 0.5% less time Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Process CPU time per operation 11.83 µs/op 11.77 µs/op 0.5% less time Not flagged
Evaluate a rollout flag
Shard: flags-single
Allocated memory per operation 14.89 KiB/op 14.89 KiB/op No observed change Not flagged
Evaluate a rollout flag
Shard: flags-single
Allocations per operation 152.77 count/op 152.77 count/op No observed change Not flagged
Evaluate a rollout flag
Shard: flags-single
Time per operation 9.33 µs/op 9.3 µs/op 0.3% less time Not flagged
Evaluate a rollout flag
Shard: flags-single
Process CPU time per operation 9.33 µs/op 9.3 µs/op 0.3% less time Not flagged
Evaluate a multivariate flag
Shard: flags-single
Allocated memory per operation 15.9 KiB/op 15.9 KiB/op No observed change Not flagged
Evaluate a multivariate flag
Shard: flags-single
Allocations per operation 166.77 count/op 166.77 count/op No observed change Not flagged
Evaluate a multivariate flag
Shard: flags-single
Time per operation 10.25 µs/op 10.25 µs/op <0.1% less time Not flagged
Evaluate a multivariate flag
Shard: flags-single
Process CPU time per operation 10.25 µs/op 10.25 µs/op <0.1% 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 42d95918e1e552fb29218ddeeebcef94e48968b6 → eacf325d6a84f767e00eac631648d4c0560e16c4.

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.

Silthus and others added 2 commits November 12, 2026 12:07
…onflicts

- A scheduled send that a PostHog without scheduled sends answers with no
  status now carries the scheduling_unsupported warning, as posthog-node does,
  so the caller sees the email went out now.
- list() raises api_error when a page's next cursor is missing or not a
  nonempty string, instead of ending a paging loop early.
- cancel() raises api_error unless PostHog answers status canceled.
- A 409 already_sending or canceled is named validation_error, like
  template_outdated, as posthog-node names it: a retry can't resolve it.
- list() takes only status="scheduled", typed Literal["scheduled"].
- update() documents that a lost answer to a move to now can retry into
  already_sending. Drop the unused cancel path constant and typing.List.

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

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

@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 5239890: no findings.

Brings in #1216 (tracking and sensitive on a code send). The conflicts were
additions on both sides: the optional code fields, the strict type smoke
lines, and the test imports. All are kept.

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

@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 f01179a: no findings.

Silthus and others added 3 commits November 12, 2026 17:25
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>
@Silthus
Silthus marked this pull request as ready for review November 12, 2026 19:04
@veria-ai

veria-ai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

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

Reviews

@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 afa81b7: no findings.

@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-adding the stamphog label gives the same result unless the changed files change.

stamphog can't auto-approve this pull request, and the refusal is final. Two gates refused it. The deny-list gate matched public_api, because references/public_api_snapshot.txt changes and posthog/emails.py adds new public methods and result types (update, cancel, list, and the scheduled_at keyword). The tier gate classified it as T2-never: a cross-cutting feature of 1096 lines across 5 files.

The size gate passed, so splitting the PR won't clear the deny-list match. The next step is to ask a human reviewer, preferably an owner of the SDK's public API, to review it.

  • posthog[bot] reviewed the current head.
Gate mechanics and policy version
Gate Result
prerequisites ✓ all clear
deny-list ✗ matches: public_api
size ✓ 534L, 2F substantive, 1096L/5F incl. docs/generated/snapshots — within ceiling
tier ✗ classified as T2-never: T2-never (1096L, 5F, cross-cutting, feat)
stamphog 2.8.0 .stamphog/policy.yml @ unknown · reviewed head afa81b7

Silthus and others added 5 commits November 13, 2026 06:43
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…esults raise

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ports update, cancel and list onto main's request code from #1172:
replies are parsed from the raw body, and each call goes through
_posthog_request. Keeps both sides' send fields, tests and strict-type
checks; the regenerated public API snapshot carries both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A move whose request got no answer, such as on a timeout or a
cancellation, may still reach PostHog after a newer move and undo it.
The client now sends the moves of one email one at a time, and after an
unanswered move it refuses to move that email to another time with
move_unconfirmed, without a request. A move to the same time still goes
out. Matches posthog-node's fix for the same ordering problem.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread posthog/emails.py Resolved
Silthus and others added 3 commits November 13, 2026 07:54
…tant

A gateway timeout or other server error is an answer that confirms
nothing: the move may still run upstream and land after a newer one, so
it now blocks a later move to another time like a lost answer does. 4xx
answers still don't. Moves now compare by their instant in UTC, so the
same time written as a string or a datetime goes out instead of raising
move_unconfirmed.

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

A late move can't undo a confirmed cancel, since PostHog answers it
409 canceled, so the client drops that email's entry instead of keeping
it for its lifetime. The next move goes out and reads canceled. A failed
cancel keeps the entry.

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

# Conflicts:
#	posthog/emails.py
#	posthog/test/test_emails.py
Silthus and others added 2 commits November 13, 2026 13:16
D5 c1a6dd3 leaves `to` out of the scheduled email list, since a key that
can only read statuses could read who a project is about to email. The
client raised api_error on every such row, so ScheduledEmail drops `to`
and a row needs only its id and times. Callers match a row to its send
by id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A move queued behind one still out when a cancel was confirmed was
refused locally once the first move timed out, though PostHog would
answer it 409 canceled. Moves of an email whose cancel was confirmed
while they were out or queued now leave no record, since none can undo
the cancel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Silthus
Silthus marked this pull request as draft November 14, 2026 17:47
Silthus and others added 2 commits November 22, 2026 08:03
…uling work to main

The v7 spec cuts this PR down to scheduled_at on send. The next commits
rebuild that scope test-first on main's key-scoped email routes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Spec v7 scope only: scheduled_at on emails.send, both forms, sync and
async. A naive datetime or a string without an offset raises before any
request, and so does a client whose app host isn't PostHog Cloud. The time
is rounded up to the millisecond once and sent on every retry. A 202 for a
scheduled request must confirm the requested instant with status
scheduled, or answer scheduled_at null with status queued; anything else
raises schedule_not_confirmed with the email's message_id. No fallback to
sending now, no move, cancel or list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Silthus Silthus changed the title feat(emails): schedule, move, cancel and list emails feat(emails): schedule a send with scheduled_at Nov 22, 2026
Comment thread posthog/test/test_emails.py Fixed
Silthus and others added 4 commits November 22, 2026 08:34
CodeQL reads a URL substring check as URL sanitization.

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

The Raises line now says schedule_not_confirmed means PostHog queued the
email, so a retry on EmailError can't read it as nothing sent. The reason
for refusing scheduled_at off Cloud moves into the error's why. Tests of
the scheduling path assert on the requests the transport received, one
behaviour each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_prepare reads the time once and each form adds its wire value. A string
time goes through the module's _timestamp instead of a second ISO parser.
The rounded time is rebuilt as a plain UTC datetime, so a datetime
subclass such as a pandas Timestamp compares as the instant on the wire.
SendEmailResult.status is now derived from scheduled_at. An unconfirmed
schedule's fix no longer suggests a resend that a fresh key would turn
into a second email.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silthus and others added 7 commits November 24, 2026 06:03
- A 202 that answers `queued` with no `scheduled_at`, missing or null, for
  a time more than 60 seconds ahead of the client's clock raises
  `schedule_not_confirmed` with the message ID instead of reporting the
  email as sent. Within 60 seconds, or for a past time, it goes out now.
- Refuse a `scheduled_at` whose offset has minutes or seconds past 59,
  such as "+01:60", before any request: fromisoformat would carry it into
  the next hour and send the email at another time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A 202 without the scheduled_at key raises schedule_not_confirmed again,
  however near the requested time, as the spec says. Only queued with a
  null time is accepted, and only within 60 seconds.
- Read scheduled_at only with Z or a +HH:MM offset in range, and read the
  seconds fraction in the client: digits past microseconds round up, and
  a short fraction such as .1Z reads the same on Python 3.10.
- A time past the latest datetime raises ValueError, not OverflowError.
- Install the test transport at the Requests boundary in the host tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Status reads go back to main's parser. scheduled_at strings now need a
date, a T or a space, a time and Z or a +HH:MM offset, read the same way
on every supported Python, and a time's nanoseconds round it up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The echoed scheduled_at now goes through the same pattern as the
requested time, so an out-of-range offset can't confirm a schedule and
every supported Python reads a short fraction the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Google's DatetimeWithNanoseconds keeps the whole fraction in nanosecond,
so an exact millisecond went out a millisecond late. Only the part below
a microsecond rounds the time up now, as for a pandas Timestamp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A send-now answer for a scheduled_at was measured against the clock when
the answer arrived, so a slow answer or a retry widened the window. It
now counts from the send's first attempt, as the other SDKs do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silthus and others added 2 commits November 26, 2026 15:50
A local code that doesn't start with invalid_ is an application_error
in the cross-SDK error names. The code, message, why, fix and field
stay the same.

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.

3 participants