From aaf0998129af5b1485580b47ab7929a2ab48f502 Mon Sep 17 00:00:00 2001 From: Naz Date: Tue, 1 Aug 2023 14:19:38 +0800 Subject: [PATCH] Fixed transaction completion error on collection update refs https://github.com/TryGhost/Arch/issues/16 - Without an extra await in the update function the passed in transaction would complete before all updates had a chance to run within this transaction. --- ghost/collections/src/CollectionsService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/collections/src/CollectionsService.ts b/ghost/collections/src/CollectionsService.ts index 7253573acb..20705a96c8 100644 --- a/ghost/collections/src/CollectionsService.ts +++ b/ghost/collections/src/CollectionsService.ts @@ -368,7 +368,7 @@ export class CollectionsService { return; } - this.updatePostsInCollections(postIds, collections, transaction); + await this.updatePostsInCollections(postIds, collections, transaction); }); } @@ -386,7 +386,7 @@ export class CollectionsService { return; } - this.updatePostsInCollections(postIds, collections, transaction); + await this.updatePostsInCollections(postIds, collections, transaction); }); }