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(notifications): Fix parameters and add tests for participants and subscriptions #57053

Merged
merged 10 commits into from
Oct 3, 2023

Conversation

snigdhas
Copy link
Member

Fixes SENTRY-1662
Fixes SENTRY-1663

@snigdhas snigdhas added this to the Notification Settings 2.0 milestone Sep 27, 2023
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 27, 2023
@snigdhas snigdhas changed the title fix(notifications): Fix params for subscription fix(notifications): Fix parameters and add tests for participants and subscriptions Oct 2, 2023
@snigdhas snigdhas requested a review from scefali October 2, 2023 16:30
@snigdhas snigdhas marked this pull request as ready for review October 2, 2023 16:30
@snigdhas snigdhas requested review from a team as code owners October 2, 2023 16:30
@vercel
Copy link

vercel bot commented Oct 3, 2023

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

Name Status Preview Comments Updated (UTC)
sentry ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 3, 2023 2:20am

@@ -584,7 +588,9 @@ def _get_subscriptions(
project_ids=project_ids,
type=NotificationSettingEnum.WORKFLOW,
)
query_groups = {group for group in groups if (enabled_settings[group.project_id][1])}
query_groups = {
group for group in groups if (not enabled_settings[group.project_id][2])
Copy link
Contributor

Choose a reason for hiding this comment

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

@snigdhas can we use something other than a tuple to make it more obvious what the 2nd parameter is?

Copy link
Member Author

Choose a reason for hiding this comment

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

not really - the response from notification_service needs to be json serializable. We can re-map it to SubscriptionStatus like we do below, but it's not necessarily cleaner here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@snigdhas can we do a dictionary then instead of a tuple?

@snigdhas snigdhas merged commit 51b6e73 into master Oct 3, 2023
49 checks passed
@snigdhas snigdhas deleted the snigdha/fixes branch October 3, 2023 20:10
) == {self.project.id: (False, True)}
) == {
self.project.id: GroupSubscriptionStatus(
is_disabled=False, is_active=True, has_only_inactive_subscriptions=False
Copy link
Contributor

Choose a reason for hiding this comment

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

@snigdhas passing kwargs is so much better, thank you

@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants