Implement endorsements for group send
This commit is contained in:
parent
5f82c82803
commit
24536e1342
21 changed files with 816 additions and 269 deletions
15
ts/groups.ts
15
ts/groups.ts
|
@ -96,7 +96,10 @@ import { SeenStatus } from './MessageSeenStatus';
|
|||
import { incrementMessageCounter } from './util/incrementMessageCounter';
|
||||
import { sleep } from './util/sleep';
|
||||
import { groupInvitesRoute } from './util/signalRoutes';
|
||||
import { decodeGroupSendEndorsementResponse } from './util/groupSendEndorsements';
|
||||
import {
|
||||
decodeGroupSendEndorsementResponse,
|
||||
isValidGroupSendEndorsementsExpiration,
|
||||
} from './util/groupSendEndorsements';
|
||||
|
||||
type AccessRequiredEnum = Proto.AccessControl.AccessRequired;
|
||||
|
||||
|
@ -3981,6 +3984,16 @@ async function updateGroupViaLogs({
|
|||
let cachedEndorsementsExpiration =
|
||||
await DataReader.getGroupSendCombinedEndorsementExpiration(groupId);
|
||||
|
||||
if (
|
||||
cachedEndorsementsExpiration != null &&
|
||||
!isValidGroupSendEndorsementsExpiration(cachedEndorsementsExpiration)
|
||||
) {
|
||||
log.info(
|
||||
`updateGroupViaLogs/${logId}: Group had invalid endorsements expiration (${cachedEndorsementsExpiration}), fetching new endorsements`
|
||||
);
|
||||
cachedEndorsementsExpiration = null;
|
||||
}
|
||||
|
||||
let response: GroupLogResponseType;
|
||||
let groupSendEndorsementResponse: Uint8Array | null = null;
|
||||
const changes: Array<Proto.IGroupChanges> = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue