@procedures/store 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +88 -0
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/indexeddb/sync-state-store.d.ts +40 -0
  5. package/dist/indexeddb/sync-state-store.d.ts.map +1 -0
  6. package/dist/indexeddb/sync-state-store.js +94 -0
  7. package/dist/indexeddb/sync-state-store.js.map +1 -0
  8. package/dist/indexeddb.d.ts +7 -2
  9. package/dist/indexeddb.d.ts.map +1 -1
  10. package/dist/indexeddb.js +6 -2
  11. package/dist/indexeddb.js.map +1 -1
  12. package/dist/storage/api.d.ts +84 -11
  13. package/dist/storage/api.d.ts.map +1 -1
  14. package/dist/storage/api.js +148 -25
  15. package/dist/storage/api.js.map +1 -1
  16. package/dist/storage/feed.d.ts +133 -0
  17. package/dist/storage/feed.d.ts.map +1 -0
  18. package/dist/storage/feed.js +159 -0
  19. package/dist/storage/feed.js.map +1 -0
  20. package/dist/storage/hybrid.d.ts +367 -20
  21. package/dist/storage/hybrid.d.ts.map +1 -1
  22. package/dist/storage/hybrid.js +1295 -206
  23. package/dist/storage/hybrid.js.map +1 -1
  24. package/dist/storage/index.d.ts +6 -2
  25. package/dist/storage/index.d.ts.map +1 -1
  26. package/dist/storage/index.js +6 -1
  27. package/dist/storage/index.js.map +1 -1
  28. package/dist/storage/sync-state.d.ts +56 -0
  29. package/dist/storage/sync-state.d.ts.map +1 -0
  30. package/dist/storage/sync-state.js +58 -0
  31. package/dist/storage/sync-state.js.map +1 -0
  32. package/dist/storage/synced-registry.d.ts +22 -4
  33. package/dist/storage/synced-registry.d.ts.map +1 -1
  34. package/dist/storage/synced-registry.js +63 -31
  35. package/dist/storage/synced-registry.js.map +1 -1
  36. package/dist/storage/types.d.ts +22 -1
  37. package/dist/storage/types.d.ts.map +1 -1
  38. package/package.json +4 -3
  39. package/src/indexeddb/sync-state-store.ts +101 -0
  40. package/src/indexeddb.ts +7 -2
  41. package/src/storage/api.ts +210 -29
  42. package/src/storage/feed.ts +251 -0
  43. package/src/storage/hybrid.ts +1404 -211
  44. package/src/storage/index.ts +17 -0
  45. package/src/storage/sync-state.ts +89 -0
  46. package/src/storage/synced-registry.ts +76 -31
  47. package/src/storage/types.ts +25 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feed.js","sourceRoot":"","sources":["../../src/storage/feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EACL,qBAAqB,EACrB,eAAe,GAKhB,MAAM,oBAAoB,CAAC;AA8F5B,kEAAkE;AAClE,SAAS,YAAY,CAAC,MAAyB;IAC7C,OAAO,OAAQ,MAAmC,CAAC,SAAS,KAAK,UAAU,CAAC;AAC9E,CAAC;AAED,0CAA0C;AAC1C,MAAM,cAAc,GAAG,CAAC,KAAc,EAA+B,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AAEzH,8BAA8B;AAC9B,MAAM,KAAK,GAAG,CAAC,KAAc,EAAqB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,KAAK,QAAQ,CAAC,CAAC;AAEzH;;;;;;;GAOG;AACH,SAAS,OAAO,CAAI,IAAa;IAC/B,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAChE,MAAM,KAAK,GAAG,IAA4I,CAAC;IAC3J,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;QAAE,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AAE,OAAO;gBACpB,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;gBACtB,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC;SACF,CAAC;QACF,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;YAC3C,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAU,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC;YAC9D,CAAC,CAAC,eAAe,CAAU,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACxE,OAAO,GAAG,EAAE;YACV,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,WAAW,EAAE,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;CACF"}
