@interop/was-react 0.8.3 → 0.10.0

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 (149) hide show
  1. package/README.md +50 -44
  2. package/dist/auth/chapi.d.ts.map +1 -1
  3. package/dist/auth/chapi.js +5 -4
  4. package/dist/auth/chapi.js.map +1 -1
  5. package/dist/auth/loginFlow.d.ts.map +1 -1
  6. package/dist/auth/loginFlow.js +48 -50
  7. package/dist/auth/loginFlow.js.map +1 -1
  8. package/dist/auth/loginRequest.d.ts +38 -5
  9. package/dist/auth/loginRequest.d.ts.map +1 -1
  10. package/dist/auth/loginRequest.js +66 -5
  11. package/dist/auth/loginRequest.js.map +1 -1
  12. package/dist/auth/verifyResponse.d.ts +7 -4
  13. package/dist/auth/verifyResponse.d.ts.map +1 -1
  14. package/dist/auth/verifyResponse.js +23 -13
  15. package/dist/auth/verifyResponse.js.map +1 -1
  16. package/dist/auth/walletRequestTypes.d.ts +9 -90
  17. package/dist/auth/walletRequestTypes.d.ts.map +1 -1
  18. package/dist/config.d.ts +9 -9
  19. package/dist/config.js +0 -0
  20. package/dist/dev/provisionDevGrants.d.ts.map +1 -1
  21. package/dist/dev/provisionDevGrants.js +18 -19
  22. package/dist/dev/provisionDevGrants.js.map +1 -1
  23. package/dist/grants.d.ts +19 -9
  24. package/dist/grants.d.ts.map +1 -1
  25. package/dist/grants.js +17 -2
  26. package/dist/grants.js.map +1 -1
  27. package/dist/identity/agents.d.ts +1 -1
  28. package/dist/identity/agents.d.ts.map +1 -1
  29. package/dist/identity/agents.js +10 -25
  30. package/dist/identity/agents.js.map +1 -1
  31. package/dist/identity/appSession.d.ts +27 -0
  32. package/dist/identity/appSession.d.ts.map +1 -1
  33. package/dist/identity/appSession.js +51 -13
  34. package/dist/identity/appSession.js.map +1 -1
  35. package/dist/identity/seedCredential.d.ts +7 -0
  36. package/dist/identity/seedCredential.d.ts.map +1 -1
  37. package/dist/identity/seedCredential.js +11 -14
  38. package/dist/identity/seedCredential.js.map +1 -1
  39. package/dist/identity/seedStore.d.ts +19 -0
  40. package/dist/identity/seedStore.d.ts.map +1 -1
  41. package/dist/identity/seedStore.js +40 -13
  42. package/dist/identity/seedStore.js.map +1 -1
  43. package/dist/index.d.ts +5 -6
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +4 -5
  46. package/dist/index.js.map +1 -1
  47. package/dist/jsonLd.d.ts +19 -0
  48. package/dist/jsonLd.d.ts.map +1 -0
  49. package/dist/jsonLd.js +24 -0
  50. package/dist/jsonLd.js.map +1 -0
  51. package/dist/mui/AdoptDialog.d.ts.map +1 -1
  52. package/dist/mui/AdoptDialog.js +7 -3
  53. package/dist/mui/AdoptDialog.js.map +1 -1
  54. package/dist/mui/ClearDataDialog.d.ts.map +1 -1
  55. package/dist/mui/ClearDataDialog.js +12 -11
  56. package/dist/mui/ClearDataDialog.js.map +1 -1
  57. package/dist/mui/ConfirmDialog.d.ts +35 -0
  58. package/dist/mui/ConfirmDialog.d.ts.map +1 -0
  59. package/dist/mui/ConfirmDialog.js +18 -0
  60. package/dist/mui/ConfirmDialog.js.map +1 -0
  61. package/dist/mui/LogoutDialog.d.ts.map +1 -1
  62. package/dist/mui/LogoutDialog.js +7 -3
  63. package/dist/mui/LogoutDialog.js.map +1 -1
  64. package/dist/react/documentApp.d.ts +29 -0
  65. package/dist/react/documentApp.d.ts.map +1 -1
  66. package/dist/react/documentApp.js +9 -38
  67. package/dist/react/documentApp.js.map +1 -1
  68. package/dist/react/hooks.d.ts +13 -7
  69. package/dist/react/hooks.d.ts.map +1 -1
  70. package/dist/react/hooks.js +17 -11
  71. package/dist/react/hooks.js.map +1 -1
  72. package/dist/session/authStore.d.ts +9 -9
  73. package/dist/session/authStore.d.ts.map +1 -1
  74. package/dist/session/authStore.js +100 -96
  75. package/dist/session/authStore.js.map +1 -1
  76. package/dist/storage/adopt.d.ts +5 -1
  77. package/dist/storage/adopt.d.ts.map +1 -1
  78. package/dist/storage/adopt.js +8 -24
  79. package/dist/storage/adopt.js.map +1 -1
  80. package/dist/storage/entityStore.d.ts.map +1 -1
  81. package/dist/storage/entityStore.js +27 -20
  82. package/dist/storage/entityStore.js.map +1 -1
  83. package/dist/storage/localStore.d.ts +12 -6
  84. package/dist/storage/localStore.d.ts.map +1 -1
  85. package/dist/storage/localStore.js +118 -74
  86. package/dist/storage/localStore.js.map +1 -1
  87. package/dist/storage/sharedCollectionReader.d.ts +1 -1
  88. package/dist/storage/sharedCollectionReader.d.ts.map +1 -1
  89. package/dist/storage/sharedCollectionReader.js +79 -81
  90. package/dist/storage/sharedCollectionReader.js.map +1 -1
  91. package/dist/storage/storageManager.d.ts +3 -1
  92. package/dist/storage/storageManager.d.ts.map +1 -1
  93. package/dist/storage/storageManager.js +20 -6
  94. package/dist/storage/storageManager.js.map +1 -1
  95. package/dist/storage/syncController.d.ts +1 -16
  96. package/dist/storage/syncController.d.ts.map +1 -1
  97. package/dist/storage/syncController.js +38 -58
  98. package/dist/storage/syncController.js.map +1 -1
  99. package/dist/storage/syncStatusStore.d.ts +8 -6
  100. package/dist/storage/syncStatusStore.d.ts.map +1 -1
  101. package/dist/storage/syncStatusStore.js +6 -6
  102. package/dist/storage/syncStatusStore.js.map +1 -1
  103. package/dist/storage/wasRemoteStore.d.ts +34 -2
  104. package/dist/storage/wasRemoteStore.d.ts.map +1 -1
  105. package/dist/storage/wasRemoteStore.js +45 -7
  106. package/dist/storage/wasRemoteStore.js.map +1 -1
  107. package/dist/storage/wasSync.d.ts.map +1 -1
  108. package/dist/storage/wasSync.js +47 -38
  109. package/dist/storage/wasSync.js.map +1 -1
  110. package/dist/sync/changesQuery.d.ts.map +1 -1
  111. package/dist/sync/changesQuery.js +2 -12
  112. package/dist/sync/changesQuery.js.map +1 -1
  113. package/dist/sync/docCipher.d.ts +17 -9
  114. package/dist/sync/docCipher.d.ts.map +1 -1
  115. package/dist/sync/docCipher.js +17 -11
  116. package/dist/sync/docCipher.js.map +1 -1
  117. package/dist/sync/feedMasterPort.d.ts +6 -0
  118. package/dist/sync/feedMasterPort.d.ts.map +1 -1
  119. package/dist/sync/feedMasterPort.js +82 -40
  120. package/dist/sync/feedMasterPort.js.map +1 -1
  121. package/dist/sync/index.d.ts +6 -5
  122. package/dist/sync/index.d.ts.map +1 -1
  123. package/dist/sync/index.js +6 -3
  124. package/dist/sync/index.js.map +1 -1
  125. package/dist/sync/lww.d.ts +15 -14
  126. package/dist/sync/lww.d.ts.map +1 -1
  127. package/dist/sync/lww.js +3 -3
  128. package/dist/sync/lww.js.map +1 -1
  129. package/dist/sync/lwwConflictHandler.d.ts +3 -10
  130. package/dist/sync/lwwConflictHandler.d.ts.map +1 -1
  131. package/dist/sync/lwwConflictHandler.js +7 -17
  132. package/dist/sync/lwwConflictHandler.js.map +1 -1
  133. package/dist/sync/pushWrites.d.ts +6 -8
  134. package/dist/sync/pushWrites.d.ts.map +1 -1
  135. package/dist/sync/pushWrites.js +56 -83
  136. package/dist/sync/pushWrites.js.map +1 -1
  137. package/dist/sync/types.d.ts +80 -4
  138. package/dist/sync/types.d.ts.map +1 -1
  139. package/dist/sync/types.js +36 -18
  140. package/dist/sync/types.js.map +1 -1
  141. package/dist/sync/wasSyncPort.d.ts +0 -11
  142. package/dist/sync/wasSyncPort.d.ts.map +1 -1
  143. package/dist/sync/wasSyncPort.js +8 -33
  144. package/dist/sync/wasSyncPort.js.map +1 -1
  145. package/package.json +5 -5
  146. package/dist/identity/initAppSession.d.ts +0 -27
  147. package/dist/identity/initAppSession.d.ts.map +0 -1
  148. package/dist/identity/initAppSession.js +0 -30
  149. package/dist/identity/initAppSession.js.map +0 -1
