Fix race condition which often prevented sending group call started message
The group call update message after starting a group call is currently only sent in the onLocalDeviceStateChanged callback. But often the peekInfo is not available yet when the connection state changes to Joined, effectively preventing the group call update message to be sent. This commit also sends the message in the onPeekChanged callback. It is still only sent at most once, which is ensured by the updateMessageState check. See [#5001][0]. [0]: https://github.com/signalapp/Signal-Desktop/pull/5001
This commit is contained in:
parent
30e8feed8b
commit
ea7a5449f1
1 changed files with 12 additions and 0 deletions
|
@ -478,6 +478,18 @@ export class CallingClass {
|
|||
this.syncGroupCallToRedux(conversationId, groupCall);
|
||||
},
|
||||
onPeekChanged: groupCall => {
|
||||
const localDeviceState = groupCall.getLocalDeviceState();
|
||||
const { eraId } = groupCall.getPeekInfo() || {};
|
||||
if (
|
||||
updateMessageState === GroupCallUpdateMessageState.SentNothing &&
|
||||
localDeviceState.connectionState !== ConnectionState.NotConnected &&
|
||||
localDeviceState.joinState === JoinState.Joined &&
|
||||
eraId
|
||||
) {
|
||||
updateMessageState = GroupCallUpdateMessageState.SentJoin;
|
||||
this.sendGroupCallUpdateMessage(conversationId, eraId);
|
||||
}
|
||||
|
||||
this.updateCallHistoryForGroupCall(
|
||||
conversationId,
|
||||
groupCall.getPeekInfo()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue