Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: SQL editor metadata sync retry flood (#19746)

h3n4l59a88b27993b
diff --git a/frontend/src/store/cache.ts b/frontend/src/store/cache.ts
index ea225a449b..47a6cb202b 100644
--- a/frontend/src/store/cache.ts
+++ b/frontend/src/store/cache.ts
@@ -63,6 +63,7 @@ export const useCache = <K extends KeyType[], T>(namespace: string) => {
setEntity(keys, entity);
}
})
+ .catch(() => undefined)
.finally(() => {
invalidateRequest(keys);
});
@@ -128,7 +129,7 @@ const getRequestCacheMap = <K extends KeyType[], T>(namespace: string) => {
if (existed) {
return existed;
}
- const created = shallowReactive(new Map<string, RequestCacheEntry<K, T>>());
+ const created = new Map<string, RequestCacheEntry<K, T>>();
REQUEST_CACHE.set(namespace, created);
return created;
};
diff --git a/frontend/src/store/modules/v1/dbSchema.ts b/frontend/src/store/modules/v1/dbSchema.ts
index 155475b6e1..7720e83250 100644
--- a/frontend/src/store/modules/v1/dbSchema.ts
+++ b/frontend/src/store/modules/v1/dbSchema.ts
@@ -171,9 +171,7 @@ export const useDBSchemaV1Store = defineStore("dbSchema_v1", () => {
.getDatabaseMetadata(request, {
contextValues: createContextValues().set(silentContextKey, silent),
})
- .then((res) => {
- return setCache({ metadata: res, filter, limit });
- });
+ .then((res) => setCache({ metadata: res, filter, limit }));
return setRequestCache({ name: database, filter, limit, promise });
};
@@ -414,6 +412,11 @@ export const useDBSchemaV1Store = defineStore("dbSchema_v1", () => {
cacheByName.invalidateRequest(cache.keys);
}
});
+ Array.from(cacheByName.entityCacheMap.values()).forEach((cache) => {
+ if (cache.keys[0] === metadataResourceName) {
+ cacheByName.invalidateEntity(cache.keys);
+ }
+ });
};
return {