@@ -1,3 +1,4 @@
1
+ import { copyOptionalBodyFields } from './types.js';
1
2
  // A generous page cap so a pathological feed cannot spin forever; conflicts are
2
3
  // rare and the dev/e2e feed is small, so a full scan is acceptable.
3
4
  const MAX_PAGES = 50;
@@ -11,25 +12,71 @@ function toMasterState(doc) {
11
12
  updatedAt: doc.updatedAt,
12
13
  deleted: doc._deleted
13
14
  };
14
- if (doc.data !== undefined) {
15
- master.data = doc.data;
16
- }
17
- if (doc.metaVersion !== undefined) {
18
- master.metaVersion = doc.metaVersion;
19
- }
20
- if (doc.custom !== undefined) {
21
- master.custom = doc.custom;
22
- }
23
- if (doc.epoch !== undefined) {
24
- master.epoch = doc.epoch;
25
- }
15
+ copyOptionalBodyFields({ source: doc, target: master });
26
16
  return master;
27
17
  }
18
+ /**
19
+ * Walks the changes feed from its origin looking for one resource, memoizing
20
+ * every document it pages past when the caller supplied a batch `cache`.
21
+ *
22
+ * @param options {object}
23
+ * @param options.base {WasSyncBasePort}
24
+ * @param options.id {string}
25
+ * @param [options.cache] {MasterReadCache}
26
+ * @returns {Promise<MasterState | null>}
27
+ */
28
+ async function walkFeedFor({ base, id, cache }) {
29
+ let checkpoint;
30
+ for (let page = 0; page < MAX_PAGES; page++) {
31
+ const { documents, checkpoint: next } = await base.query({
32
+ ...(checkpoint !== undefined && { checkpoint }),
33
+ limit: PAGE_SIZE
34
+ });
35
+ const byId = new Map(documents.map(doc => [doc.id, doc]));
36
+ if (cache !== undefined) {
37
+ for (const [docId, doc] of byId) {
38
+ cache.byId.set(docId, toMasterState(doc));
39
+ }
40
+ }
41
+ const found = byId.get(id);
42
+ if (found) {
43
+ return toMasterState(found);
44
+ }
45
+ // Reached the end of the feed without finding it: the resource is
46
+ // genuinely absent (a delete/delete race), so report `null` and let the
47
+ // conflict assembler synthesize a tombstone. Only THIS id is memoized as
48
+ // absent, never "every id this completed walk did not see": a row of the
49
+ // same batch may have created its resource after this walk read the feed,
50
+ // and answering `null` for it would fabricate a tombstone and drop a live
51
+ // payload -- exactly what the scan-budget throw below guards against.
52
+ if (next === null || documents.length === 0) {
53
+ cache?.byId.set(id, null);
54
+ return null;
55
+ }
56
+ checkpoint = next;
57
+ }
58
+ // The page budget ran out before the feed's end. The feed is keyset-ordered
59
+ // ascending on `updatedAt`, so a just-conflicted resource sits at the tail --
60
+ // the least-reachable position -- and may well be past the cap. Reporting
61
+ // `null` here would fabricate a false tombstone in the conflict assembler and
62
+ // drop the winner's payload. Throw instead: RxDB treats a thrown push-handler
63
+ // error as retryable, so the whole replication cycle retries rather than
64
+ // diverging.
65
+ throw new Error(`Feed master re-read for resource "${id}" exhausted its ` +
66
+ `${MAX_PAGES}-page scan budget without reaching the end of the ` +
67
+ `changes feed; retrying.`);
68
+ }
28
69
  /**
29
70
  * Wraps a base port with a `get` that resolves the master state from the changes
30
71
  * feed. `query`, `putContent`, `deleteContent`, and `putMeta` pass straight
31
72
  * through.
32
73
  *
74
+ * A walk starts at the feed's origin, so resolving one resource pages past many
75
+ * others. With a per-push-batch `cache` the walk memoizes every one of them, and
76
+ * a row that finds a walk already running waits for it rather than starting a
77
+ * second -- so a batch of k conflicting rows costs one feed scan instead of k
78
+ * concurrent ones. Without a `cache` the behavior is exactly as before.
79
+ *
33
80
  * @param base {WasSyncBasePort}
34
81
  * @returns {WasSyncPort}
35
82
  */
