Skip to content

Open-source and local-first Slack and Notion alternative that puts you in control of your data

Fix delete node mutation detection

Hakan Shehu4cce0fab524b
diff --git a/desktop/src/data/utils.ts b/desktop/src/data/utils.ts
index 7dfd44b9..2a7acf15 100644
--- a/desktop/src/data/utils.ts
+++ b/desktop/src/data/utils.ts
@@ -59,7 +59,12 @@ const extractTablesFromAst = (ast: AST): string[] => {
}
});
} else if (ast.type === 'delete') {
- tables.push(ast.table.table);
+ ast.from.forEach((from) => {
+ const astFrom = from as any;
+ if (astFrom.table) {
+ tables.push(astFrom.table);
+ }
+ });
}
return tables;
diff --git a/desktop/src/hooks/use-conversation.tsx b/desktop/src/hooks/use-conversation.tsx
index 7f4e144f..1697d2bd 100644
--- a/desktop/src/hooks/use-conversation.tsx
+++ b/desktop/src/hooks/use-conversation.tsx
@@ -54,11 +54,10 @@ export const useConversation = (
.filter((row) => row.type === NodeTypes.Message)
.map((row) => row.created_by) ?? [],
),
- ];
+ ].sort();
- const authorIdsHash = hashCode(authorIds.join(','));
const authorsQuery = useQuery({
- queryKey: [`authors:${authorIdsHash}`],
+ queryKey: [`authors:${authorIds.join(',')}`],
enabled: authorIds.length > 0,
queryFn: async ({ queryKey }) => {
const query = workspace.schema