MCPcopy Index your code
hub / github.com/coder/coder / seedAllActiveQueries

Function seedAllActiveQueries

site/src/api/queries/chats.test.ts:817–838  ·  view source on GitHub ↗
(queryClient: QueryClient, chatId: string)

Source from the content-addressed store, hash-verified

815 /** Populate the QueryClient with every query key that is actively
816 * observed on the /agents/:id detail page. */
817 const seedAllActiveQueries = (queryClient: QueryClient, chatId: string) => {
818 // Infinite sidebar list: ["chats", { archived: false }]
819 queryClient.setQueryData(infiniteChatsKey({ archived: false }), {
820 pages: [[makeChat(chatId)]],
821 pageParams: [0],
822 });
823 // Flat chats list: ["chats"]
824 queryClient.setQueryData(chatsKey, [makeChat(chatId)]);
825 // Individual chat: ["chats", chatId]
826 queryClient.setQueryData(chatKey(chatId), makeChat(chatId));
827 // Messages: ["chats", chatId, "messages"]
828 queryClient.setQueryData(chatMessagesKey(chatId), []);
829 // Debug runs: ["chats", chatId, "debug-runs"]
830 queryClient.setQueryData(chatDebugRunsKey(chatId), []);
831 // Diff contents: ["chats", chatId, "diff-contents"]
832 queryClient.setQueryData(chatDiffContentsKey(chatId), { files: [] });
833 // Cost summary: ["chats", "costSummary", "me", undefined]
834 queryClient.setQueryData(
835 chatCostSummaryKey("me", undefined),
836 {} as TypesGen.ChatCostSummary,
837 );
838 };
839
840 /** Keys that should NEVER be invalidated by chat message mutations
841 * because they are completely unrelated to the message flow. */

Callers 1

chats.test.tsFile · 0.85

Calls 7

infiniteChatsKeyFunction · 0.90
chatKeyFunction · 0.90
chatMessagesKeyFunction · 0.90
chatDebugRunsKeyFunction · 0.90
chatDiffContentsKeyFunction · 0.90
chatCostSummaryKeyFunction · 0.90
makeChatFunction · 0.70

Tested by

no test coverage detected