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: get_team_attribute_by_quota_resource always return list #27181

Merged

Conversation

patricio-posthog
Copy link
Contributor

Problem

https://posthog.sentry.io/issues/6185491305/?alert_rule_id=14968077&alert_type=issue&notification_uuid=e63c0bfc-9977-4b8b-8b43-2a2c98ed4fa8&project=1899813&referrer=slack

In get_team_attribute_by_quota_resource, if the list team_tokens is empty, instead of returning the empty list, we returned None. That breaks sync_org_quota_limits that expects a list when calling that function.

Changes

We always return a list, even an empty list.

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

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

Only for cloud since it's billing.

How did you test this code?

Current tests are passing.

Copy link
Member

@raquelmsmith raquelmsmith left a comment

Choose a reason for hiding this comment

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

If we want to make sure this is always this way, should we add a test?

@patricio-posthog
Copy link
Contributor Author

If we want to make sure this is always this way, should we add a test?

You're right, I'll add a test for this.

@patricio-posthog patricio-posthog merged commit 9002bfe into master Dec 30, 2024
92 checks passed
@patricio-posthog patricio-posthog deleted the patricio/fix_team_attribute_by_quota_resource branch December 30, 2024 17:06
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