@@ -127,7 +127,7 @@ function genericMutationQueueTests(): void {
127
127
for ( let i = 0 ; i < holes . length ; i ++ ) {
128
128
const index = holes [ i ] - i ;
129
129
const batch = batches [ index ] ;
130
- await mutationQueue . removeMutationBatches ( [ batch ] ) ;
130
+ await mutationQueue . removeMutationBatch ( batch ) ;
131
131
132
132
batches . splice ( index , 1 ) ;
133
133
removed . push ( batch ) ;
@@ -146,10 +146,10 @@ function genericMutationQueueTests(): void {
146
146
const batch2 = await addMutationBatch ( ) ;
147
147
expect ( await mutationQueue . countBatches ( ) ) . to . equal ( 2 ) ;
148
148
149
- await mutationQueue . removeMutationBatches ( [ batch2 ] ) ;
149
+ await mutationQueue . removeMutationBatch ( batch2 ) ;
150
150
expect ( await mutationQueue . countBatches ( ) ) . to . equal ( 1 ) ;
151
151
152
- await mutationQueue . removeMutationBatches ( [ batch1 ] ) ;
152
+ await mutationQueue . removeMutationBatch ( batch1 ) ;
153
153
expect ( await mutationQueue . countBatches ( ) ) . to . equal ( 0 ) ;
154
154
} ) ;
155
155
@@ -181,18 +181,18 @@ function genericMutationQueueTests(): void {
181
181
batch2 . batchId
182
182
) ;
183
183
184
- await mutationQueue . removeMutationBatches ( [ batch1 ] ) ;
184
+ await mutationQueue . removeMutationBatch ( batch1 ) ;
185
185
expect ( await mutationQueue . getHighestAcknowledgedBatchId ( ) ) . to . equal (
186
186
batch2 . batchId
187
187
) ;
188
188
189
- await mutationQueue . removeMutationBatches ( [ batch2 ] ) ;
189
+ await mutationQueue . removeMutationBatch ( batch2 ) ;
190
190
expect ( await mutationQueue . getHighestAcknowledgedBatchId ( ) ) . to . equal (
191
191
batch2 . batchId
192
192
) ;
193
193
194
194
// Batch 3 never acknowledged.
195
- await mutationQueue . removeMutationBatches ( [ batch3 ] ) ;
195
+ await mutationQueue . removeMutationBatch ( batch3 ) ;
196
196
expect ( await mutationQueue . getHighestAcknowledgedBatchId ( ) ) . to . equal (
197
197
batch2 . batchId
198
198
) ;
@@ -206,7 +206,7 @@ function genericMutationQueueTests(): void {
206
206
) ;
207
207
208
208
await mutationQueue . acknowledgeBatch ( batch1 , emptyByteString ( ) ) ;
209
- await mutationQueue . removeMutationBatches ( [ batch1 ] ) ;
209
+ await mutationQueue . removeMutationBatch ( batch1 ) ;
210
210
211
211
expect ( await mutationQueue . countBatches ( ) ) . to . equal ( 0 ) ;
212
212
expect ( await mutationQueue . getHighestAcknowledgedBatchId ( ) ) . to . equal (
@@ -226,7 +226,8 @@ function genericMutationQueueTests(): void {
226
226
batch2 . batchId
227
227
) ;
228
228
229
- await mutationQueue . removeMutationBatches ( [ batch1 , batch2 ] ) ;
229
+ await mutationQueue . removeMutationBatch ( batch1 ) ;
230
+ await mutationQueue . removeMutationBatch ( batch2 ) ;
230
231
expect ( await mutationQueue . getHighestAcknowledgedBatchId ( ) ) . to . equal (
231
232
batch2 . batchId
232
233
) ;
@@ -461,16 +462,17 @@ function genericMutationQueueTests(): void {
461
462
await addMutationBatch ( 'foo/baz' )
462
463
] ;
463
464
464
- await mutationQueue . removeMutationBatches ( [ batches [ 0 ] ] ) ;
465
+ await mutationQueue . removeMutationBatch ( batches [ 0 ] ) ;
465
466
expectSetToEqual ( await mutationQueue . collectGarbage ( gc ) , [ ] ) ;
466
467
467
- await mutationQueue . removeMutationBatches ( [ batches [ 1 ] ] ) ;
468
+ await mutationQueue . removeMutationBatch ( batches [ 1 ] ) ;
468
469
expectSetToEqual ( await mutationQueue . collectGarbage ( gc ) , [ key ( 'foo/ba' ) ] ) ;
469
470
470
- await mutationQueue . removeMutationBatches ( [ batches [ 5 ] ] ) ;
471
+ await mutationQueue . removeMutationBatch ( batches [ 5 ] ) ;
471
472
expectSetToEqual ( await mutationQueue . collectGarbage ( gc ) , [ key ( 'foo/baz' ) ] ) ;
472
473
473
- await mutationQueue . removeMutationBatches ( [ batches [ 2 ] , batches [ 3 ] ] ) ;
474
+ await mutationQueue . removeMutationBatch ( batches [ 2 ] ) ;
475
+ await mutationQueue . removeMutationBatch ( batches [ 3 ] ) ;
474
476
expectSetToEqual ( await mutationQueue . collectGarbage ( gc ) , [
475
477
key ( 'foo/bar' ) ,
476
478
key ( 'foo/bar2' )
@@ -479,7 +481,8 @@ function genericMutationQueueTests(): void {
479
481
batches . push ( await addMutationBatch ( 'foo/bar/suffix/baz' ) ) ;
480
482
expectSetToEqual ( await mutationQueue . collectGarbage ( gc ) , [ ] ) ;
481
483
482
- await mutationQueue . removeMutationBatches ( [ batches [ 4 ] , batches [ 6 ] ] ) ;
484
+ await mutationQueue . removeMutationBatch ( batches [ 4 ] ) ;
485
+ await mutationQueue . removeMutationBatch ( batches [ 6 ] ) ;
483
486
expectSetToEqual ( await mutationQueue . collectGarbage ( gc ) , [
484
487
key ( 'foo/bar/suffix/baz' )
485
488
] ) ;
@@ -509,11 +512,11 @@ function genericMutationQueueTests(): void {
509
512
) ;
510
513
} ) ;
511
514
512
- it ( 'can removeMutationBatches ()' , async ( ) => {
515
+ it ( 'can removeMutationBatch ()' , async ( ) => {
513
516
const batches = await createBatches ( 10 ) ;
514
517
const last = batches [ batches . length - 1 ] ;
515
518
516
- await mutationQueue . removeMutationBatches ( [ batches [ 0 ] ] ) ;
519
+ await mutationQueue . removeMutationBatch ( batches [ 0 ] ) ;
517
520
batches . splice ( 0 , 1 ) ;
518
521
expect ( await mutationQueue . countBatches ( ) ) . to . equal ( 9 ) ;
519
522
@@ -525,11 +528,9 @@ function genericMutationQueueTests(): void {
525
528
expectEqualArrays ( found , batches ) ;
526
529
expect ( found . length ) . to . equal ( 9 ) ;
527
530
528
- await mutationQueue . removeMutationBatches ( [
529
- batches [ 0 ] ,
530
- batches [ 1 ] ,
531
- batches [ 2 ]
532
- ] ) ;
531
+ await mutationQueue . removeMutationBatch ( batches [ 0 ] ) ;
532
+ await mutationQueue . removeMutationBatch ( batches [ 1 ] ) ;
533
+ await mutationQueue . removeMutationBatch ( batches [ 2 ] ) ;
533
534
batches . splice ( 0 , 3 ) ;
534
535
expect ( await mutationQueue . countBatches ( ) ) . to . equal ( 6 ) ;
535
536
@@ -539,7 +540,7 @@ function genericMutationQueueTests(): void {
539
540
expectEqualArrays ( found , batches ) ;
540
541
expect ( found . length ) . to . equal ( 6 ) ;
541
542
542
- await mutationQueue . removeMutationBatches ( [ batches [ batches . length - 1 ] ] ) ;
543
+ await mutationQueue . removeMutationBatch ( batches [ batches . length - 1 ] ) ;
543
544
batches . splice ( batches . length - 1 , 1 ) ;
544
545
expect ( await mutationQueue . countBatches ( ) ) . to . equal ( 5 ) ;
545
546
@@ -549,11 +550,11 @@ function genericMutationQueueTests(): void {
549
550
expectEqualArrays ( found , batches ) ;
550
551
expect ( found . length ) . to . equal ( 5 ) ;
551
552
552
- await mutationQueue . removeMutationBatches ( [ batches [ 3 ] ] ) ;
553
+ await mutationQueue . removeMutationBatch ( batches [ 3 ] ) ;
553
554
batches . splice ( 3 , 1 ) ;
554
555
expect ( await mutationQueue . countBatches ( ) ) . to . equal ( 4 ) ;
555
556
556
- await mutationQueue . removeMutationBatches ( [ batches [ 1 ] ] ) ;
557
+ await mutationQueue . removeMutationBatch ( batches [ 1 ] ) ;
557
558
batches . splice ( 1 , 1 ) ;
558
559
expect ( await mutationQueue . countBatches ( ) ) . to . equal ( 3 ) ;
559
560
@@ -564,10 +565,10 @@ function genericMutationQueueTests(): void {
564
565
expect ( found . length ) . to . equal ( 3 ) ;
565
566
expect ( await mutationQueue . checkEmpty ( ) ) . to . equal ( false ) ;
566
567
567
- await mutationQueue . removeMutationBatches ( batches ) ;
568
- found = await mutationQueue . getAllMutationBatchesThroughBatchId (
569
- last . batchId
570
- ) ;
568
+ for ( const batch of batches ) {
569
+ await mutationQueue . removeMutationBatch ( batch ) ;
570
+ }
571
+ found = await mutationQueue . getAllMutationBatches ( ) ;
571
572
expectEqualArrays ( found , [ ] ) ;
572
573
expect ( found . length ) . to . equal ( 0 ) ;
573
574
expect ( await mutationQueue . checkEmpty ( ) ) . to . equal ( true ) ;
0 commit comments