@@ -29,13 +29,13 @@ export const SCHEMA_VERSION = 2;
29
29
* version.
30
30
*/
31
31
export function createOrUpgradeDb (
32
- db : IDBDatabase ,
33
- fromVersion : number ,
34
- toVersion : number
32
+ db : IDBDatabase ,
33
+ fromVersion : number ,
34
+ toVersion : number
35
35
) : void {
36
36
assert (
37
- fromVersion < toVersion && fromVersion >= 0 && toVersion <= 2 ,
38
- 'Unexpected schema upgrade from v${fromVersion} to v{toVersion}.'
37
+ fromVersion < toVersion && fromVersion >= 0 && toVersion <= 2 ,
38
+ 'Unexpected schema upgrade from v${fromVersion} to v{toVersion}.'
39
39
) ;
40
40
41
41
if ( toVersion === 2 ) {
@@ -100,21 +100,18 @@ export class DbMutationQueue {
100
100
/** Keys are automatically assigned via the userId property. */
101
101
static keyPath = 'userId' ;
102
102
103
-
104
103
constructor (
105
104
/**
106
105
* @param userId - The normalized user ID to which this queue belongs.
107
106
*/
108
107
public userId : string ,
109
-
110
108
/**
111
109
* @param lastAcknowledgedBatchId - An identifier for the highest numbered
112
110
* batch that has been acknowledged by the server. All MutationBatches in
113
111
* this queue with batchIds less than or equal to this value are considered
114
112
* to have been acknowledged by the server.
115
113
*/
116
114
public lastAcknowledgedBatchId : number ,
117
-
118
115
/**
119
116
* @param lastStreamToken - A stream token that was previously sent by the
120
117
* server.
@@ -126,7 +123,6 @@ export class DbMutationQueue {
126
123
* only a single stream token is retained.
127
124
*/
128
125
public lastStreamToken : string ,
129
-
130
126
/**
131
127
* @param highestPendingBatchId - An identifier for the highest numbered
132
128
* batch in the mutation queue. This allows for efficient insert of new
@@ -160,19 +156,16 @@ export class DbMutationBatch {
160
156
* @userId userId - The normalized user ID to which this batch belongs.
161
157
*/
162
158
public userId : string ,
163
-
164
159
/**
165
160
* @batchId batchId - An identifier for this batch, allocated by the
166
161
* mutation queue in a monotonically increasing manner.
167
162
*/
168
163
public batchId : BatchId ,
169
-
170
164
/**
171
165
* @param localWriteTimeMs - The local write time of the batch, stored as
172
166
* milliseconds since the epoch.
173
167
*/
174
168
public localWriteTimeMs : number ,
175
-
176
169
/**
177
170
* @param mutations - A list of mutations to apply. All mutations will be
178
171
* applied atomically.
@@ -291,7 +284,6 @@ export class DbRemoteDocument {
291
284
* that no document exists.
292
285
*/
293
286
public noDocument : DbNoDocument | null ,
294
-
295
287
/**
296
288
* @param document - Set to an instance of a Document if there's a cached
297
289
* version of the document.
@@ -348,21 +340,18 @@ export class DbTarget {
348
340
* indexes) to minimize the on-disk cost.
349
341
*/
350
342
public targetId : TargetId ,
351
-
352
343
/**
353
344
* @param canonicalId - The canonical string representing this query. This
354
345
* is not unique.
355
346
*/
356
347
public canonicalId : string ,
357
-
358
348
/**
359
349
* @param readTime - The last readTime received from the Watch Service for
360
350
* this query.
361
351
*
362
352
* This is the same value as TargetChange.read_time in the protos.
363
353
*/
364
354
public readTime : DbTimestamp ,
365
-
366
355
/**
367
356
* @param resumeToken - An opaque, server-assigned token that allows
368
357
* watching a query to be resumed after disconnecting without retransmitting
@@ -382,7 +371,6 @@ export class DbTarget {
382
371
* This is the same value as TargetChange.resume_token in the protos.
383
372
*/
384
373
public resumeToken : string ,
385
-
386
374
/**
387
375
* @param lastListenSequenceNumber - A sequence number representing the
388
376
* last time this query was listened to, used for garbage collection
@@ -399,7 +387,6 @@ export class DbTarget {
399
387
* listened to.
400
388
*/
401
389
public lastListenSequenceNumber : number ,
402
-
403
390
/**
404
391
* @param query - The query for this target.
405
392
*
@@ -474,15 +461,13 @@ export class DbTargetGlobal {
474
461
* See DbTarget.targetId.
475
462
*/
476
463
public highestTargetId : TargetId ,
477
-
478
464
/**
479
465
* @param highestListenSequenceNumber - The highest numbered
480
466
* lastListenSequenceNumber across all targets.
481
467
*
482
468
* See DbTarget.lastListenSequenceNumber.
483
469
*/
484
470
public highestListenSequenceNumber : number ,
485
-
486
471
/**
487
472
* @param lastRemoteSnapshotVersion - A global snapshot version representing
488
473
* the last consistent snapshot we received from the backend. This is
@@ -539,12 +524,10 @@ export class DbTargetChange {
539
524
* @param targetId - The targetId identifying a target.
540
525
*/
541
526
public targetId : TargetId ,
542
-
543
527
/**
544
528
* @param snapshotVersion - The snapshot version for this change.
545
529
*/
546
530
public snapshotVersion : DbTimestamp ,
547
-
548
531
/**
549
532
* @param changes - The keys of the changed documents in this snapshot.
550
533
*/
@@ -578,10 +561,8 @@ export class DbInstanceMetadata {
578
561
constructor (
579
562
/** userId - The normalized user ID to which this batch belongs.*/
580
563
public userId : string ,
581
-
582
564
/** instanceKey - The auto-generated instance key assigned at client startup. */
583
565
public instanceKey : string ,
584
-
585
566
/** updateTimeMs - The last time this state was updated. */
586
567
public updateTimeMs : DbTimestamp
587
568
) { }
0 commit comments