Repository navigation
fix(flags): skip client-only definition warnings - #306
Conversation
posthog-php-fork_curl Compliance ReportDate: 2026-11-07T07:54:50.490645+00:00
|
| Test | Status | Duration |
|---|---|---|
| Format Validation.Event Has Required Fields | ✅ | 36ms |
| Format Validation.Event Has Uuid | ✅ | 527ms |
| Format Validation.Event Has Lib Properties | ✅ | 530ms |
| Format Validation.Distinct Id Is String | ✅ | 530ms |
| Format Validation.Token Is Present | ✅ | 530ms |
| Format Validation.Custom Properties Preserved | ✅ | 529ms |
| Format Validation.Event Has Timestamp | ✅ | 530ms |
| Format Validation.Non Utc Event Timestamp Is Converted To Utc | ✅ | 530ms |
| Retry Behavior.Retries On 503 | ✅ | 5853ms |
| Retry Behavior.Does Not Retry On 400 | ✅ | 2533ms |
| Retry Behavior.Does Not Retry On 401 | ✅ | 2531ms |
| Retry Behavior.Respects Retry After Header | ❌ | 6346ms |
| Retry Behavior.Implements Backoff | ✅ | 16275ms |
| Retry Behavior.Retries On 500 | ✅ | 5646ms |
| Retry Behavior.Retries On 502 | ✅ | 5642ms |
| Retry Behavior.Retries On 504 | ✅ | 5647ms |
| Retry Behavior.Max Retries Respected | ✅ | 16271ms |
| Deduplication.Generates Unique Uuids | ✅ | 537ms |
| Deduplication.Preserves Uuid On Retry | ✅ | 5645ms |
| Deduplication.Preserves Uuid And Timestamp On Retry | ✅ | 10858ms |
| Deduplication.Preserves Uuid And Timestamp On Batch Retry | ✅ | 5647ms |
| Deduplication.No Duplicate Events In Batch | ✅ | 537ms |
| Deduplication.Different Events Have Different Uuids | ✅ | 530ms |
| Compression.Sends Gzip When Enabled | ✅ | 532ms |
| Batch Format.Uses Proper Batch Structure | ✅ | 529ms |
| Batch Format.Flush With No Events Sends Nothing | ✅ | 518ms |
| Batch Format.Multiple Events Batched Together | ✅ | 518ms |
| Error Handling.Does Not Retry On 403 | ✅ | 2532ms |
| Error Handling.Does Not Retry On 413 | ✅ | 2531ms |
| Error Handling.Retries On 408 | ✅ | 5644ms |
Failures
retry_behavior.respects_retry_after_header
Retry delay too short: 810ms < 2500ms
Feature_Flags Tests
✅ 17/17 tests passed
View Details
| Test | Status | Duration |
|---|---|---|
| Request Payload.Request With Person Properties Device Id | ✅ | 524ms |
| 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 | ✅ | 522ms |
| Request Payload.Groups Round Trip | ✅ | 522ms |
| Request Payload.Groups Default To Empty Object | ✅ | 523ms |
| 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 | ✅ | 522ms |
| Request Lifecycle.No Flags Request On Init Alone | ✅ | 516ms |
| Request Lifecycle.No Flags Request On Normal Capture | ✅ | 516ms |
| Request Lifecycle.Two Flag Calls Produce Two Remote Requests | ✅ | 523ms |
| Request Lifecycle.Mock Response Value Is Returned To Caller | ✅ | 523ms |
| Retry Behavior.Retries Flags On 502 | ✅ | 624ms |
| Retry Behavior.Retries Flags On 504 | ✅ | 624ms |
| Side Effect Events.Get Feature Flag Captures Feature Flag Called Event | ✅ | 531ms |
posthog-php-lib_curl Compliance ReportDate: 2026-11-07T07:54:38.363257+00:00
|
| Test | Status | Duration |
|---|---|---|
| Format Validation.Event Has Required Fields | ✅ | 27ms |
| Format Validation.Event Has Uuid | ✅ | 521ms |
| Format Validation.Event Has Lib Properties | ✅ | 523ms |
| Format Validation.Distinct Id Is String | ✅ | 523ms |
| Format Validation.Token Is Present | ✅ | 523ms |
| 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 | ✅ | 5832ms |
| Retry Behavior.Does Not Retry On 400 | ✅ | 2524ms |
| Retry Behavior.Does Not Retry On 401 | ✅ | 2526ms |
| Retry Behavior.Respects Retry After Header | ❌ | 6332ms |
| Retry Behavior.Implements Backoff | ✅ | 16246ms |
| Retry Behavior.Retries On 500 | ✅ | 5632ms |
| Retry Behavior.Retries On 502 | ✅ | 5628ms |
| Retry Behavior.Retries On 504 | ✅ | 5632ms |
| Retry Behavior.Max Retries Respected | ✅ | 17046ms |
| Deduplication.Generates Unique Uuids | ✅ | 227ms |
| Deduplication.Preserves Uuid On Retry | ✅ | 5630ms |
| 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 | ✅ | 523ms |
| Compression.Sends Gzip When Enabled | ✅ | 523ms |
| Batch Format.Uses Proper Batch Structure | ✅ | 522ms |
| Batch Format.Flush With No Events Sends Nothing | ✅ | 519ms |
| Batch Format.Multiple Events Batched Together | ✅ | 511ms |
| Error Handling.Does Not Retry On 403 | ✅ | 2523ms |
| Error Handling.Does Not Retry On 413 | ✅ | 2525ms |
| Error Handling.Retries On 408 | ✅ | 5628ms |
Failures
retry_behavior.respects_retry_after_header
Retry delay too short: 804ms < 2500ms
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 | ✅ | 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 | ✅ | 520ms |
| 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 | ✅ | 521ms |
| Request Payload.Flag Keys To Evaluate Contains Only Requested Key | ✅ | 520ms |
| Request Lifecycle.No Flags Request On Init Alone | ✅ | 516ms |
| Request Lifecycle.No Flags Request On Normal Capture | ✅ | 508ms |
| Request Lifecycle.Two Flag Calls Produce Two Remote Requests | ✅ | 523ms |
| Request Lifecycle.Mock Response Value Is Returned To Caller | ✅ | 522ms |
| Retry Behavior.Retries Flags On 502 | ✅ | 623ms |
| Retry Behavior.Retries Flags On 504 | ✅ | 623ms |
| Side Effect Events.Get Feature Flag Captures Feature Flag Called Event | ✅ | 523ms |
posthog-php-socket Compliance ReportDate: 2026-11-07T07:54:42.430316+00:00
|
| Test | Status | Duration |
|---|---|---|
| Format Validation.Event Has Required Fields | ✅ | 32ms |
| Format Validation.Event Has Uuid | ✅ | 524ms |
| Format Validation.Event Has Lib Properties | ✅ | 527ms |
| Format Validation.Distinct Id Is String | ✅ | 527ms |
| Format Validation.Token Is Present | ✅ | 528ms |
| Format Validation.Custom Properties Preserved | ✅ | 527ms |
| Format Validation.Event Has Timestamp | ✅ | 527ms |
| Format Validation.Non Utc Event Timestamp Is Converted To Utc | ✅ | 527ms |
| Retry Behavior.Retries On 503 | ✅ | 5833ms |
| Retry Behavior.Does Not Retry On 400 | ✅ | 2531ms |
| Retry Behavior.Does Not Retry On 401 | ✅ | 2529ms |
| Retry Behavior.Respects Retry After Header | ❌ | 6333ms |
| Retry Behavior.Implements Backoff | ✅ | 16244ms |
| Retry Behavior.Retries On 500 | ✅ | 5143ms |
| Retry Behavior.Retries On 502 | ✅ | 5634ms |
| Retry Behavior.Retries On 504 | ✅ | 5632ms |
| Retry Behavior.Max Retries Respected | ✅ | 16247ms |
| Deduplication.Generates Unique Uuids | ✅ | 36ms |
| Deduplication.Preserves Uuid On Retry | ✅ | 5630ms |
| Deduplication.Preserves Uuid And Timestamp On Retry | ✅ | 10844ms |
| Deduplication.Preserves Uuid And Timestamp On Batch Retry | ✅ | 5638ms |
| Deduplication.No Duplicate Events In Batch | ✅ | 531ms |
| Deduplication.Different Events Have Different Uuids | ✅ | 527ms |
| Compression.Sends Gzip When Enabled | ✅ | 527ms |
| Batch Format.Uses Proper Batch Structure | ✅ | 526ms |
| Batch Format.Flush With No Events Sends Nothing | ✅ | 522ms |
| Batch Format.Multiple Events Batched Together | ✅ | 512ms |
| Error Handling.Does Not Retry On 403 | ✅ | 2529ms |
| Error Handling.Does Not Retry On 413 | ✅ | 2531ms |
| Error Handling.Retries On 408 | ✅ | 5631ms |
Failures
retry_behavior.respects_retry_after_header
Retry delay too short: 803ms < 2500ms
Feature_Flags Tests
✅ 17/17 tests passed
View Details
| Test | Status | Duration |
|---|---|---|
| Request Payload.Request With Person Properties Device Id | ✅ | 528ms |
| Request Payload.Flags Request Uses V2 Query Param | ✅ | 523ms |
| Request Payload.Flags Request Hits Flags Path Not Decide | ✅ | 524ms |
| Request Payload.Flags Request Omits Authorization Header | ✅ | 523ms |
| Request Payload.Token In Flags Body Matches Init | ✅ | 524ms |
| Request Payload.Groups Round Trip | ✅ | 523ms |
| Request Payload.Groups Default To Empty Object | ✅ | 524ms |
| Request Payload.Disable Geoip False Propagates As Geoip Disable False | ✅ | 523ms |
| Request Payload.Disable Geoip Omitted Defaults To False | ✅ | 523ms |
| Request Payload.Flag Keys To Evaluate Contains Only Requested Key | ✅ | 525ms |
| Request Lifecycle.No Flags Request On Init Alone | ✅ | 518ms |
| Request Lifecycle.No Flags Request On Normal Capture | ✅ | 509ms |
| Request Lifecycle.Two Flag Calls Produce Two Remote Requests | ✅ | 527ms |
| Request Lifecycle.Mock Response Value Is Returned To Caller | ✅ | 525ms |
| Retry Behavior.Retries Flags On 502 | ✅ | 626ms |
| Retry Behavior.Retries Flags On 504 | ✅ | 626ms |
| Side Effect Events.Get Feature Flag Captures Feature Flag Called Event | ✅ | 526ms |
ioannisj
left a comment
There was a problem hiding this comment.
🤖 An AI agent wrote this on behalf of @ioannisj.
Nothing blocking from my side. One question on lib/Client.php: shared-cache loads now warn once per client, and a PHP client is usually built per request, so I'd like to confirm the per-request log volume is intended.
There was a problem hiding this comment.
PostHog Review · Standard · reviewed b213282: 1 Should fix.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
💡 Motivation and Context
Server SDKs currently warn when loaded client-only feature flags cannot resolve locally, even when the application never evaluates them. This follows the warning contract in sdk-specs #169 and the Node fix in posthog-js #5532.
Preserve PHP's fresh-HTTP-200-only warning policy. API and shared-cache loads reconcile warning history, but only fresh API responses emit definition-load warnings. Shared-cache readers therefore stay silent even when PHP-FPM creates a new client per request. Skip client-only candidates and clear their warning history; warn again on the next fresh API response after a flag returns to an eligible runtime. Sort object keys only for warning fingerprints while preserving condition-list order and 304 non-repetition.
Existing PHP spec divergence preserved: As documented in #281, cache-only clients emit no definition-load warnings. This differs from the generic spec's cache-only warning scenarios, including a runtime transition observed only through cache loads. No cross-request warning store or public cache-provider API change is introduced.
Only the exact runtime string
clientis excluded from definition-load warnings. Server, all, null and absent runtimes remain eligible. Keep client definitions, local values and unresolved reasons unchanged. Remove client-only flags from warning history so they warn again if their runtime changes back. Dependency evaluation and Node's separate bulk-fallback optimization are not changed.The changeset explicitly includes a
posthog-laravelpatch release alongside core PHP. Laravel's dependency propagation and this explicit intent combine into one release, so Laravel users receive the fixed core SDK without a duplicate version bump.💚 How did you test it?
./vendor/bin/phpunit --bootstrap vendor/autoload.php --configuration phpunit.xml --no-coverage test/FlagDefinitionCacheProviderTest.php: 54 tests, 686 assertions passed. Coverage includes cache-first then first API emission, unchanged-cache history preservation, API/cache runtime transitions, reordered object keys and changed condition order.--no-coverage: 2,691 tests and 12,124 assertions passed; PHP 8.5 reported two deprecations. No coverage driver is installed.composer api:checkpassed. Full PHPCS reported zero errors and 50 warnings in unchanged files; its-nerrors-only check passed.pnpm change statusandpnpm version -r --dry-runconfirm one patch release each forposthog-phpandposthog-laravel.origin/mainreported no findings.📝 Checklist
If releasing new changes
posthog-phpandposthog-laravel.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Implemented with Pi subagents, Git and the repository's native test tools. Separate Pi reviewers checked the patches and test coverage. Final review used the isolated Pi autoreview helper. The changes follow the merged SDK contract and keep warning collection separate from evaluation.