fix: use uuid v7 for personless ids#581
Draft
marandaneto wants to merge 1 commit into
Draft
Conversation
|
Reviews (1): Last reviewed commit: "fix: use uuid v7 for personless ids" | Re-trigger Greptile |
Contributor
posthog-android Compliance ReportDate: 2026-06-19 10:44:43 UTC
|
| Test | Status | Duration |
|---|---|---|
| Format Validation.Event Has Required Fields | ✅ | 381ms |
| Format Validation.Event Has Uuid | ✅ | 38ms |
| Format Validation.Event Has Lib Properties | ✅ | 39ms |
| Format Validation.Distinct Id Is String | ✅ | 29ms |
| Format Validation.Token Is Present | ✅ | 29ms |
| Format Validation.Custom Properties Preserved | ✅ | 28ms |
| Format Validation.Event Has Timestamp | ✅ | 33ms |
| Retry Behavior.Retries On 503 | ✅ | 7027ms |
| Retry Behavior.Does Not Retry On 400 | ✅ | 4023ms |
| Retry Behavior.Does Not Retry On 401 | ✅ | 4025ms |
| Retry Behavior.Respects Retry After Header | ✅ | 7026ms |
| Retry Behavior.Implements Backoff | ✅ | 17035ms |
| Retry Behavior.Retries On 500 | ✅ | 7018ms |
| Retry Behavior.Retries On 502 | ✅ | 7023ms |
| Retry Behavior.Retries On 504 | ✅ | 7019ms |
| Retry Behavior.Max Retries Respected | ✅ | 17036ms |
| Deduplication.Generates Unique Uuids | ✅ | 44ms |
| Deduplication.Preserves Uuid On Retry | ✅ | 7018ms |
| Deduplication.Preserves Uuid And Timestamp On Retry | ✅ | 12022ms |
| Deduplication.Preserves Uuid And Timestamp On Batch Retry | ✅ | 7019ms |
| Deduplication.No Duplicate Events In Batch | ✅ | 37ms |
| Deduplication.Different Events Have Different Uuids | ✅ | 27ms |
| Compression.Sends Gzip When Enabled | ✅ | 18ms |
| Batch Format.Uses Proper Batch Structure | ✅ | 19ms |
| Batch Format.Flush With No Events Sends Nothing | ✅ | 12ms |
| Batch Format.Multiple Events Batched Together | ✅ | 32ms |
| Error Handling.Does Not Retry On 403 | ✅ | 4018ms |
| Error Handling.Does Not Retry On 413 | ❌ | 4016ms |
| Error Handling.Retries On 408 | ✅ | 5028ms |
Failures
error_handling.does_not_retry_on_413
Expected 1 requests, got 2
Feature_Flags Tests
View Details
| Test | Status | Duration |
|---|---|---|
| Request Payload.Request With Person Properties Device Id | ❌ | 31ms |
| Request Payload.Flags Request Uses V2 Query Param | ✅ | 20ms |
| Request Payload.Flags Request Hits Flags Path Not Decide | ✅ | 23ms |
| Request Payload.Flags Request Omits Authorization Header | ✅ | 23ms |
| Request Payload.Token In Flags Body Matches Init | ✅ | 19ms |
| Request Payload.Groups Round Trip | ✅ | 19ms |
| Request Payload.Groups Default To Empty Object | ❌ | 27ms |
| Request Payload.Person Properties Distinct Id Auto Populated When Caller Omits It | ❌ | 29ms |
| Request Payload.Disable Geoip False Propagates As Geoip Disable False | ❌ | 29ms |
| Request Payload.Disable Geoip Omitted Defaults To False | ❌ | 26ms |
| Request Payload.Flag Keys To Evaluate Contains Only Requested Key | ❌ | 37ms |
| Request Lifecycle.No Flags Request On Init Alone | ✅ | 13ms |
| Request Lifecycle.No Flags Request On Normal Capture | ✅ | 41ms |
| Request Lifecycle.Two Flag Calls Produce Two Remote Requests | ✅ | 2034ms |
| Request Lifecycle.Mock Response Value Is Returned To Caller | ✅ | 25ms |
| Side Effect Events.Get Feature Flag Captures Feature Flag Called Event | ✅ | 22ms |
Failures
request_payload.request_with_person_properties_device_id
Expected distinct_id='test_user_123', got '019edf7b-9e34-7d06-af4d-9601e118635d'
request_payload.groups_default_to_empty_object
Field 'groups' not found in /flags request body at path 'groups'. Available keys: ['$anon_distinct_id', '$device_id', 'api_key', 'distinct_id', 'timezone', 'person_properties']
request_payload.person_properties_distinct_id_auto_populated_when_caller_omits_it
Field 'distinct_id' not found in /flags request body at path 'person_properties.distinct_id'. Available keys: ['$lib', '$lib_version', 'email']
request_payload.disable_geoip_false_propagates_as_geoip_disable_false
Field 'geoip_disable' not found in /flags request body at path 'geoip_disable'. Available keys: ['$anon_distinct_id', '$device_id', 'api_key', 'distinct_id', 'timezone', 'person_properties']
request_payload.disable_geoip_omitted_defaults_to_false
Field 'geoip_disable' not found in /flags request body at path 'geoip_disable'. Available keys: ['$anon_distinct_id', '$device_id', 'api_key', 'distinct_id', 'timezone', 'person_properties']
request_payload.flag_keys_to_evaluate_contains_only_requested_key
Field 'flag_keys_to_evaluate' not found in /flags request body at path 'flag_keys_to_evaluate'. Available keys: ['$anon_distinct_id', '$device_id', 'api_key', 'distinct_id', 'timezone', 'person_properties']
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
SDK-generated IDs should use UUID v7 where possible for time-ordered identifiers. A couple of personless distinct ID fallback paths still used random UUID v4 generation, and the event UUID documentation still referred to v4 even though event UUIDs are already v7.
💚 How did you test it?
📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Implemented the requested UUID v7 migration for the remaining runtime SDK-generated personless distinct IDs. Reused the existing
TimeBasedEpochGenerator.generate()helper instead of adding a new dependency, and kept test-only arbitraryUUID.randomUUID()usages unchanged.