fix(server): honor versioned local property matching - #763
Open
marandaneto wants to merge 2 commits into
Open
Conversation
Contributor
posthog-android Compliance ReportDate: 2026-09-05 15:22:30 UTC ✅ All Tests Passed!46/46 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
marandaneto
marked this pull request as ready for review
September 5, 2026 17:29
Contributor
|
Reviews (1): Last reviewed commit: "fix(server): retain remote response meta..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
Server-side local feature flag evaluation needs to honor the
property_matching_versionreturned with flag definitions. This follows the backend change and the shared SDK contract.is_notcomplementsexactfor known properties.This changes
posthog-serverplus the shared local-evaluation DTO and API snapshot inposthog. Android mobile matching is unaffected. The existing three-argument Java constructor and Kotlin constructor defaults remain available. The@PostHogInternaldata class gains a fourth component and changes its generatedcopysignatures, so consumers calling that internal generated API must recompile. The existing changeset requests patch releases forposthogandposthog-server.Optional harness coverage is separate. This PR does not opt an SDK adapter into it.
💚 How did you test it?
On the final source tree, ran:
./gradlew :posthog-server:test --tests 'com.posthog.server.internal.VersionedPropertyMatchingTest' --console=plain JAVA_TOOL_OPTIONS=-Dnet.bytebuddy.experimental=true ./gradlew :posthog:test :posthog-server:test :posthog:apiCheck :posthog-server:apiCheck --console=plain make checkFormat git diff --checkAll 942 core tests and 552 server tests passed, along with both API checks and formatting. Coverage includes exact/is_not rows across missing/1/2/3 versions, person/group/cohort/dependency evaluation, version-only refreshes, disk-cache serialization, async hydration, and latch-controlled stale remote responses. HTTP request counts verify local results do not silently fall back remotely.
Four new regressions failed on the previously reviewed code and passed after the repair. They cover delayed successful responses and HTTP failures for both missing definitions and inconclusive local matches. They also verify that an old response cannot populate the new cache, and that a subsequent response retains its own metadata on a cache hit.
The local Java 21 runtime needs the documented Byte Buddy experimental option for existing Mockito tests. No dependencies were upgraded. No mobile/emulator build was run, and local results are not a claim that CI passed.
The required isolated committed-branch autoreview against
origin/mainreported no actionable findings atc6da08f6c85691016a791d0302d6f01a0d4e93d6. A fresh pi-review found the delayed-response metadata regression at the previous head. This update fixes that finding, and a new fresh review of the pushed head is pending.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset fileThe existing
.changeset/quiet-booleans-match.mdwas updated to include the delayed-response repair without generating a duplicate. The internal generated API compatibility caveat is noted above.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Pi agents implemented and repaired the server-only matching behavior under human direction. This publication session used Git, GitHub CLI, Gradle, and the isolated Pi autoreview helper to validate and publish the existing implementation. Session reference:
sdk-pr-publication/0ee28abf-0f0d-4ec1-bb6e-2ec23145ea0b(local session, no public transcript).The chosen cache-instance boundary prevents stale remote writes without holding locks across HTTP requests. Returning the complete response entry preserves the caller's metadata independently of cache replacement. Existing constructor compatibility and the API snapshot were preserved. Human review is required before merging.