internal: incomplete vault systems behind feature flag (#2340)
This commit is contained in:
@@ -21,17 +21,15 @@ export class AccountSyncOperation {
|
||||
* @param receiver A function that receives callback multiple times during the operation
|
||||
*/
|
||||
constructor(
|
||||
private payloads: ServerSyncPushContextualPayload[],
|
||||
public readonly payloads: ServerSyncPushContextualPayload[],
|
||||
private receiver: ResponseSignalReceiver<ServerSyncResponse>,
|
||||
private lastSyncToken: string,
|
||||
private paginationToken: string,
|
||||
private apiService: SNApiService,
|
||||
public readonly options: {
|
||||
syncToken?: string
|
||||
paginationToken?: string
|
||||
sharedVaultUuids?: string[]
|
||||
},
|
||||
) {
|
||||
this.payloads = payloads
|
||||
this.lastSyncToken = lastSyncToken
|
||||
this.paginationToken = paginationToken
|
||||
this.apiService = apiService
|
||||
this.receiver = receiver
|
||||
this.pendingPayloads = payloads.slice()
|
||||
}
|
||||
|
||||
@@ -55,13 +53,19 @@ export class AccountSyncOperation {
|
||||
})
|
||||
const payloads = this.popPayloads(this.upLimit)
|
||||
|
||||
const rawResponse = await this.apiService.sync(payloads, this.lastSyncToken, this.paginationToken, this.downLimit)
|
||||
const rawResponse = await this.apiService.sync(
|
||||
payloads,
|
||||
this.options.syncToken,
|
||||
this.options.paginationToken,
|
||||
this.downLimit,
|
||||
this.options.sharedVaultUuids,
|
||||
)
|
||||
|
||||
const response = new ServerSyncResponse(rawResponse)
|
||||
this.responses.push(response)
|
||||
|
||||
this.lastSyncToken = response.lastSyncToken as string
|
||||
this.paginationToken = response.paginationToken as string
|
||||
this.options.syncToken = response.lastSyncToken as string
|
||||
this.options.paginationToken = response.paginationToken as string
|
||||
|
||||
try {
|
||||
await this.receiver(SyncSignal.Response, response)
|
||||
@@ -75,7 +79,7 @@ export class AccountSyncOperation {
|
||||
}
|
||||
|
||||
get done() {
|
||||
return this.pendingPayloads.length === 0 && !this.paginationToken
|
||||
return this.pendingPayloads.length === 0 && !this.options.paginationToken
|
||||
}
|
||||
|
||||
private get pendingUploadCount() {
|
||||
|
||||
Reference in New Issue
Block a user