POC: deduplicate dry4swift findings#618
Conversation
posthog-ios Compliance ReportDate: 2026-05-27 15:56:54 UTC
|
| Test | Status | Duration |
|---|---|---|
| Request Payload.Request With Person Properties Device Id | ❌ | 106ms |
| Request Payload.Flags Request Uses V2 Query Param | ❌ | 150ms |
| Request Payload.Flags Request Hits Flags Path Not Decide | ❌ | 147ms |
| Request Payload.Flags Request Omits Authorization Header | ❌ | 126ms |
| Request Payload.Token In Flags Body Matches Init | ❌ | 97ms |
| Request Payload.Groups Round Trip | ❌ | 77ms |
| Request Payload.Groups Default To Empty Object | ❌ | 111ms |
| Request Payload.Person Properties Distinct Id Auto Populated When Caller Omits It | ❌ | 106ms |
| Request Payload.Disable Geoip False Propagates As Geoip Disable False | ❌ | 102ms |
| Request Payload.Disable Geoip Omitted Defaults To False | ❌ | 111ms |
| Request Payload.Flag Keys To Evaluate Contains Only Requested Key | ❌ | 100ms |
| Request Lifecycle.No Flags Request On Init Alone | ✅ | 62ms |
| Request Lifecycle.No Flags Request On Normal Capture | ❌ | 2239ms |
| Request Lifecycle.Two Flag Calls Produce Two Remote Requests | ❌ | 122ms |
| Request Lifecycle.Mock Response Value Is Returned To Caller | ❌ | 112ms |
| Side Effect Events.Get Feature Flag Captures Feature Flag Called Event | ❌ | 116ms |
Failures
request_payload.request_with_person_properties_device_id
404, message='Not Found', url='http://host.docker.internal:8080/get_feature_flag'
request_payload.flags_request_uses_v2_query_param
404, message='Not Found', url='http://host.docker.internal:8080/get_feature_flag'
request_payload.flags_request_hits_flags_path_not_decide
404, message='Not Found', url='http://host.docker.internal:8080/get_feature_flag'
request_payload.flags_request_omits_authorization_header
404, message='Not Found', url='http://host.docker.internal:8080/get_feature_flag'
request_payload.token_in_flags_body_matches_init
404, message='Not Found', url='http://host.docker.internal:8080/get_feature_flag'
request_payload.groups_round_trip
404, message='Not Found', url='http://host.docker.internal:8080/get_feature_flag'
request_payload.groups_default_to_empty_object
404, message='Not Found', url='http://host.docker.internal:8080/get_feature_flag'
request_payload.person_properties_distinct_id_auto_populated_when_caller_omits_it
404, message='Not Found', url='http://host.docker.internal:8080/get_feature_flag'
request_payload.disable_geoip_false_propagates_as_geoip_disable_false
404, message='Not Found', url='http://host.docker.internal:8080/get_feature_flag'
request_payload.disable_geoip_omitted_defaults_to_false
404, message='Not Found', url='http://host.docker.internal:8080/get_feature_flag'
request_payload.flag_keys_to_evaluate_contains_only_requested_key
404, message='Not Found', url='http://host.docker.internal:8080/get_feature_flag'
request_lifecycle.no_flags_request_on_normal_capture
Expected 0 /flags requests, got 2
request_lifecycle.two_flag_calls_produce_two_remote_requests
404, message='Not Found', url='http://host.docker.internal:8080/get_feature_flag'
request_lifecycle.mock_response_value_is_returned_to_caller
404, message='Not Found', url='http://host.docker.internal:8080/get_feature_flag'
side_effect_events.get_feature_flag_captures_feature_flag_called_event
404, message='Not Found', url='http://host.docker.internal:8080/get_feature_flag'
|
@ioannisj @turnipdabeets wdyt? this could be in CI as well |
Had me at installIfNeeded() |
|
No familiar at all with dry4swift and can't find it online? Is this under github.com/dryproject? |
https://github.com/marandaneto/dry4swift i have made a similar pr for python PostHog/posthog-python#623 |
💡 Motivation and Context
POC for using
dry4swiftto identify structural duplicate Swift code and apply low-risk deduplication in the iOS SDK.This PR intentionally focuses on mechanical/refactor-only changes where shared helpers reduce duplicate implementation patterns without changing public behavior.
Key examples:
The initial dry4swift candidate count was reduced from 203 to 120 after the POC refactors.
💚 How did you test it?
make formatmake test— 559 tests passeddry4swiftlocally to compare duplicate candidate counts📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file