From 0ffe1fa784d99153518781bc2f784cee72ea69ec Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:47:51 -0500 Subject: [PATCH] Groups: Allow fetch via log when discovering group from storage service Co-authored-by: Scott Nonnenberg --- ts/groups.ts | 5 ++++- ts/test-mock/benchmarks/group_send_bench.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ts/groups.ts b/ts/groups.ts index f2fe49390d..18f699b61d 100644 --- a/ts/groups.ts +++ b/ts/groups.ts @@ -4117,7 +4117,10 @@ async function integrateGroupChanges({ // If this is our first fetch, we will collapse this down to one set of messages const isFirstFetch = !isNumber(group.revision); - if (isFirstFetch) { + // ...but only if there has been more than one revision since creation + const moreThanOneVersion = Boolean(attributes.revision); + + if (isFirstFetch && moreThanOneVersion) { // The first array in finalMessages is from the first revision we could process. It // should contain a message about how we joined the group. const joinMessages = finalMessages[0]; diff --git a/ts/test-mock/benchmarks/group_send_bench.ts b/ts/test-mock/benchmarks/group_send_bench.ts index a0697beff6..4a70ef1cef 100644 --- a/ts/test-mock/benchmarks/group_send_bench.ts +++ b/ts/test-mock/benchmarks/group_send_bench.ts @@ -118,7 +118,7 @@ Bootstrap.benchmark(async (bootstrap: Bootstrap): Promise => { `>> text="${LAST_MESSAGE}"` ) .first(); - await item.click({ timeout: 2 * MINUTE }); + await item.click({ timeout: 3 * MINUTE }); } const deltaList = new Array();