@@ -21,11 +21,32 @@
21
21
  * - A full sync reads the local ids with `getIds()`, so it does not copy each local item.
22
22
  * - A pull reads a local item only when the result depends on it. With `versionOf`, the storage
23
23
  * knows the version of each local item that it wrote or read.
24
+ * - The timers run on the clock of the options. After a failed push, pull or send of the queue,
25
+ * the next delay grows with `backoffDelay` of `@mark1russell7/service/backoff` (roadmap CLI-13).
26
+ * - `getStatus()` and `onStatus()` give the state of the sync and its errors. Before, the errors
27
+ * went to the console.
28
+ * - `query()` runs a selector on the local copy, or on the remote in `remote-only` mode.
24
29
  * - After `close()`, each operation rejects, and a second `close()` does nothing.
30
+ *
31
+ * The sync engine of roadmap CLI-21 (decision D9: a SignalDB collection is one strategy of the local copy):
32
+ * - `observe()` gives the batches of the changes of the storage, with their origins.
33
+ * - `capture: "observe"` queues the changes that the application writes to the local copy itself.
34
+ * - `syncState` keeps the cursor and the base versions after a reload.
35
+ * - `feed` pushes the remote deltas. A delta whose `since` is the cursor applies without a read.
36
+ * - A pull never erases a delta that came during it, and the echo of an older own write never
37
+ * writes over a newer local write.
38
+ * - The syncs of one storage run one at a time, in their order: the deltas and the hints of the
39
+ * feed, the pulls, the pushes, the reads after an own write, and the mode switches. Thus a
40
+ * remote delta and a full sync never run at the same time (Graph R18).
25
41
  */
26
- import type { CollectionStorage, StorageMetadata } from "@procedures/collections";
27
- import { type Duration } from "@procedures/client";
42
+ import type { CollectionStorage, StorageMetadata, StorageObserver, StorageWriteOptions } from "@procedures/collections";
43
+ import { type ListenerErrorHandler } from "@procedures/collections";
44
+ import { type StorageQueryOptions, type StorageQueryPolicy, type StorageSelector } from "@procedures/client/query";
45
+ import { type Clock, type Duration } from "@procedures/client";
28
46
  import { type QueueStore } from "./queue.js";
47
+ import type { SyncStatus } from "./types.js";
48
+ import type { RemoteChangeFeed } from "./feed.js";
49
+ import { type SyncStateStore } from "./sync-state.js";
29
50
  /**
30
51
  * Conflict resolution strategy.
31
52
  */
