@@ -401,8 +401,8 @@ export class SyncEngine implements RemoteSyncer, SharedClientStateSyncer {
401
401
402
402
async applyRemoteEvent ( remoteEvent : RemoteEvent ) : Promise < void > {
403
403
this . assertSubscribed ( 'applyRemoteEvent()' ) ;
404
+ const changes = await this . localStore . applyRemoteEvent ( remoteEvent ) ;
404
405
try {
405
- const changes = await this . localStore . applyRemoteEvent ( remoteEvent ) ;
406
406
// Update `receivedDocument` as appropriate for any limbo targets.
407
407
objUtils . forEach ( remoteEvent . targetChanges , ( targetId , targetChange ) => {
408
408
const limboResolution = this . limboResolutionsByTarget [ Number ( targetId ) ] ;
@@ -576,8 +576,8 @@ export class SyncEngine implements RemoteSyncer, SharedClientStateSyncer {
576
576
// before listen events.
577
577
this . processUserCallback ( batchId , /*error=*/ null ) ;
578
578
579
+ const changes = await this . localStore . acknowledgeBatch ( mutationBatchResult ) ;
579
580
try {
580
- const changes = await this . localStore . acknowledgeBatch ( mutationBatchResult ) ;
581
581
this . sharedClientState . updateMutationState ( batchId , 'acknowledged' ) ;
582
582
await this . emitNewSnapsAndNotifyLocalStore ( changes ) ;
583
583
} catch ( error ) {
@@ -597,8 +597,8 @@ export class SyncEngine implements RemoteSyncer, SharedClientStateSyncer {
597
597
// listen events.
598
598
this . processUserCallback ( batchId , error ) ;
599
599
600
+ const changes = await this . localStore . rejectBatch ( batchId ) ;
600
601
try {
601
- const changes = await this . localStore . rejectBatch ( batchId ) ;
602
602
this . sharedClientState . updateMutationState ( batchId , 'rejected' , error ) ;
603
603
await this . emitNewSnapsAndNotifyLocalStore ( changes ) ;
604
604
} catch ( error ) {
0 commit comments