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

Include waitlist entries w/ unknown platform when summarizing and sending invites #1760

Merged
merged 2 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions crates/collab/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ impl Db for PostgresDb {
COUNT(*) as count,
COALESCE(SUM(CASE WHEN platform_linux THEN 1 ELSE 0 END), 0) as linux_count,
COALESCE(SUM(CASE WHEN platform_mac THEN 1 ELSE 0 END), 0) as mac_count,
COALESCE(SUM(CASE WHEN platform_windows THEN 1 ELSE 0 END), 0) as windows_count
COALESCE(SUM(CASE WHEN platform_windows THEN 1 ELSE 0 END), 0) as windows_count,
COALESCE(SUM(CASE WHEN platform_unknown THEN 1 ELSE 0 END), 0) as unknown_count
FROM (
SELECT *
FROM signups
Expand All @@ -449,7 +450,7 @@ impl Db for PostgresDb {
FROM signups
WHERE
NOT email_confirmation_sent AND
platform_mac
(platform_mac OR platform_unknown)
LIMIT $1
",
)
Expand Down Expand Up @@ -1720,6 +1721,8 @@ pub struct WaitlistSummary {
pub mac_count: i64,
#[sqlx(default)]
pub windows_count: i64,
#[sqlx(default)]
pub unknown_count: i64,
}

#[derive(FromRow, PartialEq, Debug, Serialize, Deserialize)]
Expand Down
2 changes: 2 additions & 0 deletions crates/collab/src/db_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,7 @@ async fn test_signups() {
mac_count: 8,
linux_count: 4,
windows_count: 2,
unknown_count: 0,
}
);

Expand Down Expand Up @@ -1074,6 +1075,7 @@ async fn test_signups() {
mac_count: 5,
linux_count: 2,
windows_count: 1,
unknown_count: 0,
}
);

Expand Down