From 333ec0af7281cb09082564c86ba441bcb6abf376 Mon Sep 17 00:00:00 2001 From: Gero Posmyk-Leinemann Date: Mon, 22 Jul 2024 08:50:30 +0200 Subject: [PATCH] [ws-manager-bridge] Persist before publishing any update to maintain consistency guarantees (#20055) --- components/ws-manager-bridge/src/bridge.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ws-manager-bridge/src/bridge.ts b/components/ws-manager-bridge/src/bridge.ts index b86278a51d0b28..35211ed5e9b5c7 100644 --- a/components/ws-manager-bridge/src/bridge.ts +++ b/components/ws-manager-bridge/src/bridge.ts @@ -394,11 +394,11 @@ export class WorkspaceManagerBridge implements Disposable { span.setTag("after", JSON.stringify(instance)); + await this.workspaceDB.trace(ctx).storeInstance(instance); + // now notify all prebuild listeners about updates - and update DB if needed await this.prebuildUpdater.updatePrebuiltWorkspace({ span }, userId, status); - await this.workspaceDB.trace(ctx).storeInstance(instance); - // cleanup // important: call this after the DB update if (!!lifecycleHandler) {