From 5d5a35fd3260f7bea0a9cf6d448cbf2d9ffb156e Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 27 Oct 2021 08:37:51 +0100 Subject: [PATCH] Don't invalidate users table due to autocolumn fields in schema when hot reloading data in the client library --- packages/client/src/stores/dataSource.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/client/src/stores/dataSource.js b/packages/client/src/stores/dataSource.js index 256571018d..8fb9614a88 100644 --- a/packages/client/src/stores/dataSource.js +++ b/packages/client/src/stores/dataSource.js @@ -1,5 +1,6 @@ import { writable, get } from "svelte/store" import { fetchTableDefinition } from "../api" +import { TableNames } from "../constants" export const createDataSourceStore = () => { const store = writable([]) @@ -72,13 +73,17 @@ export const createDataSourceStore = () => { const schema = definition?.schema if (schema) { Object.values(schema).forEach(fieldSchema => { - if (fieldSchema.type === "link" && fieldSchema.tableId) { + if ( + fieldSchema.type === "link" && + fieldSchema.tableId && + !fieldSchema.autocolumn + ) { invalidations.push(fieldSchema.tableId) } }) } - // Remove and dupes + // Remove any dupes invalidations = [...new Set(invalidations)] // Invalidate all sources