@@ -147,11 +168,108 @@ export interface HybridStorageOptions {
147
168
  * The storage of the local copy (roadmap R45). A durable storage, for example `SqliteStorage`
148
169
  * of `@procedures/sqlite`, keeps the local copy after a restart. Then a new storage in
149
170
  * `local-only` mode reads the items of the last run. Give it with a durable `queueStore`.
150
- * `close()` closes it. Only the storage writes to the local copy: with `versionOf`, a pull does
151
- * not see a write from outside.
171
+ * `close()` closes it. Without `capture`, only the storage writes to the local copy: with
172
+ * `versionOf`, a pull does not see a write from outside.
152
173
  * @default a new `InMemoryStorage`
153
174
  */
154
175
  local?: LocalCopyStorage<any>;
176
+ /**
177
+ * The capture of the writes of the application to the local copy (roadmap CLI-21).
178
+ *
179
+ * - `"none"`: only the storage writes to the local copy.
180
+ * - `"observe"`: the storage observes the local copy, and it queues each change whose origin is
181
+ * not `origin`. The application can then write to the local copy directly, for example with
182
+ * the synchronous writes of a SignalDB collection. The local copy must have `observe()`.
183
+ *
184
+ * A captured change always goes in the queue, because the application made it already: the limit
185
+ * `maxOfflineOps` does not refuse it. In the modes `write-through` and `remote-only`, the storage
186
+ * sends the queue at once.
187
+ * @default "none"
188
+ */
189
+ capture?: "none" | "observe";
190
+ /**
191
+ * The tag of the writes of this storage (roadmap CLI-21). Each write of the storage to the local
192
+ * copy and to the remote has it. Thus `capture` knows the writes of the storage, and the change
193
+ * events of a server tell which writes came from this storage.
194
+ * @default a new random tag: `hybrid-` and 8 characters
195
+ */
196
+ origin?: string;
197
+ /**
198
+ * The origin of the changes that the sync makes in the local copy, in the batches of `observe()`:
199
+ * a pull, a delta of the feed, a fill after a read, a mode switch and the load of the queue.
200
+ * @default "sync"
201
+ */
202
+ syncOrigin?: string;
203
+ /**
204
+ * The push feed of the remote changes, for example `EventsChangeFeed` (roadmap CLI-21, CLI-15).
205
+ * The storage subscribes in the modes `write-through` and `write-back`.
206
+ *
207
+ * - A delta whose `since` is the cursor applies without a read of the remote.
208
+ * - A delta of the version of the cursor changes nothing: a pull read it already.
209
+ * - Another delta, a gap, a lost event or a new subscription makes the storage pull the changes
210
+ * since its cursor. Many requests while a pull waits make one pull.
211
+ * - A delta that comes during a pull applies after the pull, so the pull does not erase it.
212
+ * - A hint without values (the default of the change events) makes a pull: the values come
213
+ * through the checks of a read. A hint with only deletes applies without a read.
214
+ * - The deltas, the hints, the pulls, the pushes and the mode switches run one at a time. A
215
+ * remote delta and a full sync never run at the same time.
216
+ */
217
+ feed?: RemoteChangeFeed<any>;
218
+ /**
219
+ * The store of the sync state: the cursor and the base versions (roadmap CLI-21). A new storage
220
+ * with the same store asks the remote only for the changes since the cursor, and it finds the
221
+ * conflicts of the base versions. `IndexedDbSyncStateStore` of `@procedures/store/indexeddb`
222
+ * keeps the state in a browser.
223
+ *
224
+ * The state belongs to the local copy. The storage uses a loaded cursor only with the option
225
+ * `local` and a local copy that has items. Give it with a durable local copy.
226
+ */
227
+ syncState?: SyncStateStore;
228
+ /**
229
+ * With `versionOf` or a `feed`: the time that the storage keeps the mark of an own write for its
230
+ * echo (roadmap CLI-21). The mark is the version, or else the JSON of the value. While a newer own
231
+ * write of an id waits for its echo, a remote change with the mark of an older own write is stale,
232
+ * and the storage does not apply it. A local delete is a tombstone: an older echo does not bring
233
+ * the item back. The time starts again when the write goes to the remote.
234
+ * @default 30 seconds
235
+ */
236
+ echoWindow?: Duration;
237
+ /**
238
+ * The clock of the timers: the push of `write-back`, the periodic pull, and the send of the queue
239
+ * after a failure. A test gives `fakeClock` of `@mark1russell7/service/testing`. The timers do
240
+ * not keep a Node process alive.
241
+ * @default the clock of the platform (`realClock` of `@procedures/client`)
242
+ */
243
+ clock?: Clock;
244
+ /**
245
+ * The growth of the delays after a failure (roadmap CLI-13). After `n` failed runs of a timer in
246
+ * a row, its next delay is `interval × factor^n`, at most `maxDelay`, with the random part
247
+ * `jitter`. A run that succeeds sets the delay back to the interval.
248
+ */
249
+ backoff?: {
250
+ /** @default 2 */
251
+ factor?: number;
252
+ /** The longest backoff, for example `minutes(5)`. A timer with a longer interval uses its interval. @default 5 minutes */
253
+ maxDelay?: Duration;
254
+ /** The random part of each delay after a failure, from 0 to 1. @default 0.5 */
255
+ jitter?: number;
256
+ };
257
+ /**
258
+ * The random numbers of the jitter, from 0 up to 1. A test gives a fixed generator.
259
+ * @default Math.random
260
+ */
261
+ random?: () => number;
262
+ /**
263
+ * The function that gets the error of a listener of `onStatus()`. The default throws the error
264
+ * again in a microtask.
265
+ */
266
+ onListenerError?: ListenerErrorHandler;
267
+ /**
268
+ * The query policy of `query()` for a call without a policy. The storage gives it to the local
269
+ * copy, or to the remote in `remote-only` mode. The procedure `find` gives the policy of its host.
270
+ * @default DEFAULT_QUERY_POLICY: no `$regex`
271
+ */
272
+ queryPolicy?: StorageQueryPolicy;
155
273
  }