@@ -39,35 +86,30 @@ export function withFeedMasterRead(base) {
39
86
  putContent: base.putContent.bind(base),
40
87
  deleteContent: base.deleteContent.bind(base),
41
88
  putMeta: base.putMeta.bind(base),
42
- async get({ id }) {
43
- let checkpoint;
44
- for (let page = 0; page < MAX_PAGES; page++) {
45
- const { documents, checkpoint: next } = await base.query({
46
- ...(checkpoint !== undefined && { checkpoint }),
47
- limit: PAGE_SIZE
48
- });
49
- const found = documents.find(doc => doc.id === id);
50
- if (found) {
51
- return toMasterState(found);
52
- }
53
- // Reached the end of the feed without finding it: the resource is
54
- // genuinely absent (a delete/delete race), so report `null` and let the
55
- // conflict assembler synthesize a tombstone.
56
- if (next === null || documents.length === 0) {
57
- return null;
58
- }
59
- checkpoint = next;
89
+ async get({ id, cache }) {
90
+ if (cache === undefined) {
91
+ return walkFeedFor({ base, id });
92
+ }
93
+ // Wait out whatever walk this batch already has running -- it pages past
94
+ // every resource, so it may well answer this read -- then re-check the
95
+ // memo. Looped because the walk we waited for can be followed by another.
96
+ while (cache.inFlight !== null) {
97
+ await cache.inFlight;
98
+ }
99
+ const memoized = cache.byId.get(id);
100
+ if (memoized !== undefined) {
101
+ return memoized;
60
102
  }
61
- // The page budget ran out before the feed's end. The feed is keyset-
62
- // ordered ascending on `updatedAt`, so a just-conflicted resource sits at
63
- // the tail -- the least-reachable position -- and may well be past the
64
- // cap. Reporting `null` here would fabricate a false tombstone in the
65
- // conflict assembler and drop the winner's payload. Throw instead: RxDB
66
- // treats a thrown push-handler error as retryable, so the whole
67
- // replication cycle retries rather than diverging.
68
- throw new Error(`Feed master re-read for resource "${id}" exhausted its ` +
69
- `${MAX_PAGES}-page scan budget without reaching the end of the ` +
70
- `changes feed; retrying.`);
103
+ // Publish this walk for the batch's other rows. Nothing above awaits
104
+ // between the memo miss and here, so two rows can never both get past it.
105
+ // The published promise SETTLES either way: a walk that threw is this
106
+ // row's error to propagate, not a waiting row's.
107
+ const walk = walkFeedFor({ base, id, cache });
108
+ const clear = () => {
109
+ cache.inFlight = null;
110
+ };
111
+ cache.inFlight = walk.then(clear, clear);
112
+ return walk;
71
113
  }
72
114
  };
73
115
  }
@@ -1 +1 @@
1
- {"version":3,"file":"feedMasterPort.js","sourceRoot":"","sources":["../../src/sync/feedMasterPort.ts"],"names":[],"mappings":"AA8BA,gFAAgF;AAChF,oEAAoE;AACpE,MAAM,SAAS,GAAG,EAAE,CAAA;AACpB,MAAM,SAAS,GAAG,GAAG,CAAA;AAErB;;GAEG;AACH,SAAS,aAAa,CAAC,GAAY;IACjC,MAAM,MAAM,GAAgB;QAC1B,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,OAAO,EAAE,GAAG,CAAC,QAAQ;KACtB,CAAA;IACD,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC,IAAY,CAAA;IAChC,CAAC;IACD,IAAI,GAAG,CAAC,WAAW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AO,IAAI,CAAA;QACb,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -11,11 +11,12 @@
11
11
  export { createWasReplication } from './wasReplication.js';
12
12
  export { syncedDocSchema } from './syncedDocSchema.js';
13
13
  export { createPullHandler, wireDocToRxDoc } from './changesQuery.js';
14
- export { createPushHandler, formatEtag, type PushWriteAck } from './pushWrites.js';
15
- export { WasSyncConflictError, WasSyncAuthError, type Json, type SyncCheckpoint, type WireDoc, type SyncedDoc, type MasterState, type WasSyncBasePort, type WasSyncPort } from './types.js';
16
- export { createWasSyncPort, errorStatus, errorMessage } from './wasSyncPort.js';
14
+ export { createPushHandler, type PushWriteAck } from './pushWrites.js';
15
+ export { WasSyncConflictError, WasSyncAuthError, type Json, type SyncCheckpoint, type WireDoc, type SyncedDoc, type MasterState, type MasterReadCache, type WasSyncBasePort, type WasSyncPort } from './types.js';
16
+ export { createWasSyncPort, errorMessage } from './wasSyncPort.js';
17
17
  export { withFeedMasterRead } from './feedMasterPort.js';
18
- export { createDocCipher, createPlaintextDocCodec, isEncryptedEnvelope, type DocCipher } from './docCipher.js';
18
+ export { createDocCipher, createPlaintextDocCodec, isUnknownEpochError, type DocCipher } from './docCipher.js';
19
19
  export { makeLwwConflictHandler } from './lwwConflictHandler.js';
20
- export { lwwFields, remotePayloadWins } from './lww.js';
20
+ export { lwwFields, remotePayloadWins, type LwwFields } from './lww.js';
21
+ export { errorStatus, formatEtag, isEncryptedEnvelope } from '@interop/was-client/sync';
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;GAMG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACrE,OA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BAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAGvE,OAAO,EACL,WAAW,EACX,UAAU,EACV,mBAAmB,EACpB,MAAM,0BAA0B,CAAA"}
@@ -11,11 +11,14 @@
11
11
  export { createWasReplication } from './wasReplication.js';
12
12
  export { syncedDocSchema } from './syncedDocSchema.js';
13
13
  export { createPullHandler, wireDocToRxDoc } from './changesQuery.js';
14
- export { createPushHandler, formatEtag } from './pushWrites.js';
14
+ export { createPushHandler } from './pushWrites.js';
15
15
  export { WasSyncConflictError, WasSyncAuthError } from './types.js';
16
- export { createWasSyncPort, errorStatus, errorMessage } from './wasSyncPort.js';
16
+ export { createWasSyncPort, errorMessage } from './wasSyncPort.js';
17
17
  export { withFeedMasterRead } from './feedMasterPort.js';
18
- export { createDocCipher, createPlaintextDocCodec, isEncryptedEnvelope } from './docCipher.js';
18
+ export { createDocCipher, createPlaintextDocCodec, isUnknownEpochError } from './docCipher.js';
19
19
  export { makeLwwConflictHandler } from './lwwConflictHandler.js';
20
20
  export { lwwFields, remotePayloadWins } from './lww.js';
21
+ // Owned by the client's sync subpath and re-exported verbatim, so the names this
22
+ // package's consumers already import stay put.
23
+ export { errorStatus, formatEtag, isEncryptedEnvelope } from '@interop/was-client/sync';
21
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;GAMG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA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AACjF,+CAA+C;AAC/C,OAAO,EACL,WAAW,EACX,UAAU,EACV,mBAAmB,EACpB,MAAM,0BAA0B,CAAA"}
@@ -12,6 +12,16 @@
12
12
  * `clientId` breaks an exact-instant tie deterministically. Both fields live in
13
13
  * the payload (never the envelope-level checkpoint `updatedAt`).
14
14
  */
15
+ /**
16
+ * The two fields the last-write-wins rule reads off a payload: the app-owned
17
+ * ISO-8601 edit stamp and the writing client's id (the exact-instant
18
+ * tiebreaker). Read off a doc with {@link lwwFields}; compared with
19
+ * {@link remotePayloadWins}.
20
+ */
21
+ export interface LwwFields {
22
+ updatedAt: string;
23
+ clientId: string;
24
+ }
15
25
  /**
16
26
  * Whether the remote payload wins over the local one under last-write-wins.
17
27
  * The chronologically later `updatedAt` wins; on an exact-instant tie the
@@ -23,27 +33,18 @@
23
33
  * every device converges on the same winner). When neither side parses, the
24
34
  * lexical compare of the raw strings is the deterministic fallback.
25
35
  *
26
- * @param remote {{ updatedAt: string; clientId: string }}
27
- * @param local {{ updatedAt: string; clientId: string }}
36
+ * @param remote {LwwFields}
37
+ * @param local {LwwFields}
28
38
  * @returns {boolean} true if the remote payload should replace the local one
29
39
  */
30
- export declare function remotePayloadWins(remote: {
31
- updatedAt: string;
32
- clientId: string;
33
- }, local: {
34
- updatedAt: string;
35
- clientId: string;
36
- }): boolean;
40
+ export declare function remotePayloadWins(remote: LwwFields, local: LwwFields): boolean;
37
41
  /**
38
42
  * Reads the LWW fields off a doc when it carries them. Storage payloads are
39
43
  * generic over `{ id: string }`, so docs without `updatedAt`/`clientId` are
40
44
  * legal; callers fall back to their own rule for those.
41
45
  *
42
46
  * @param doc {unknown}
43
- * @returns {{ updatedAt: string, clientId: string } | null}
47
+ * @returns {LwwFields | null}
44
48
  */
45
- export declare function lwwFields(doc: unknown): {
46
- updatedAt: string;
47
- clientId: string;
48
- } | null;
49
+ export declare function lwwFields(doc: unknown): LwwFields | null;
49
50
  //# sourceMappingURL=lww.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lww.d.ts","sourceRoot":"","sources":["../../src/sync/lww.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AAUH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EAC/C,KAAK,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC7C,OAAO,CAeT;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,GAAG,EAAE,OAAO,GACX;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQhD"}
1
+ {"version":3,"file":"lww.d.ts","sourceRoot":"","sources":["../../src/sync/lww.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAUD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,SAAS,GACf,OAAO,CAeT;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAQxD"}
package/dist/sync/lww.js CHANGED
@@ -30,8 +30,8 @@ function parseInstant(updatedAt) {
30
30
  * every device converges on the same winner). When neither side parses, the
31
31
  * lexical compare of the raw strings is the deterministic fallback.
32
32
  *
33
- * @param remote {{ updatedAt: string; clientId: string }}
34
- * @param local {{ updatedAt: string; clientId: string }}
33
+ * @param remote {LwwFields}
34
+ * @param local {LwwFields}
35
35
  * @returns {boolean} true if the remote payload should replace the local one
36
36
  */
37
37
  export function remotePayloadWins(remote, local) {
@@ -58,7 +58,7 @@ export function remotePayloadWins(remote, local) {
58
58
  * legal; callers fall back to their own rule for those.
59
59
  *
60
60
  * @param doc {unknown}
61
- * @returns {{ updatedAt: string, clientId: string } | null}
61
+ * @returns {LwwFields | null}
62
62
  */
63
63
  export function lwwFields(doc) {
64
64
  const { updatedAt, clientId } = doc;
@@ -1 +1 @@
1
- {"version":3,"file":"lww.js","sourceRoot":"","sources":["../../src/sync/lww.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,SAAS,YAAY,CAAC,SAAiB;IACrC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IAChC,OAAO,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAA;AACrC,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAA+C,EAC/C,KAA8C;IAE9C,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IAC/C,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IAC7C,IAAI,QAAQ,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QAC1C,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;YACzB,OAAO,QAAQ,GAAG,OAAO,CAAA;QAC3B,CAAC;IACH,CAAC;SAAM,IAAI,QAAQ,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACjD,qDAAqD;QACrD,OAAO,QAAQ,KAAK,IAAI,CAAA;IAC1B,CAAC;SAAM,IAAI,MAAM,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,EAAE,CAAC;QAChD,kEAAkE;QAClE,OAAO,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAA;IAC3C,CAAC;IACD,OA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AK,CAAC,SAAS,EAAE,CAAC;QAChD,kEAAkE;QAClE,OAAO,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAA;IAC3C,CAAC;IACD,OAAO,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAA;AACzC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,GAAY;IACpC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,GAG/B,CAAA;IACD,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAClE,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE;QACzB,CAAC,CAAC,IAAI,CAAA;AACV,CAAC"}
@@ -60,25 +60,19 @@
60
60
  */
61
61
  import type { WithDeleted } from 'rxdb/plugins/core';
62
62
  import type { Json, SyncedDoc } from './types.js';
63
- /**
64
- * The LWW fields read out of a decrypted entity payload.
65
- */
66
- interface LwwPayload {
67
- updatedAt: string;
68
- clientId: string;
69
- }
63
+ import { type LwwFields } from './lww.js';
70
64
  /**
71
65
  * Builds an RxDB conflict handler that settles content conflicts by payload LWW,
72
66
  * decrypting through the supplied per-collection `decrypt`.
73
67
  *
74
68
  * @param decrypt {(envelope: Json) => Promise<Json>} this collection's decrypt
75
- * @param [payloadWins] {(remote: LwwPayload, local: LwwPayload) => boolean}
69
+ * @param [payloadWins] {(remote: LwwFields, local: LwwFields) => boolean}
76
70
  * the total-order comparator deciding whether the remote payload replaces the
77
71
  * local one; defaults to {@link remotePayloadWins} (later `updatedAt` wins,
78
72
  * `clientId` breaks a tie)
79
73
  * @returns {import('rxdb/plugins/core').RxConflictHandler<SyncedDoc>}
80
74
  */
81
- export declare function makeLwwConflictHandler(decrypt: (envelope: Json) => Promise<Json>, payloadWins?: (remote: LwwPayload, local: LwwPayload) => boolean): {
75
+ export declare function makeLwwConflictHandler(decrypt: (envelope: Json) => Promise<Json>, payloadWins?: (remote: LwwFields, local: LwwFields) => boolean): {
82
76
  isEqual(a: WithDeleted<SyncedDoc>, b: WithDeleted<SyncedDoc>): boolean;
83
77
  resolve({ realMasterState, newDocumentState, assumedMasterState }: {
84
78
  realMasterState: WithDeleted<SyncedDoc>;
@@ -86,5 +80,4 @@ export declare function makeLwwConflictHandler(decrypt: (envelope: Json) => Prom
86
80
  assumedMasterState?: WithDeleted<SyncedDoc>;
87
81
  }): Promise<WithDeleted<SyncedDoc>>;
88
82
  };
89
- export {};
90
83
  //# sourceMappingURL=lwwConflictHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lwwConflictHandler.d.ts","sourceRoot":"","sources":["../../src/sync/lwwConflictHandler.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAGjD;;GAEG;AACH,UAAU,UAAU;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAkDD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,CAAC,QAAQ,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,EAC1C,WAAW,GAAE,CACX,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,UAAU,KACd,OAA2B;eAQnB,WAAW,CAAC,SAAS,CAAC,KAAK,WAAW,CAAC,SAAS,CAAC,GAAG,OAAO;uEAcnE;QACD,eAAe,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;QACvC,gBAAgB,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;QACxC,kBAAkB,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;KAC5C,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;EAiFtC"}
1
+ {"version":3,"file":"lwwConflictHandler.d.ts","sourceRoot":"","sources":["../../src/sync/lwwConflictHandler.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEjD,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAoCvE;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,CAAC,QAAQ,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,EAC1C,WAAW,GAAE,CACX,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,SAAS,KACb,OAA2B;eAQnB,WAAW,CAAC,SAAS,CAAC,KAAK,WAAW,CAAC,SAAS,CAAC,GAAG,OAAO;uEAcnE;QACD,eAAe,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;QACvC,gBAAgB,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;QACxC,kBAAkB,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;KAC5C,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;EAiFtC"}
@@ -1,27 +1,17 @@
1
- import { remotePayloadWins } from './lww.js';
2
- /**
3
- * Structural equality of two opaque bodies (used for the fast `isEqual`).
4
- */
5
- function bodiesEqual(a, b) {
6
- return JSON.stringify(a ?? null) === JSON.stringify(b ?? null);
7
- }
1
+ import { bodiesEqual } from './types.js';
2
+ import { lwwFields, remotePayloadWins } from './lww.js';
8
3
  /**
9
4
  * Decrypts one side's envelope into its LWW comparability (see {@link LwwSide}).
5
+ * A payload carrying no LWW stamp reads as `none`, the same as a tombstone or an
6
+ * absent body: nothing there to compare.
10
7
  */
11
8
  async function lwwFieldsOf(doc, decrypt) {
12
9
  if (doc._deleted || doc.data === undefined) {
13
10
  return { kind: 'none' };
14
11
  }
15
12
  try {
16
- const payload = (await decrypt(doc.data));
17
- if (typeof payload.updatedAt === 'string' &&
18
- typeof payload.clientId === 'string') {
19
- return {
20
- kind: 'payload',
21
- payload: { updatedAt: payload.updatedAt, clientId: payload.clientId }
22
- };
23
- }
24
- return { kind: 'none' };
13
+ const payload = lwwFields(await decrypt(doc.data));
14
+ return payload === null ? { kind: 'none' } : { kind: 'payload', payload };
25
15
  }
26
16
  catch (err) {
27
17
  return { kind: 'undecryptable', err };
@@ -32,7 +22,7 @@ async function lwwFieldsOf(doc, decrypt) {
32
22
  * decrypting through the supplied per-collection `decrypt`.
33
23
  *
34
24
  * @param decrypt {(envelope: Json) => Promise<Json>} this collection's decrypt
35
- * @param [payloadWins] {(remote: LwwPayload, local: LwwPayload) => boolean}
25
+ * @param [payloadWins] {(remote: LwwFields, local: LwwFields) => boolean}
36
26
  * the total-order comparator deciding whether the remote payload replaces the
37
27
  * local one; defaults to {@link remotePayloadWins} (later `updatedAt` wins,
38
28
  * `clientId` breaks a tie)
@@ -1 +1 @@
1
- {"version":3,"file":"lwwConflictHandler.js","sourceRoot":"","sources":["../../src/sync/lwwConflictHandler.ts"],"names":[],"mappings":"AA8DA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAU5C;;GAEG;AACH,SAAS,WAAW,CAAC,CAAmB,EAAE,CAAmB;IAC3D,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,CAAA;AAChE,CAAC;AAgBD;;GAEG;AACH,KAAK,UAAU,WAAW,CACxB,GAA2B,EAC3B,OAA0C;IAE1C,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC3C,OAAO,EAAE,I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AI,KAAK,eAAe,IAAI,MAAM,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;oBACtE,OAAO,CAAC,IAAI,CACV,+DAA+D;wBAC7D,qDAAqD,EACvD,KAAK,CAAC,GAAG,CACV,CAAA;oBACD,OAAO,gBAAgB,CAAA;gBACzB,CAAC;gBACD,OAAO,CAAC,IAAI,CACV,4DAA4D;oBAC1D,iCAAiC,EACnC,MAAM,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CACzD,CAAA;gBACD,OAAO,eAAe,CAAA;YACxB,CAAC;YACD,qDAAqD;YACrD,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBAC1D,OAAO,WAAW,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;oBAC/C,CAAC,CAAC,eAAe;oBACjB,CAAC,CAAC,gBAAgB,CAAA;YACtB,CAAC;YACD,uEAAuE;YACvE,yEAAyE;YACzE,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBACvD,OAAO,gBAAgB,CAAA;YACzB,CAAC;YACD,oEAAoE;YACpE,mEAAmE;YACnE,sEAAsE;YACtE,2BAA2B;YAC3B,OAAO,eAAe,CAAA;QACxB,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -45,14 +45,6 @@ export interface PushWriteAck {
45
45
  version?: number;
46
46
  metaVersion?: number;
47
47
  }
48
- /**
49
- * Formats a master revision (`version` or `metaVersion`) as the quoted strong
50
- * ETag the server compares `If-Match` against (revision `3` becomes `"3"`).
51
- *
52
- * @param revision {number}
53
- * @returns {string}
54
- */
55
- export declare function formatEtag(revision: number): string;
56
48
  /**
57
49
  * Builds the RxDB push handler that fans a batch of local changes out to
58
50
  * conditional WAS writes and returns the conflicting rows' master states.
@@ -65,6 +57,12 @@ export declare function formatEtag(revision: number): string;
65
57
  * caller can write the new `version` / `metaVersion` back into the local row
66
58
  * and keep subsequent conditional writes' `If-Match` in step with the server.
67
59
  *
60
+ * Each batch gets one short-lived master-read memo, shared by its rows and
61
+ * discarded with the batch (never held across batches, where it would go
62
+ * stale). A conflict re-read walks the changes feed from its origin and so pages
63
+ * past every other conflicting row's master on the way; without the memo a batch
64
+ * with k conflicts would run k concurrent full-feed walks.
65
+ *
68
66
  * @param port {WasSyncPort}
69
67
  * @param [onWriteAccepted] {(ack: PushWriteAck) => Promise<void>}
70
68
  * @returns {(rows: Array<{ newDocumentState: WithDeleted<SyncedDoc>,
@@ -1 +1 @@
1
- {"version":3,"file":"pushWrites.d.ts","sourceRoot":"","sources":["../../src/sync/pushWrites.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAqB,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAG3E;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnD;AA+OD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,EACjB,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,IAGpD,MAAM,KAAK,CAAC;IACV,gBAAgB,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IACxC,kBAAkB,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;CAC5C,CAAC,KACD,OAAO,CA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