Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

perf(notifications): page the GraphQL feed by notified entities (#8451)

teoeeac1d61b356
diff --git a/apps/web/src/lib/queries/notification/graphql/user-notifications.ts b/apps/web/src/lib/queries/notification/graphql/user-notifications.ts
index cfa3e74534..34c670fc0f 100644
--- a/apps/web/src/lib/queries/notification/graphql/user-notifications.ts
+++ b/apps/web/src/lib/queries/notification/graphql/user-notifications.ts
@@ -32,6 +32,8 @@ function normalizeLimit(limit?: number): number {
: DEFAULT_NOTIFICATION_LIMIT;
}
+// NOTIFIED_AT pages through the user's notified entities. A timestamp sort
+// would scan every accessible entity just to read a few notification edges.
function soupInput(cursor: string | null, limit: number): SoupInput {
return cursor
? { continuation: { cursor, expand: true } }
@@ -39,7 +41,7 @@ function soupInput(cursor: string | null, limit: number): SoupInput {
initial: {
expand: true,
limit,
- sortMethod: 'UPDATED_AT',
+ sortMethod: 'NOTIFIED_AT',
},
};
}