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.

add tanstack devtools

synoetbf2132225994
diff --git a/js/app/packages/macro-entity/src/components/Provider.tsx b/js/app/packages/macro-entity/src/components/Provider.tsx
index 6ba58ff86f..edbcb0c336 100644
--- a/js/app/packages/macro-entity/src/components/Provider.tsx
+++ b/js/app/packages/macro-entity/src/components/Provider.tsx
@@ -1,36 +1,12 @@
import {
QueryClientProvider,
- type QueryObserverOptions,
} from '@tanstack/solid-query';
-import deepEqual from 'fast-deep-equal';
-import type { ParentProps } from 'solid-js';
-import { unwrap } from 'solid-js/store';
+import { SolidQueryDevtools } from '@tanstack/solid-query-devtools';
+import { LOCAL_ONLY } from '@core/constant/featureFlags';
+import { Show, type ParentProps } from 'solid-js';
import { fetchApiToken } from '../queries/auth';
import { queryClient } from '../queries/client';
import { queryKeys } from '../queries/key';
-import type { EntityData } from '../types/entity';
-
-// NOTE: leaving this in as reference for now.
-// Turning this off due to [M-5344]. This is likely unnecessary.
-// @ts-ignore
-// biome-ignore: not-needed
-function _reconcileEntities(
- oldData?: EntityData[],
- newData?: EntityData[]
-): EntityData[] | undefined {
- if (!oldData || !newData) return newData;
-
- const unwrappedOldData = unwrap(oldData);
- return newData.map((entity) => {
- const oldEntity = unwrappedOldData.find(
- (oldEntity) => oldEntity.id === entity.id
- );
- if (oldEntity && deepEqual(oldEntity, entity)) {
- return oldEntity;
- }
- return entity;
- });
-}
export function Provider(props: ParentProps) {
queryClient.setQueryDefaults(queryKeys.all.auth, {
@@ -42,23 +18,13 @@ export function Provider(props: ParentProps) {
queryFn: fetchApiToken,
});
- queryClient.setQueryDefaults(queryKeys.all.entity, {
- gcTime: 1000 * 60 * 60, // 1 hour
- } as Partial<QueryObserverOptions>);
-
- queryClient.setQueryDefaults(queryKeys.all.channel, {
- staleTime: 1000 * 10, // 10 seconds
- });
- queryClient.setQueryDefaults(queryKeys.all.dss, {
- staleTime: 1000 * 60, // 1 minute
- });
- queryClient.setQueryDefaults(queryKeys.all.email, {
- staleTime: 1000, // 1 second
- });
return (
<QueryClientProvider client={queryClient}>
{props.children}
+ <Show when={LOCAL_ONLY}>
+ <SolidQueryDevtools initialIsOpen={false} />
+ </Show>
</QueryClientProvider>
);
}
diff --git a/js/app/packages/queries/channel/channel.ts b/js/app/packages/queries/channel/channel.ts
index ecdc7efea6..5405232549 100644
--- a/js/app/packages/queries/channel/channel.ts
+++ b/js/app/packages/queries/channel/channel.ts
@@ -28,6 +28,7 @@ type ChannelQueryOptions = UseBaseQueryOptions<
function channelQueryOptions(channelId: string): ChannelQueryOptions {
return {
+ gcTime: 0,
queryKey: channelKeys.withID(channelId).queryKey,
queryFn: async () => {
const result = await throwOnErr(