Skip to content

fix: preserve the compliance adapter retry delay defaults - #322

Merged
marandaneto merged 3 commits into
mainfrom
fix/local-harness-1.31.1-20261115
Nov 18, 2026
Merged

marandaneto merged 3 commits into
mainfrom
fix/local-harness-1.31.1-20261115

Conversation

@marandaneto

@marandaneto marandaneto commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

💡 Motivation and Context

The compliance adapter supplied max_retries=3 even when the harness omitted it. Translating that count into the SDK's backoff-duration option lowered the Retry-After ceiling to 800/801 ms, so all three consumers retried Retry-After: 3 too early.

Preserve the native 10000 ms ceiling when max_retries is omitted. Keep explicit retry-count mappings unchanged and document their coupling to the delay ceiling. The retry-queue spec permits clamping Retry-After to the SDK's backoff ceiling. No divergence is introduced in the behavior changed here.

Use published harness 1.32.0, with immutable reusable-workflow SHA dde638562d33572b5c8ac3a2eafc98b92ffa2261. The Compose image, README and report-checker docstring match that release. All three consumer profiles retain the complete 30 capture and 17 flag cases. No filters, capabilities or advisory semantics change.

This changes only compliance infrastructure, not production SDK code, the production Retry-After parser or public API. There is no changeset or SDK release intent. The earlier none intent was removed because this PR has no production-code changes.

💚 How did you test it?

  • The retained loopback regression uses the real SDK for lib_curl, socket and foreground fork_curl. A 429 with Retry-After: 3 followed by 200 must flush successfully with exactly two requests at least 2.5 seconds apart. All three cases failed on the original adapter at about 0.8 seconds and passed with the original fix.
  • Fresh PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s sdk_compliance_adapter -v: 17 tests passed, including the three default-backoff regressions and existing explicit retry-count 0/1/3 checks.
  • Fresh PHP syntax, public API snapshot, workflow Actionlint, Compose configuration and Git whitespace checks pass.
  • Prior complete native SDK run: 2815 tests, 12702 assertions, no failures, one platform listen-queue skip and two existing PHP 8.5 deprecations, using memory_limit=1G. This result predates the harness-pin-only follow-up. Native production code is unchanged. Coverage was unavailable locally because the host has no coverage driver.
  • Exact committed HEAD 5b86c69b8adff6803fbf363114bec9105098ac2c passed isolated full-branch autoreview against origin/main (085df129048960b7763f05d6ddc33783909086fd), including a clean mandatory secret scan. No actionable findings.

Hosted verification

All 27 latest hosted checks pass at 5b86c69b8adff6803fbf363114bec9105098ac2c. The actual downloaded reports from run 44058869193 all pass against published harness 1.32.0:

Consumer Passing / selected Capture Flags Actual harness exit
lib_curl 47/47 30/30 17/17 0
socket 47/47 30/30 17/17 0
fork_curl 47/47 30/30 17/17 0

Each report independently passes the unchanged strict inventory checker, with 47 unique passing rows and no omissions or extra cases. Every hosted lane pulled the published V1 image digest sha256:7eb6c62e2241ddd48a2dfb326652e7933cd2fe26e0ffcad98cd385d603b4eb82. The Run tests command succeeds and its failure-warning step is skipped in each lane, establishing actual process exit 0 rather than advisory green alone. No failing test was filtered, suppressed or rerun to hide a failure.

The report-completeness jobs intentionally validate inventory rather than require every assertion to pass. Actual reports and harness exits must also be checked before claiming compliance is green.

📝 Checklist

  • All commits are signed.
  • I reviewed the submitted code.
  • Regression tests cover the adapter default while retaining explicit retry-count behavior.
  • Scoped docs and image/workflow references match the published harness.
  • No production SDK, public API or breaking change.
  • No changeset or release intent for adapter-only changes.

Agent context

Human-driven, agent-assisted implementation and verification. The original adapter fix and its before/after transport evidence are preserved. This follow-up updates the published harness and removes the unnecessary non-release changeset. New commits are signed and pushed without rewriting history. The isolated Pi reviewer has tools disabled and retains the mandatory secret scan. Human review is required before merge.

Related PRs

Merged prerequisites: sdk-specs #223 and harness #112. Harness 1.32.0 is now published.
SDK follow-ups: iOS #1083, Elixir #253, Node #5747, Ruby #362.

@marandaneto marandaneto self-assigned this Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

posthog-php-socket Compliance Report

Date: 2026-11-18T09:42:27.467734+00:00
Duration: 118455ms

✅ All Tests Passed!

47/47 tests passed


Capture Tests

