Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/app/src/hooks/cache-owners/cache-owner-registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ const CACHE_OWNER_QUERY_KEY_IMPORTS: CacheOwnerQueryKeyImportRegistry = {
"pluginSettingsViewQueryKey",
],
"hooks/cache-owners/realtime-cache-registry.ts": [
"allDraftQueryKeyPrefix",
"allHostQueryKeyPrefix",
"allMachineEnvironmentQueryKeyPrefix",
"allPluginCatalogSearchQueryKeyPrefix",
Expand Down Expand Up @@ -180,6 +181,7 @@ const CACHE_OWNER_QUERY_KEY_IMPORTS: CacheOwnerQueryKeyImportRegistry = {
],
"hooks/cache-owners/skills-cache-effects.ts": ["projectSkillsQueryKey"],
"hooks/cache-owners/system-cache-effects.ts": [
"allDraftQueryKeyPrefix",
"allEnvironmentDiffFilesQueryKeyPrefix",
"allEnvironmentDiffPatchQueryKeyPrefix",
"allEnvironmentFilePreviewQueryKeyPrefix",
Expand Down
4 changes: 4 additions & 0 deletions apps/app/src/hooks/cache-owners/realtime-cache-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
iterateThreadListCacheEntries,
} from "./thread-list-cache-data";
import {
allDraftQueryKeyPrefix,
allHostQueryKeyPrefix,
allMachineEnvironmentQueryKeyPrefix,
allPluginCatalogSearchQueryKeyPrefix,
Expand Down Expand Up @@ -523,6 +524,9 @@ export const REALTIME_HOST_CHANGE_REGISTRY = {
} satisfies HostChangeRegistry;

export const REALTIME_SYSTEM_CHANGE_REGISTRY = {
"drafts-changed": {
dirty: [() => [allDraftQueryKeyPrefix()]],
},
"config-changed": {
dirty: [
dirtySystemConfigQueries,
Expand Down
2 changes: 2 additions & 0 deletions apps/app/src/hooks/cache-owners/system-cache-effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { QueryKey } from "@tanstack/react-query";
import type { Environment } from "@bb/domain";
import type { SystemConfigResponse } from "@bb/server-contract";
import {
allDraftQueryKeyPrefix,
allEnvironmentDiffFilesQueryKeyPrefix,
allEnvironmentDiffPatchQueryKeyPrefix,
allEnvironmentFilePreviewQueryKeyPrefix,
Expand Down Expand Up @@ -183,6 +184,7 @@ export function resetModelCatalogsAfterStreamerModeChange({

function getServerReconnectInvalidationQueryKeys(): QueryKey[] {
return [
allDraftQueryKeyPrefix(),
hostsQueryKey(),
allHostQueryKeyPrefix(),
projectsQueryKey(),
Expand Down
1 change: 1 addition & 0 deletions apps/app/src/hooks/queries/query-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from "@/lib/path-list-options";

const HOSTS_QUERY_KEY = "hosts";
export const allDraftQueryKeyPrefix = () => ["drafts"] as const;
const HOST_QUERY_KEY = "host";
const HOST_DIRECTORY_QUERY_KEY = "hostDirectory";
const HOST_CLONE_DEFAULT_PATH_QUERY_KEY = "hostCloneDefaultPath";
Expand Down
Loading
Loading