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(plugin-server): applyEventPropertyUpdates returns whether it did … #17825

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

bretthoerner
Copy link
Contributor

@bretthoerner bretthoerner commented Oct 5, 2023

…an update, rather than needing to use deep-equals

Problem

Our use of fast-deep-equal trips up on some types: https://posthog.sentry.io/issues/4524975934/?alert_rule_id=12777331&alert_type=issue&notification_uuid=b1b2d9cd-208d-437a-9189-0d1106fb732a&project=6423401&referrer=slack

It turns out that event is trying to $set a field to an object that literally contains a toString key. This trips up fast-deep-equal.

Changes

The object copy and fast-deep-equal comparison wasn't getting us anything that a simple bool doesn't, so just use a bool.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

How did you test this code?

Existing behavior/tests are expected.

@bretthoerner bretthoerner requested a review from tiina303 October 5, 2023 20:01
@bretthoerner bretthoerner force-pushed the brett/applyEventPropertyUpdates branch 2 times, most recently from 5e46475 to a29ae1d Compare October 5, 2023 20:09
@bretthoerner
Copy link
Contributor Author

bretthoerner commented Oct 5, 2023

Added a test that fails on master but passes now.

…an update, rather than needing to use deep-equals
@bretthoerner bretthoerner force-pushed the brett/applyEventPropertyUpdates branch from a29ae1d to 151e025 Compare October 5, 2023 21:09
@bretthoerner
Copy link
Contributor Author

And for good measure: epoberezkin/fast-deep-equal#142

@bretthoerner bretthoerner requested a review from a team October 5, 2023 21:24
Copy link
Contributor

@tiina303 tiina303 left a comment

Choose a reason for hiding this comment

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

Hopefully we can clean up updatePersonDeprecated soon too to do optimistic updates based on version and retry on failure

@bretthoerner bretthoerner merged commit 11e4eaf into master Oct 6, 2023
@bretthoerner bretthoerner deleted the brett/applyEventPropertyUpdates branch October 6, 2023 13:28
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