✅ 30/30 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 25ms
Format Validation.Event Has Uuid ✅ 521ms
Format Validation.Event Has Lib Properties ✅ 522ms
Format Validation.Distinct Id Is String ✅ 522ms
Format Validation.Token Is Present ✅ 522ms
Format Validation.Custom Properties Preserved ✅ 523ms
Format Validation.Event Has Timestamp ✅ 523ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc ✅ 523ms
Retry Behavior.Retries On 503 ✅ 5831ms
Retry Behavior.Does Not Retry On 400 ✅ 2524ms
Retry Behavior.Does Not Retry On 401 ✅ 2526ms
Retry Behavior.Respects Retry After Header ✅ 8527ms
Retry Behavior.Implements Backoff ✅ 16246ms
Retry Behavior.Retries On 500 ✅ 5632ms
Retry Behavior.Retries On 502 ✅ 5628ms
Retry Behavior.Retries On 504 ✅ 5631ms
Retry Behavior.Max Retries Respected ✅ 16243ms
Deduplication.Generates Unique Uuids ✅ 531ms
Deduplication.Preserves Uuid On Retry ✅ 5629ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10838ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5633ms
Deduplication.No Duplicate Events In Batch ✅ 527ms
Deduplication.Different Events Have Different Uuids ✅ 524ms
Compression.Sends Gzip When Enabled ✅ 522ms
Batch Format.Uses Proper Batch Structure ✅ 523ms
Batch Format.Flush With No Events Sends Nothing ✅ 519ms
Batch Format.Multiple Events Batched Together ✅ 511ms
Error Handling.Does Not Retry On 403 ✅ 2524ms
Error Handling.Does Not Retry On 413 ✅ 2525ms
Error Handling.Retries On 408 ✅ 5629ms

Feature_Flags Tests

✅ 17/17 tests passed

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

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

posthog-php-fork_curl Compliance Report

Date: 2026-11-18T09:42:32.787692+00:00
Duration: 118108ms

✅ All Tests Passed!

47/47 tests passed


Capture Tests

✅ 30/30 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 30ms
Format Validation.Event Has Uuid ✅ 526ms
Format Validation.Event Has Lib Properties ✅ 525ms
Format Validation.Distinct Id Is String ✅ 527ms
Format Validation.Token Is Present ✅ 526ms
Format Validation.Custom Properties Preserved ✅ 525ms
Format Validation.Event Has Timestamp ✅ 527ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc ✅ 526ms
Retry Behavior.Retries On 503 ✅ 5848ms
Retry Behavior.Does Not Retry On 400 ✅ 2530ms
Retry Behavior.Does Not Retry On 401 ✅ 2528ms
Retry Behavior.Respects Retry After Header ✅ 8543ms
Retry Behavior.Implements Backoff ✅ 16269ms
Retry Behavior.Retries On 500 ✅ 5643ms
Retry Behavior.Retries On 502 ✅ 5645ms
Retry Behavior.Retries On 504 ✅ 5641ms
Retry Behavior.Max Retries Respected ✅ 16266ms
Deduplication.Generates Unique Uuids ✅ 41ms
Deduplication.Preserves Uuid On Retry ✅ 5647ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10854ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5648ms
Deduplication.No Duplicate Events In Batch ✅ 533ms
Deduplication.Different Events Have Different Uuids ✅ 529ms
Compression.Sends Gzip When Enabled ✅ 530ms
Batch Format.Uses Proper Batch Structure ✅ 528ms
Batch Format.Flush With No Events Sends Nothing ✅ 516ms
Batch Format.Multiple Events Batched Together ✅ 519ms
Error Handling.Does Not Retry On 403 ✅ 2530ms
Error Handling.Does Not Retry On 413 ✅ 2532ms
Error Handling.Retries On 408 ✅ 5645ms

Feature_Flags Tests

✅ 17/17 tests passed

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

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

posthog-php-lib_curl Compliance Report

Date: 2026-11-18T09:41:48.652710+00:00
Duration: 118939ms

✅ All Tests Passed!

47/47 tests passed


Capture Tests

✅ 30/30 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 32ms
Format Validation.Event Has Uuid ✅ 525ms
Format Validation.Event Has Lib Properties ✅ 528ms
Format Validation.Distinct Id Is String ✅ 528ms
Format Validation.Token Is Present ✅ 527ms
Format Validation.Custom Properties Preserved ✅ 527ms
Format Validation.Event Has Timestamp ✅ 527ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc ✅ 526ms
Retry Behavior.Retries On 503 ✅ 5836ms
Retry Behavior.Does Not Retry On 400 ✅ 2531ms
Retry Behavior.Does Not Retry On 401 ✅ 2530ms
Retry Behavior.Respects Retry After Header ✅ 8533ms
Retry Behavior.Implements Backoff ✅ 16252ms
Retry Behavior.Retries On 500 ✅ 5636ms
Retry Behavior.Retries On 502 ✅ 5635ms
Retry Behavior.Retries On 504 ✅ 5635ms
Retry Behavior.Max Retries Respected ✅ 17052ms
Deduplication.Generates Unique Uuids ✅ 236ms
Deduplication.Preserves Uuid On Retry ✅ 5637ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10834ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5149ms
Deduplication.No Duplicate Events In Batch ✅ 532ms
Deduplication.Different Events Have Different Uuids ✅ 529ms
Compression.Sends Gzip When Enabled ✅ 527ms
Batch Format.Uses Proper Batch Structure ✅ 527ms
Batch Format.Flush With No Events Sends Nothing ✅ 522ms
Batch Format.Multiple Events Batched Together ✅ 514ms
Error Handling.Does Not Retry On 403 ✅ 2529ms
Error Handling.Does Not Retry On 413 ✅ 2529ms
Error Handling.Retries On 408 ✅ 5636ms

Feature_Flags Tests

✅ 17/17 tests passed

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

@veria-ai

veria-ai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

…1.1-20261115

# Conflicts:
#	.github/workflows/sdk-compliance.yml
@marandaneto
marandaneto merged commit 47729e0 into main Nov 18, 2026
27 checks passed
@marandaneto
marandaneto deleted the fix/local-harness-1.31.1-20261115 branch November 18, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants