File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ const INITIAL_LARGEST_BATCH_ID = -1;
33
33
* The initial sequence number for each index. Gets updated during index
34
34
* backfill.
35
35
*/
36
- const INITIAL_SEQUENCE_NUMBER = 0 ;
36
+ export const INITIAL_SEQUENCE_NUMBER = 0 ;
37
37
38
38
/**
39
39
* An index definition for field indexes in Firestore.
@@ -126,10 +126,15 @@ function indexSegmentComparator(
126
126
return primitiveComparator ( left . kind , right . kind ) ;
127
127
}
128
128
129
- /** Stores the "high water mark" that indicates how updated the Index is for the current user. */
129
+ /**
130
+ * Stores the "high water mark" that indicates how updated the Index is for the
131
+ * current user.
132
+ */
130
133
export class IndexState {
131
134
constructor (
132
- /** Indicates when the index was last updated (relative to other indexes). */
135
+ /**
136
+ * Indicates when the index was last updated (relative to other indexes).
137
+ */
133
138
readonly sequenceNumber : number ,
134
139
/** The the latest indexed read time, document and batch id. */
135
140
readonly offset : IndexOffset
Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ import {
77
77
IndexKind ,
78
78
IndexOffset ,
79
79
IndexSegment ,
80
- IndexState
80
+ IndexState ,
81
+ INITIAL_SEQUENCE_NUMBER
81
82
} from '../../src/model/field_index' ;
82
83
import { FieldMask } from '../../src/model/field_mask' ;
83
84
import {
@@ -242,7 +243,7 @@ export function fieldIndex(
242
243
( options . fields ?? [ ] ) . map (
243
244
entry => new IndexSegment ( field ( entry [ 0 ] ) , entry [ 1 ] )
244
245
) ,
245
- new IndexState ( - 1 , options . offset ?? IndexOffset . min ( ) )
246
+ new IndexState ( INITIAL_SEQUENCE_NUMBER , options . offset ?? IndexOffset . min ( ) )
246
247
) ;
247
248
}
248
249
You can’t perform that action at this time.
0 commit comments