@@ -20,7 +20,7 @@ import { BatchId, ProtoByteString } from '../core/types';
2020import { DocumentKeySet } from '../model/collections' ;
2121import { DocumentKey } from '../model/document_key' ;
2222import { Mutation } from '../model/mutation' ;
23- import { BATCHID_UNKNOWN , MutationBatch } from '../model/mutation_batch' ;
23+ import { MutationBatch } from '../model/mutation_batch' ;
2424import { emptyByteString } from '../platform/platform' ;
2525import { assert } from '../util/assert' ;
2626import { primitiveComparator } from '../util/misc' ;
@@ -44,9 +44,6 @@ export class MemoryMutationQueue implements MutationQueue {
4444 /** Next value to use when assigning sequential IDs to each mutation batch. */
4545 private nextBatchId : BatchId = 1 ;
4646
47- /** The highest acknowledged mutation in the queue. */
48- private highestAcknowledgedBatchId : BatchId = BATCHID_UNKNOWN ;
49-
5047 /** The last received stream token from the server, used to acknowledge which
5148 * responses the client has processed. Stream tokens are opaque checkpoint
5249 * markers whose only real value is their inclusion in the next request.
@@ -68,11 +65,6 @@ export class MemoryMutationQueue implements MutationQueue {
6865 streamToken : ProtoByteString
6966 ) : PersistencePromise < void > {
7067 const batchId = batch . batchId ;
71- assert (
72- batchId > this . highestAcknowledgedBatchId ,
73- 'Mutation batchIDs must be acknowledged in order'
74- ) ;
75-
7668 const batchIndex = this . indexOfExistingBatchId ( batchId , 'acknowledged' ) ;
7769 assert (
7870 batchIndex === 0 ,
@@ -89,7 +81,6 @@ export class MemoryMutationQueue implements MutationQueue {
8981 check . batchId
9082 ) ;
9183
92- this . highestAcknowledgedBatchId = batchId ;
9384 this . lastStreamToken = streamToken ;
9485 return PersistencePromise . resolve ( ) ;
9586 }
@@ -161,10 +152,7 @@ export class MemoryMutationQueue implements MutationQueue {
161152 transaction : PersistenceTransaction ,
162153 batchId : BatchId
163154 ) : PersistencePromise < MutationBatch | null > {
164- // All batches with batchId <= this.highestAcknowledgedBatchId have been
165- // acknowledged so the first unacknowledged batch after batchID will have a
166- // batchID larger than both of these values.
167- const nextBatchId = Math . max ( batchId , this . highestAcknowledgedBatchId ) + 1 ;
155+ const nextBatchId = batchId + 1 ;
168156
169157 // The requested batchId may still be out of range so normalize it to the
170158 // start of the queue.
0 commit comments