Use new server params for group log fetch
This commit is contained in:
parent
0d19f9131b
commit
6de2710841
3 changed files with 59 additions and 17 deletions
22
ts/groups.ts
22
ts/groups.ts
|
@ -2541,7 +2541,16 @@ export async function respondToGroupV2Migration({
|
|||
logId: `getGroupLog/${logId}`,
|
||||
publicParams,
|
||||
secretParams,
|
||||
request: (sender, options) => sender.getGroupLog(0, options),
|
||||
request: (sender, options) =>
|
||||
sender.getGroupLog(
|
||||
{
|
||||
startVersion: 0,
|
||||
includeFirstState: true,
|
||||
includeLastState: false,
|
||||
maxSupportedChangeEpoch: SUPPORTED_CHANGE_EPOCH,
|
||||
},
|
||||
options
|
||||
),
|
||||
});
|
||||
|
||||
// Attempt to start with the first group state, only later processing future updates
|
||||
|
@ -3276,6 +3285,7 @@ async function getGroupDelta({
|
|||
});
|
||||
|
||||
const currentRevision = group.revision;
|
||||
const isFirstFetch = !isNumber(currentRevision);
|
||||
let revisionToFetch = isNumber(currentRevision)
|
||||
? currentRevision + 1
|
||||
: undefined;
|
||||
|
@ -3284,7 +3294,15 @@ async function getGroupDelta({
|
|||
const changes: Array<Proto.IGroupChanges> = [];
|
||||
do {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
response = await sender.getGroupLog(revisionToFetch, options);
|
||||
response = await sender.getGroupLog(
|
||||
{
|
||||
startVersion: revisionToFetch,
|
||||
includeFirstState: isFirstFetch,
|
||||
includeLastState: false,
|
||||
maxSupportedChangeEpoch: SUPPORTED_CHANGE_EPOCH,
|
||||
},
|
||||
options
|
||||
);
|
||||
changes.push(response.changes);
|
||||
if (response.end) {
|
||||
revisionToFetch = response.end + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue