:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
refactor(users): name the person-property refresh helper after its cache write (#119094)
posthog[bot]8101814fc099
diff --git a/posthog/api/user.py b/posthog/api/user.pyindex 5ecb769bb9bd..6332eeac75fb 100644--- a/posthog/api/user.py+++ b/posthog/api/user.py@@ -251,7 +251,7 @@ class OnboardingSkipRequestSerializer(serializers.Serializer):)-def _person_properties_refresh_due(user: User) -> bool:+def _reserve_person_properties_refresh_if_due(user: User) -> bool:# Store the last refreshed project, not one key per project. A project switch through# AutoProjectMiddleware sends no "user updated", so a switch back to an earlier project# must refresh too.@@ -883,7 +883,7 @@ class UserSerializer(serializers.ModelSerializer):# was the whole reason for moving away from it. Server-side capture also keeps# working for clients running ad blockers, which a frontend-side identify would# silently miss.- if _person_properties_refresh_due(instance):+ if _reserve_person_properties_refresh_if_due(instance):with tracer.start_as_current_span("user_serializer.identify"):posthoganalytics.capture(distinct_id=instance.distinct_id,