Fix group update deadlock inside conversation queue
This commit is contained in:
parent
7e5a36089e
commit
a7be33b201
1 changed files with 5 additions and 3 deletions
|
@ -30,7 +30,7 @@ import { isTestOrMockEnvironment } from '../environment';
|
|||
import { isAlpha } from './version';
|
||||
import { parseStrict } from './schemas';
|
||||
import { DataReader } from '../sql/Client';
|
||||
import { waitThenMaybeUpdateGroup } from '../groups';
|
||||
import { maybeUpdateGroup } from '../groups';
|
||||
import { isGroupV2 } from './whatTypeOfConversation';
|
||||
|
||||
export function decodeGroupSendEndorsementResponse({
|
||||
|
@ -364,7 +364,8 @@ export async function maybeCreateGroupSendEndorsementState(
|
|||
if (conversation.isMember(ourAci)) {
|
||||
if (!alreadyRefreshedGroupState) {
|
||||
log.info(`${logId}: Missing endorsements for group, refreshing group`);
|
||||
await waitThenMaybeUpdateGroup({ conversation, force: true });
|
||||
await window.waitForEmptyEventQueue();
|
||||
await maybeUpdateGroup({ conversation, force: true });
|
||||
return { state: null, didRefreshGroupState: true };
|
||||
}
|
||||
|
||||
|
@ -399,7 +400,8 @@ export async function maybeCreateGroupSendEndorsementState(
|
|||
log.info(
|
||||
`${logId}: Endorsements are expired (${result.reason}), refreshing group`
|
||||
);
|
||||
await waitThenMaybeUpdateGroup({ conversation, force: true });
|
||||
await window.waitForEmptyEventQueue();
|
||||
await maybeUpdateGroup({ conversation, force: true });
|
||||
return { state: null, didRefreshGroupState: true };
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue