Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix(email): Invalidate thread cache on new message (#1795)
Evan Hutnik992dda447870
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.tsxindex a5cea1604d..a045fde198 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@@ -42,6 +42,7 @@ import {type ProjectEntity,} from '@entity';import { useQueryClient } from '@queries/client';+import { emailKeys } from '@queries/email/keys';import { createEffectOnEntityTypeNotification } from '@notifications';import { debounce } from '@solid-primitives/scheduled';import { cn } from '@ui/utils/classname';@@ -103,6 +104,10 @@ const useSoupNotificationInvalidators = () => {(notification) => {refetchSoupEntity(notification.entity_id, 'emailThread');invalidateSoupEntity(notification.entity_id);+ // invalidate thread cache so thread gets fetched (with new message) on next load+ entityQueryClient.invalidateQueries({+ queryKey: emailKeys.threadMessages(notification.entity_id).queryKey,+ });});