From ab7735d6fc9d5abc5213792badbf0eda6534575d Mon Sep 17 00:00:00 2001 From: bot-hermes Date: Thu, 6 Aug 2026 13:56:22 +0000 Subject: [PATCH] fix(graph): filter soft-deleted projects in getGraphData projectIds query omitted isNull(projects.deletedAt), unlike the sibling projectRows query, so sections of soft-deleted projects were loaded as orphan nodes via inArray(sections.projectId, projectIds). --- apps/web/lib/graph-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/lib/graph-service.ts b/apps/web/lib/graph-service.ts index dac144a..648f010 100644 --- a/apps/web/lib/graph-service.ts +++ b/apps/web/lib/graph-service.ts @@ -60,7 +60,7 @@ export async function getGraphData(domainId: string): 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 projectIds = (await db.select({ id: projects.id }).from(projects).where(and(eq(projects.domainId, domainId), isNull(projects.deletedAt)))).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))),