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.

fix(soup): wrong notification entity type check (#1749)

teo80155df3c06f
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
index 630e9676c0..a5cea1604d 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
@@ -41,7 +41,6 @@ import {
type SearchLocation,
type ProjectEntity,
} from '@entity';
-import { queryKeys } from '@macro-entity';
import { useQueryClient } from '@queries/client';
import { createEffectOnEntityTypeNotification } from '@notifications';
import { debounce } from '@solid-primitives/scheduled';
@@ -78,7 +77,10 @@ import { isMobile } from '@core/mobile/isMobile';
import type { SystemSortOption } from '@app/component/next-soup/soup-view/sort-options';
import { usePropertyEditorHotkeys } from '@app/component/property-edit-modal/hooks/usePropertyEditorHotkeys';
import type { SoupItemsQueryFilters } from '@queries/soup/items';
-import { refetchSoupEntity } from '@queries/soup/normalized-cache';
+import {
+ invalidateSoupEntity,
+ refetchSoupEntity,
+} from '@queries/soup/normalized-cache';
const useSoupNotificationInvalidators = () => {
const notificationSource = useGlobalNotificationSource();
@@ -97,14 +99,10 @@ const useSoupNotificationInvalidators = () => {
createEffectOnEntityTypeNotification(
notificationSource,
- 'email',
+ 'email_thread',
(notification) => {
refetchSoupEntity(notification.entity_id, 'emailThread');
- entityQueryClient.invalidateQueries({
- // HACK: this needs to be improved, since we use a single query, per entity invalidations
- // become a little more complicated.
- queryKey: queryKeys.all.entity,
- });
+ invalidateSoupEntity(notification.entity_id);
}
);
diff --git a/js/app/packages/queries/soup/normalized-cache/operations.ts b/js/app/packages/queries/soup/normalized-cache/operations.ts
index e240db66e6..1d92ba5086 100644
--- a/js/app/packages/queries/soup/normalized-cache/operations.ts
+++ b/js/app/packages/queries/soup/normalized-cache/operations.ts
@@ -223,6 +223,10 @@ export async function refetchSoupEntity(
});
if (isErr(result)) {
+ console.error(
+ '[normalized-cache] operations: failed to fetch individual soup item',
+ result
+ );
return;
}