156
274
  /**
157
275
  * The remote did not take a write of the write-through mode. The write is in the local cache and
@@ -205,6 +323,15 @@ export declare class ModeSwitchError extends Error {
205
323
  readonly code = "MODE_SWITCH_FAILED";
206
324
  constructor(from: HybridMode, to: HybridMode, cause: unknown);
207
325
  }
326
+ /**
327
+ * The sync state store failed (roadmap CLI-21). The storage goes on: after a failed load, the first
328
+ * pull reads all items, and after a failed write, the next write gives the whole state.
329
+ */
330
+ export declare class SyncStateError extends Error {
331
+ readonly name = "SyncStateError";
332
+ readonly code = "SYNC_STATE";
333
+ constructor(action: "load" | "write", cause: unknown);
334
+ }
208
335
  /**
209
336
  * A storage for the local copy of a `HybridStorage` (roadmap R45): a collection storage that gives
210
337
  * its entries. A durable one, for example `SqliteStorage` of `@procedures/sqlite`, keeps the local
@@ -255,14 +382,25 @@ export declare class HybridStorage<T> implements CollectionStorage<T> {
255
382
  private storeDirty;
256
383
  /** The calls of the queue store, one at a time */
257
384
  private storeChain;
258
- /** The push timer of the write-back mode */
259
- private syncTimer;
260
- /** The periodic pull */
261
- private pullTimer;
385
+ /** The push timer of the write-back mode, or undefined without `syncInterval` */
386
+ private readonly pushTimer;
387
+ /** The periodic pull, or undefined without `pullInterval` */
388
+ private readonly pullTimer;
262
389
  /** True while pushQueue sends the queue: the first operation can be on its way */
263
390
  private pushing;
264
391
  /** The timer that sends the queue of the write-through mode after a failure */
265
- private drainTimer;
392
+ private readonly drainTimer;
393
+ /** The failures that a later success did not clear, the newest last */
394
+ private readonly failures;
395
+ /** The number of pushes and pulls that run */
396
+ private syncs;
397
+ /** The time of the last pull that succeeded (`Date.now()`) */
398
+ private lastSync;
399
+ /** The listeners of `onStatus()`, and the status that they got last */
400
+ private readonly statusListeners;
401
+ private lastStatus;
402
+ /** The query policy of a call without a policy */
403
+ private readonly queryPolicy;
266
404
  /** The load of the queue. The writes wait for it. */
267
405
  private readonly loaded;
268
406
  /** The load and the first sync. The reads wait for it, so a read never sees an empty cache by mistake. */
