8000 Event UUIDs are not unique · Issue #30692 · PostHog/posthog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Event UUIDs are not unique #30692

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

Open
isAdrisal opened this issue Apr 2, 2025 · 7 comments
Open

Event UUIDs are not unique #30692

isAdrisal opened this issue Apr 2, 2025 · 7 comments
Labels
bug Something isn't working right feature/activity Feature Tag: Activity (fka Events) feature/ingestion team/product-analytics

Comments

@isAdrisal
Copy link

Bug Description

Events in PostHog (Cloud) have a uuid field. Presumably, this is intended to be a unique value. However, at least in our instance it's not.

Some rough calculations show that around 0.7% of our event UUIDs appear more than once with other events.

Practically, this means when joining on uuid only in sql queries, duplicate rows are returned where they shouldn't.

How to reproduce

See screenshots, or run this query.

select
    uuid,
    count() as uuid_count
from events
group by uuid
order by uuid_count desc

Additional context

Image Image

Debug info

Session: https://us.posthog.com/project/sTMFPsFhdP1Ssg/replay/0195f5c1-8d84-7fd9-8dfe-7c98353c6079?t=10777
Admin: http://go/adminOrgUS/018a1aa0-fba1-0000-7c63-3525ad2656c8 (project ID 34169)
Sentry: http://go/sentryUS/34169
@isAdrisal isAdrisal added the bug Something isn't working right label Apr 2, 2025
@slshults
Copy link
Contributor
slshults commented Apr 2, 2025

Hey @isAdrisal ,

Thanks much for the bug report!

I noticed that the duplicated IDs are on events captured with posthog-react-native v3.1.1, which has been outdated since August of 2024.

Could you please try updating to the latest/current version v3.12.0, and then check to see if you're still seeing duplicated event UUIDs in events captured with the latest version? Thanks!

@isAdrisal
Copy link
Author

Hi @slshults was there a specific known issue that was resolved in later versions of that library?

Just wanting to understand if the upgrade is a likely fix or if we're trying to eliminate a variable as these upgrades typically have some additional work associated with them.

@slshults
Copy link
Contributor
slshults commented Apr 2, 2025

Hey @isAdrisal , That's an understandable question, good call.

There have been several capture-related changes which could impact what you're seeing, but not specifically addressing UUIDs being assigned to multiple events.

Would you be able to search your code for capture calls in which a value is being set for uuid? The library does allow for overriding the UUID, so it'd be good to check to make sure it's the default library behavior, and not an override, which is creating the duplicates.

Please let me know if find that you're not assigning UUIDs, and it's being handled only by our SDK. If that's the case, then I'll get this bug report into a queue for engineers to look at asap. Thanks!

@isAdrisal
Copy link
Author

Hi @slshults, thanks for the extra detail!

I've checked through our codebase and we're not setting uuid on any events. We only use a single .capture() call in a logEvent function we have, and none of the call sites pass in a uuid.

I did a little more digging to try and narrow down the issue. It looks like all of the duplicate uuids are specifically from posthog-react-native v3.1.1.

There was a change to use uuidv7 early last year (timeline below), but I suspect that's not the smoking gun it may have looked like given we were also using that uuidv7 change before upgrading to 3.1.1

Timeline:

posthog-js-lite moved to uuidv7 on Feb 6, 2024: PostHog/posthog-js-lite#160

uuidv7 change was released in posthog-react-native 2.11.2 on Feb 6, 2024: https://github.com/PostHog/posthog-js-lite/blob/main/posthog-react-native/CHANGELOG.md#2112---2024-02-06

We upgraded from posthog-react-native 2.11.6 to 3.1.1 around August 7th, 2024. Note that our previous library version (2.11.6) also included the uuidv7 change.

I'll still look at doing the upgrade to 3.12.0 with the team. From reading the release notes I don't think there's much conflict in the newer releases besides potentially the changes to lifecycle events autocapture settings.

@slshults
Copy link
Contributor
slshults commented Apr 2, 2025

Thanks much @isAdrisal , I've added some labels to this issue, and sent a heads-up to our product analytics engineers!

@isAdrisal
Copy link
Author

@slshults an update — we're still seeing duplicate event UUIDs even after upgrading to posthog-react-native 3.12.0.

We're also seeing the issue on other libraries too, like posthog-go and the web SDK. We are not manually setting UUIDs with any of these libraries.

Image Image

@isAdrisal
Copy link
Author

Is it possible this is just a documentation issue? Are event UUIDs not globally unique, but only unique in a certain scope — like per "event" type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right feature/activity Feature Tag: Activity (fka Events) feature/ingestion team/product-analytics
Projects
None yet
Development

No branches or pull requests

2 participants
0