From 83befd6a84565fef5ecb4fcf9fcec21a847906a2 Mon Sep 17 00:00:00 2001 From: bot-hermes Date: Wed, 29 Jul 2026 13:03:55 +0000 Subject: [PATCH] fix: activity.ts pg_notify syntax and graph-service.ts sections empty inArray --- apps/web/lib/activity.ts | 12 ++---------- apps/web/lib/graph-service.ts | 5 ++++- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/apps/web/lib/activity.ts b/apps/web/lib/activity.ts index ce39daa..b386613 100644 --- a/apps/web/lib/activity.ts +++ b/apps/web/lib/activity.ts @@ -26,14 +26,6 @@ export async function recordActivity(params: RecordActivityParams): Promise { } // Fetch all entities in this domain + const projectIds = (await db.select({ id: projects.id }).from(projects).where(eq(projects.domainId, domainId))).map(p => p.id); const [noteRows, taskRows, habitRows, projectRows, sectionRows, tagRows, domainRows] = await Promise.all([ db.select({ id: notes.id, title: notes.title }).from(notes).where(and(eq(notes.domainId, domainId), isNull(notes.deletedAt))), db.select({ id: tasks.id, title: tasks.title, projectId: tasks.projectId }).from(tasks).where(and(eq(tasks.domainId, domainId), isNull(tasks.deletedAt))), db.select({ id: habits.id, name: habits.name }).from(habits).where(and(eq(habits.domainId, domainId), isNull(habits.deletedAt))), db.select({ id: projects.id, name: projects.name }).from(projects).where(and(eq(projects.domainId, domainId), isNull(projects.deletedAt))), - db.select({ id: sections.id, name: sections.name, projectId: sections.projectId }).from(sections).where(eq(sections.projectId, inArray(sections.projectId, (await db.select({ id: projects.id }).from(projects).where(eq(projects.domainId, domainId))).map(p => p.id)))), + projectIds.length > 0 + ? db.select({ id: sections.id, name: sections.name, projectId: sections.projectId }).from(sections).where(inArray(sections.projectId, projectIds)) + : Promise.resolve([]), db.select({ id: tagsTable.id, name: tagsTable.name }).from(tagsTable), db.select({ id: domains.id, name: domains.name }).from(domains).where(eq(domains.id, domainId)), ]);