File tree 2 files changed +19
-7
lines changed
packages/firestore/test/unit/specs
2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,9 @@ import {
46
46
SpecQueryFilter ,
47
47
SpecQueryOrderBy ,
48
48
SpecStep ,
49
- SpecWatchFilter
49
+ SpecWatchFilter ,
50
+ SpecWriteAck ,
51
+ SpecWriteFailure
50
52
} from './spec_test_runner' ;
51
53
import { TimerId } from '../../../src/util/async_queue' ;
52
54
@@ -474,9 +476,11 @@ export class SpecBuilder {
474
476
this . nextStep ( ) ;
475
477
options = options || { } ;
476
478
477
- this . currentStep = {
478
- writeAck : { version, keepInQueue : ! ! options . keepInQueue }
479
- } ;
479
+ const writeAck : SpecWriteAck = { version } ;
480
+ if ( options . keepInQueue ) {
481
+ writeAck . keepInQueue = true ;
482
+ }
483
+ this . currentStep = { writeAck } ;
480
484
481
485
if ( options . expectUserCallback !== false ) {
482
486
return this . expectUserCallbacks ( { acknowledged : [ doc ] } ) ;
@@ -506,7 +510,11 @@ export class SpecBuilder {
506
510
? options . keepInQueue
507
511
: ! isPermanentFailure ;
508
512
509
- this . currentStep = { failWrite : { error, keepInQueue } } ;
513
+ const failWrite : SpecWriteFailure = { error } ;
514
+ if ( keepInQueue ) {
515
+ failWrite . keepInQueue = true ;
516
+ }
517
+ this . currentStep = { failWrite } ;
510
518
511
519
if ( options . expectUserCallback !== false ) {
512
520
return this . expectUserCallbacks ( { rejected : [ doc ] } ) ;
Original file line number Diff line number Diff line change @@ -1393,9 +1393,11 @@ export type SpecWriteAck = {
1393
1393
* Whether we should keep the write in our internal queue. This should only
1394
1394
* be set to 'true' if the client ignores the write (e.g. a secondary client
1395
1395
* which ignores write acknowledgments).
1396
+ *
1397
+ * Defaults to false.
1396
1398
*/
1397
1399
// PORTING NOTE: Multi-Tab only.
1398
- keepInQueue : boolean ;
1400
+ keepInQueue ? : boolean ;
1399
1401
} ;
1400
1402
1401
1403
export type SpecWriteFailure = {
@@ -1405,8 +1407,10 @@ export type SpecWriteFailure = {
1405
1407
* Whether we should keep the write in our internal queue. This should be set
1406
1408
* to 'true' for transient errors or if the client ignores the failure
1407
1409
* (e.g. a secondary client which ignores write rejections).
1410
+ *
1411
+ * Defaults to false.
1408
1412
*/
1409
- keepInQueue : boolean ;
1413
+ keepInQueue ? : boolean ;
1410
1414
} ;
1411
1415
1412
1416
export interface SpecWatchEntity {
You can’t perform that action at this time.
0 commit comments