From fe4e9bb551d1d729d77897748b22fc328a8cff9a Mon Sep 17 00:00:00 2001 From: Travis Jenkins Date: Thu, 30 Nov 2023 10:05:08 -0500 Subject: [PATCH] Making sure we are not applying a schema evolution when checking if we need to update server (#838) --- src/hooks/useServerUpdateRequiredMonitor.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/hooks/useServerUpdateRequiredMonitor.ts b/src/hooks/useServerUpdateRequiredMonitor.ts index fcff88394..4c35fa91c 100644 --- a/src/hooks/useServerUpdateRequiredMonitor.ts +++ b/src/hooks/useServerUpdateRequiredMonitor.ts @@ -40,6 +40,13 @@ const useServerUpdateRequiredMonitor = (draftSpecs: DraftSpecQuery[]) => { binding[collectionNameProp] ); + // If the collection is no longer there then we are probably applying a schema evolution so we + // should not require server update as we just got back from the server + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (!resourceConfig[collectionName]?.data) { + return false; + } + // Do a quick simple disabled check before comparing the entire object if ( // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition