Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: posthog consistent event properties #440

Merged
merged 6 commits into from
Dec 12, 2024

Conversation

mantagen
Copy link
Collaborator

Description

  • ensures consistent key stages are sent with posthog events
  • i think this parsing should really happen higher up (as part of the lesson plan creation itself), but this feels a less risky way of testing it out before implementing more deepy

How to test

  • tricky to test as mostly Aila gets it right
  • but locally you could tests it by overriding an Aila response to have key stage "year 11", but the posthog event should have key stage "ks4"

Copy link

vercel bot commented Dec 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
oak-ai-lesson-assistant ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 12, 2024 0:09am

Copy link

github-actions bot commented Dec 11, 2024

Playwright test results

passed  15 passed
skipped  1 skipped

Details

report  Open report ↗︎
stats  16 tests across 15 suites
duration  2 minutes, 2 seconds
commit  7bd0bf8

Skipped tests

No persona › tests/auth.test.ts › authenticate through Clerk UI

@mantagen mantagen marked this pull request as ready for review December 11, 2024 12:57
@mantagen mantagen requested a review from a team December 11, 2024 12:57
Comment on lines 156 to 163
for (const char of strippedMaybeKeyStage) {
str += char;
const startMatch = startKeyStageMap[str];

if (startMatch) {
return startMatch;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you could also do this by looping Object.entries and comparing with startsWith. Could be clearer for people familiar with functional programming. Could be less clear for people who aren't I suppose!

Copy link
Collaborator

@codeincontext codeincontext left a comment

Choose a reason for hiding this comment

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

This makes sense to me and is approvable 👍

I would prefer to see a self-contained part of the analytics handling like this in its own file like keyStages.ts rather than making helpers.ts any longer, but it's a nit pick

@mantagen mantagen merged commit 7c24485 into main Dec 12, 2024
20 checks passed
@mantagen mantagen deleted the fix/posthog-consistent-event-properties branch December 12, 2024 12:19
@oak-machine-user
Copy link
Collaborator

🎉 This PR is included in version 1.18.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants