Skip to content

Commit 91b8d64

Browse files
committed
Refine search alert handling: fix search_ids type mismatch, improve shortBio filtering logic, and ensure consistent behavior between notification alerts and alert page display.
1 parent f00c87c commit 91b8d64

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ android {
1111
applicationId "com.compassconnections.app"
1212
minSdkVersion rootProject.ext.minSdkVersion
1313
targetSdkVersion rootProject.ext.targetSdkVersion
14-
versionCode 149
14+
versionCode 150
1515
versionName "1.37.0"
1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717
aaptOptions {

backend/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@compass/api",
3-
"version": "1.60.2",
3+
"version": "1.60.3",
44
"private": true,
55
"description": "Backend API endpoints",
66
"main": "src/serve.ts",

backend/api/src/get-search-alert.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export const getSearchAlert: APIHandler<'get-search-alert'> = async (props, auth
1313
const pg = createSupabaseDirectClient()
1414

1515
const send = await pg.oneOrNone<{
16-
search_ids: number[]
16+
// bigint[] comes back from pg as strings, not numbers.
17+
search_ids: string[]
1718
matched_user_ids: string[]
1819
created_time: string
1920
}>(
@@ -33,13 +34,18 @@ export const getSearchAlert: APIHandler<'get-search-alert'> = async (props, auth
3334
skipId: auth.uid,
3435
skipCount: true,
3536
limit: send.matched_user_ids.length,
37+
// No filtering here — whether a thin profile belongs in this alert was decided when the alert
38+
// was generated, against the search's own toggle. Re-deciding it at read time can only
39+
// disagree with what was sent, reporting people as "no longer available" while their profile
40+
// is sitting right there.
41+
shortBio: true,
3642
}),
3743
// A member may have deleted the search since; the alert it produced still stands, it just loses
3844
// its description.
3945
pg.manyOrNone<{id: number; search_name: string | null; search_filters: any; location: any}>(
4046
`select id, search_name, search_filters, location
4147
from bookmarked_searches
42-
where id = any($(searchIds)) and creator_id = $(uid)`,
48+
where id = any($(searchIds)::bigint[]) and creator_id = $(uid)`,
4349
{searchIds: send.search_ids, uid: auth.uid},
4450
),
4551
])

backend/api/src/send-search-notifications.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ const searchProps = (row: SearchRow, userIds: string[]): profileQueryType => {
5252
...filters,
5353
skipId: row.creator_id,
5454
userId: row.creator_id,
55-
shortBio: true,
55+
// `shortBio` comes from the search's own "include incomplete profiles" toggle and is deliberately
56+
// not overridden: a barely-filled profile is not worth an email unless the member asked to see
57+
// those. Forcing it on here also alerted about people the alert page then filtered back out.
5658
skipCount: true,
5759
userIds,
5860
}

0 commit comments

Comments
 (0)