@@ -300,8 +438,163 @@ export declare class HybridStorage<T> implements CollectionStorage<T> {
300
438
  private localWriteCount;
301
439
  /** The number of clears of the local copy: a clear cancels the records of the writes that run */
302
440
  private localClears;
441
+ /** The observers of `observe()` */
442
+ private readonly observers;
443
+ /** The tag of the writes of this storage, and the write options that give it */
444
+ private readonly origin;
445
+ private readonly own;
446
+ /** The origin of the changes that the sync makes in the local copy */
447
+ private readonly syncOrigin;
448
+ /** The push feed, the stop of its subscription, and the number of the subscription */
449
+ private readonly feed;
450
+ private feedStop;
451
+ private feedToken;
452
+ /** True while a pull that a gap asked for waits to start */
453
+ private gapPull;
454
+ /** The stop of the capture of the local copy */
455
+ private readonly stopCapture;
456
+ /** The captured changes that came before the end of the load. Undefined after the load. */
457
+ private captured;
458
+ /** With `versionOf`: the versions of the own writes that wait for their echo */
459
+ private readonly echoes;
460
+ /** The store of the sync state, and the state of its writes */
461
+ private readonly stateStore;
462
+ private stateReset;
463
+ private savedCursor;
464
+ private stateSaving;
465
+ private stateAgain;
466
+ /** True when the application gave the local copy */
467
+ private readonly localGiven;
468
+ /**
469
+ * The own writes of the `write-through` mode that wait for the remote, for each id: their number
470
+ * and the newest value (`undefined` for a delete). A pull does not write over these ids.
471
+ */
472
+ private readonly inFlight;
473
+ /** The number of own clears that wait for the remote: each id waits */
474
+ private inFlightClears;
475
+ /** The remote values that a pull did not apply because an own write of the id waited: `undefined` for a delete */
476
+ private readonly deferred;
477
+ /** The number of the last local write, of the last write of each id, and of the last clear */
478
+ private writeSeq;
479
+ private readonly lastWrite;
480
+ private lastClear;
303
481
  private stats;
304
482
  constructor(remote: CollectionStorage<T>, options?: HybridStorageOptions);
483
+ /**
484
+ * The state of the sync now (roadmap CLI-13).
485
+ *
486
+ * - `connected` is false after a remote call failed, until a remote call succeeds.
487
+ * - `pendingChanges` is the number of operations in the queue.
488
+ * - `syncing` is true while a push or a pull runs.
489
+ * - `lastSync` is the time (`Date.now()`) of the last pull that succeeded.
490
+ * - `error` is the newest failure of a load, a push, a pull or the queue store that a later
491
+ * success of the same work did not clear.
492
+ */
493
+ getStatus(): SyncStatus;
494
+ /**
495
+ * This method starts to send the status to a listener at each change: a failure, a sync that
496
+ * starts or ends, a change of the queue, of the connection or of the mode. A failure of a timer
497
+ * reaches the listeners here: the storage does not write to the console.
498
+ *
499
+ * @returns The function that stops the status. A second use of it does nothing.
500
+ */
501
+ onStatus(listener: (status: SyncStatus) => void): () => void;
502
+ /**
503
+ * This method starts to send the changes of the storage to an observer. Each write that changes
504
+ * the storage gives one batch, before the write resolves.
505
+ *
506
+ * - A write of this storage gives its batch with the origin of its options.
507
+ * - A pull, a delta of the feed, a fill after a read and a mode switch give their changes with
508
+ * `syncOrigin`.
509
+ * - With `capture: "observe"`, a write of the application to the local copy gives the batch of
510
+ * the local copy, with its origin.
511
+ * - In `remote-only` mode, the batches tell the writes of this storage to the remote.
512
+ *
513
+ * @returns The function that stops the batches. A second use of it does nothing.
514
+ * @throws Error after `close()`
515
+ */
516
+ observe(observer: StorageObserver<T>): () => void;
517
+ /** This method sends a batch to the observers. */
518
+ private emit;
519
+ /**
520
+ * This method takes a batch of the local copy. The changes whose origin is not the origin of this
521
+ * storage come from the application: the storage queues them, and its observers get them.
522
+ */
523
+ private onLocalChanges;
524
+ /**
525
+ * This method queues the changes of the application to the local copy (roadmap CLI-21). The
526
+ * operations go in the queue at once, in the order of the changes. The queue store keeps them
527
+ * later. A failure of the store keeps them in memory, and the status shows it.
528
+ */
529
+ private captureChanges;
530
+ /**
531
+ * This method records a captured change as a local write: a sync that runs keeps its value, and
532
+ * the version of the local item is known.
533
+ */
534
+ private noteCaptured;
535
+ /** This method puts a captured operation in the queue, and then in the queue store. */
536
+ private enqueueCaptured;
537
+ /**
538
+ * This method queues the changes that the application made during the load. The load wrote the
539
+ * loaded queue to the local copy, so the changes go to the local copy again, in order.
540
+ */
541
+ private flushCaptured;
542
+ /**
543
+ * The mark of a value in the echo ledger: its version with `versionOf`, or else its JSON. A
544
+ * delete is `null` in the ledger: a tombstone, so an older echo does not bring the item back.
545
+ */
546
+ private echoPrint;
547
+ /** This method records the versions of an own write, for its echo (roadmap CLI-21). */
548
+ private noteOwnWrite;
549
+ /** This method starts the echo time of the ids of an operation again: it goes to the remote. */
550
+ private echoSent;
551
+ /** This method subscribes to the feed in the modes with a local copy and a remote, and stops it in the others. */
552
+ private updateFeed;
553
+ /**
554
+ * This method takes a delta of the feed. The delta applies after the syncs that run, so a pull
555
+ * that runs does not erase it. Each decision about it comes when it applies, at its turn in the
556
+ * chain of the syncs, from the local state of that time: the queue, the own writes that wait,
557
+ * the echo ledger and the versions. On arrival, the storage keeps only the count of the local
558
+ * writes: a local write after the arrival is newer than the delta, and it keeps its value.
559
+ */
560
+ private onRemoteChanges;
561
+ /**
562
+ * This method applies a delta of the feed: without a read when its `since` is the cursor. A
563
+ * delta of the version of the cursor changes nothing. Another delta is a gap: a pull.
564
+ */
565
+ private applyFeed;
566
+ /**
567
+ * This method takes a hint of the feed: the ids that changed, without their values (roadmap
568
+ * CLI-15). The hint applies after the syncs that run, against the cursor and the local state of
569
+ * that time, as a delta does.
570
+ */
571
+ private onRemoteHint;
572
+ /**
573
+ * This method applies a hint. A hint of the version of the cursor changes nothing. A hint whose
574
+ * `since` is the cursor and that changed no value applies its deletes without a read. Each other
575
+ * hint asks for a pull: the values come through the checks of a read of the remote, and the
576
+ * hints that come while the pull waits join it.
577
+ */
578
+ private applyHint;
579
+ /** This method asks for a pull after the syncs that run. A request while a pull waits joins it. */
580
+ private requestPull;
581
+ /** This method loads the sync state: the bases, and the cursor that the load then examines. */
582
+ private loadState;
583
+ /**
584
+ * This method writes the changes of the sync state to its store: the cursor and the bases that
585
+ * changed. The writes run one at a time, and a change during a write goes in the next write.
586
+ */
587
+ private saveState;
588
+ /** One write of the sync state. The first write, and the write after a failure, give the whole state. */
589
+ private writeState;
590
+ /** This method sends the status to the listeners when it changed. */
591
+ private notify;
592
+ /** This method keeps a failure for the status. The failure of an operation replaces its older one. */
593
+ private fail;
594
+ /** This method clears the failure of an operation after a success. */
595
+ private succeed;
596
+ /** A push or a pull: the status shows it while it runs, and keeps its failure. */
597
+ private track;
305
598
  /** The mode of the storage now. */
306
599
  getMode(): HybridMode;
307
600
  /**
@@ -323,7 +616,11 @@ export declare class HybridStorage<T> implements CollectionStorage<T> {
323
616
  private dropLocal;
324
617
  /** This method makes the local copy from the queue only, before a full sync. */
325
618
  private rebuildLocal;
326
- /** This method starts and stops the timers for the mode. */
619
+ /**
620
+ * This method starts and stops the timers for the mode. The push timer runs in `write-back`, the
621
+ * pull timer in `write-through` and `write-back`, and the send of the queue after a failure only
622
+ * in `write-through`. A failed run reports its error in the status, and the next delay grows.
623
+ */
327
624
  private updateTimers;
328
625
  /**
329
626
  * The local item, or else the remote item (which the cache then keeps). When the remote
@@ -341,6 +638,13 @@ export declare class HybridStorage<T> implements CollectionStorage<T> {
341
638
  */
342
639
  getIds(): Promise<string[]>;
343
640
  find(predicate: (item: T) => boolean): Promise<T[]>;
641
+ /**
642
+ * The entries whose items match the selector (roadmap CLI-14): from the local copy, or from the
643
+ * remote in `remote-only` mode. A storage under it with `query()` runs the selector itself, for
644
+ * example `ApiStorage` on its server. Else this method runs `queryEntries()` on its entries. The
645
+ * policy of the call, or of the options, goes to the storage under it.
646
+ */
647
+ query(selector: StorageSelector, options?: StorageQueryOptions, policy?: StorageQueryPolicy): Promise<Array<[string, T]>>;
344
648
  has(id: string): Promise<boolean>;
345
649
  size(): Promise<number>;
346
650
  getBatch(ids: string[]): Promise<Map<string, T>>;
@@ -348,14 +652,15 @@ export declare class HybridStorage<T> implements CollectionStorage<T> {
348
652
  private remoteRead;
349
653
  /**
350
654
  * This method sets an item. The storage takes a copy of the value, so a later change of the
351
- * value does not change the local copy, the queue or the remote write.
655
+ * value does not change the local copy, the queue or the remote write. The origin of the options
656
+ * goes to the batches of `observe()`. The local copy and the remote get the origin of the storage.
352
657
  */
353
- set(id: string, written: T): Promise<void>;
354
- delete(id: string): Promise<boolean>;
355
- clear(): Promise<void>;
658
+ set(id: string, written: T, options?: StorageWriteOptions): Promise<void>;
659
+ delete(id: string, options?: StorageWriteOptions): Promise<boolean>;
660
+ clear(options?: StorageWriteOptions): Promise<void>;
356
661
  /** This method sets several items. The storage takes a copy of each value, as `set` does. */
357
- setBatch(written: Array<[string, T]>): Promise<void>;
358
- deleteBatch(ids: string[]): Promise<number>;
662
+ setBatch(written: Array<[string, T]>, options?: StorageWriteOptions): Promise<void>;
663
+ deleteBatch(ids: string[], options?: StorageWriteOptions): Promise<number>;
359
664
  /**
360
665
  * One write, in the mode of the storage. The result is the result of the local copy, or of the
361
666
  * remote in `remote-only` mode.
@@ -374,6 +679,34 @@ export declare class HybridStorage<T> implements CollectionStorage<T> {
374
679
  * without a word (roadmap R2).
375
680
  */
376
681
  private write;
682
+ /** This method records an own write of the `write-through` mode that goes to the remote. */
683
+ private startFlight;
684
+ /**
685
+ * This method ends an own write that went to the remote: the remote took it, or the queue or the
686
+ * undo replaced it. The deferred remote values of the ids that no own write waits for now go
687
+ * through a new read of the remote, after the syncs that run.
688
+ */
689
+ private endFlight;
690
+ /** True when an own write of the id waits for the remote. */
691
+ private waitsForRemote;
692
+ /**
693
+ * True when a remote value of an id is the value of the newest own write that waits for the
694
+ * remote: its echo. `undefined` is a delete. With `versionOf` the versions decide, else the JSON.
695
+ */
696
+ private isFlightValue;
697
+ /**
698
+ * A pull keeps the local value of an id whose own write waits for the remote, and the storage
699
+ * keeps the remote value for later. True when the pull defers the id. The echo of the write
700
+ * itself is not deferred: it is the local value.
701
+ */
702
+ private deferIfInFlight;
703
+ /**
704
+ * This method applies the deferred remote values of ids whose own writes ended. The storage
705
+ * reads each id from the remote again: the deferred value can be older than the write, or a
706
+ * newer write of another writer. Then the rules of a pull decide. When the remote cannot answer,
707
+ * the deferred value goes through the rules.
708
+ */
709
+ private applyDeferred;
377
710
  /**
378
711
  * The local values of the ids before a write, and a function that puts them back. It puts back
379
712
  * only the ids that no later write changed.
@@ -410,9 +743,9 @@ export declare class HybridStorage<T> implements CollectionStorage<T> {
410
743
  * Force a full sync (both directions).
411
744
  */
412
745
  sync(): Promise<void>;
413
- /** The pull of `syncFromRemote()`, after the syncs that run. */
746
+ /** The pull of `syncFromRemote()`, after the syncs that run. The status keeps its failure. */
414
747
  private pull;
415
- /** The push of `syncToRemote()`, after the syncs that run. */
748
+ /** The push of `syncToRemote()`, after the syncs that run. The status keeps its failure. */
416
749
  private push;
417
750
  /** The error of an operation after `close()`. */
418
751
  private closedError;
@@ -447,7 +780,7 @@ export declare class HybridStorage<T> implements CollectionStorage<T> {
447
780
  private loadQueue;
448
781
  /** The first sync: send the loaded queue, then read the remote. */
449
782
  private initialSync;
450
- /** This method applies a queued operation to the local copy. */
783
+ /** This method applies a queued operation to the local copy. The observers get the origin. */
451
784
  private applyToLocal;
452
785
  /**
453
786
  * This method writes to the local copy. With `versionOf`, it records the version of each item
@@ -472,6 +805,10 @@ export declare class HybridStorage<T> implements CollectionStorage<T> {
472
805
  private localSetBatch;
473
806
  private localDeleteBatch;
474
807
  private localClear;
808
+ /** A clear of the local copy with observers: they get the change when the copy had items. */
809
+ private observedClear;
810
+ /** The ids that a delete of the `remote-only` mode finds, for its batch. */
811
+ private remoteExisting;
475
812
  /**
476
813
  * One pull. `full`: ask for all items (after the local copy was dropped).
477
814
  *
@@ -480,6 +817,12 @@ export declare class HybridStorage<T> implements CollectionStorage<T> {
480
817
  * comes again at the next pull.
481
818
  */
482
819
  private pullRemote;
820
+ /**
821
+ * This method applies remote changes to the local copy: the changes of a pull, or a delta of
822
+ * the feed. `changedLocally` tells the ids that a local write changed after the changes left the
823
+ * remote: they keep their local values. The cursor moves only without conflicts.
824
+ */
825
+ private applyChanges;
483
826
  /**
484
827
  * The remote changes: since the cursor from `getChangesSince` when the remote has it, or else
485
828
  * all entries.
@@ -527,6 +870,10 @@ export declare class HybridStorage<T> implements CollectionStorage<T> {
527
870
  /** Run syncs one at a time. */
528
871
  private serialize;
529
872
  private bump;
873
+ /** A local clear: each id changed. */
874
+ private bumpClear;
875
+ /** True when a local write changed the id after the mark, a value of `writeSeq`. */
876
+ private changedSince;
530
877
  /** The count of local writes of an id: it changes with each write and each clear. */
531
878
  private writeKey;
532
879
  private versionOfItem;
@@ -577,7 +924,7 @@ export declare class HybridStorage<T> implements CollectionStorage<T> {
577
924
  private ensureQueueRoom;
578
925
  /**
579
926
  * In write-through mode, a timer sends the queue after a failure, and again after each failed
580
- * send, until the queue is empty.
927
+ * send, until the queue is empty. The delay after a failed send grows with the backoff.
581
928
  */
582
929
  private scheduleDrain;
583
930
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"hybrid.d.ts","sourceRoot":"","sources":["../../src/storage/hybrid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAkB,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAElG,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAA4D,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAEvG;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAExE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,YAAY,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,eAAe,GAAG,YAAY,GAAG,aAAa,CAAC;AAIvF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;IAExC;;;OAGG;IACH,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,MAAM,GAAG,SAAS,CAAC;IAE1C;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,MAAM,GAAG,SAAS,CAAC;IAE9C;;;;;OAKG;IACH,YAAY,CA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