diff --git a/packages/frontend-2/lib/viewer/composables/setup/postSetup.ts b/packages/frontend-2/lib/viewer/composables/setup/postSetup.ts index d8e1866085..714bdf9846 100644 --- a/packages/frontend-2/lib/viewer/composables/setup/postSetup.ts +++ b/packages/frontend-2/lib/viewer/composables/setup/postSetup.ts @@ -102,7 +102,7 @@ function useViewerObjectAutoLoading() { viewer.loadObjectAsync( objectUrl, authToken.value || undefined, - disableViewerCache ? false : undefined, // TODO: Undo + disableViewerCache ? false : undefined, options?.zoomToObject ) } diff --git a/packages/server/modules/cross-server-sync/services/commit.ts b/packages/server/modules/cross-server-sync/services/commit.ts index be6c6cd6d9..d280c70a3f 100644 --- a/packages/server/modules/cross-server-sync/services/commit.ts +++ b/packages/server/modules/cross-server-sync/services/commit.ts @@ -564,6 +564,9 @@ const loadAllObjectsFromParent = async ( batchPromises = [] } } + + // If any remaining promises - await them + await Promise.all(batchPromises) } /** diff --git a/packages/shared/src/core/helpers/utility.ts b/packages/shared/src/core/helpers/utility.ts index e2bedb614e..83c72dbdb6 100644 --- a/packages/shared/src/core/helpers/utility.ts +++ b/packages/shared/src/core/helpers/utility.ts @@ -32,7 +32,8 @@ export const retry = async (fn: () => MaybeAsync, n: number) => let lastError: Error | undefined for (let i = 0; i < n; i++) { try { - return await Promise.resolve(fn()) + const res = await Promise.resolve(fn()) + return res } catch (error) { lastError = ensureError(error) }