Skip to content

Fix A/B test for Posthog#213

Merged
MattatDirectus merged 2 commits intomainfrom
bry/posthog-ab-fix
Jan 6, 2026
Merged

Fix A/B test for Posthog#213
MattatDirectus merged 2 commits intomainfrom
bry/posthog-ab-fix

Conversation

@bryantgillespie
Copy link
Member

🤞 hope this does the trick

@netlify
Copy link

netlify bot commented Jan 6, 2026

Deploy Preview for directus-website ready!

Name Link
🔨 Latest commit da2760d
🔍 Latest deploy log https://app.netlify.com/projects/directus-website/deploys/695d2a2226b12a0008ade435
😎 Deploy Preview https://deploy-preview-213--directus-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes A/B testing for Posthog by correcting how feature flag payloads are processed in the experiments middleware. The previous implementation incorrectly used Object.values() which returned only the payload values, but the code was trying to iterate over them as if they were the full payload objects.

Key changes:

  • Updated type from Record<string, boolean | string> to Record<string, JsonType> to match the actual payload structure
  • Changed from Object.values() to Object.entries() to properly iterate over the flag name/payload pairs
  • Fixed the logic to access payload properties correctly using Object.entries() which provides both the flag name and payload object

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MattatDirectus MattatDirectus merged commit 4a6bc4b into main Jan 6, 2026
8 checks passed
@MattatDirectus MattatDirectus deleted the bry/posthog-ab-fix branch January 6, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants