Open-source and local-first Slack and Notion alternative that puts you in control of your data
TypeScript chatchat-applicationcrdteditorelectronknowledge-baselocal-firstnotionnotion-alternativerealtime-collaborationself-hostedslacksqliteteam-collaborationwikiyjs
Add an extra equality check for query result updates
Hakan Shehu0161cdfeddfc
diff --git a/apps/desktop/src/main/services/query-service.ts b/apps/desktop/src/main/services/query-service.tsindex 8867d0fc..c5793a79 100644--- a/apps/desktop/src/main/services/query-service.ts+++ b/apps/desktop/src/main/services/query-service.ts@@ -3,6 +3,7 @@ import { QueryHandler, SubscribedQuery } from '@/main/types';import { queryHandlerMap } from '@/main/queries';import { eventBus } from '@/shared/lib/event-bus';import { Event } from '@/shared/types/events';+import { isEqual } from 'lodash-es';class QueryService {private readonly subscribedQueries: Map<string, SubscribedQuery<QueryInput>> =@@ -57,7 +58,11 @@ class QueryService {query.input,query.result);- if (changeCheckResult.hasChanges && changeCheckResult.result) {+ if (+ changeCheckResult.hasChanges &&+ changeCheckResult.result &&+ !isEqual(query.result, changeCheckResult.result)+ ) {const newResult = changeCheckResult.result;this.subscribedQueries.set(id, {input: query.input,