PostHog / posthog

🦔 PostHog provides open-source web & product analytics, session recording, feature flagging and A/B testing that you can self-host. Get started - free.
https://posthog.com
Other
22.3k stars 1.35k forks source link

feat(organization-invites): handle duplicate invites #26404

Closed raquelmsmith closed 3 days ago

raquelmsmith commented 3 days ago

Problem

If someone is using the API to create invites, it's possible to create multiple invites for the same user. This is fine but not ideal, esp if someone is using the private_project_access field on the invites to specify projects someone should get access to when they join.

Changes

When creating an invite, the combine_pending_invites field can be optionally applied.

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

Does this work well for both Cloud and self-hosted?

Should!

How did you test this code?

Added a few tests.