ahmed-rivet-convex 2.2.8 → 2.2.9
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.
|
@@ -4679,6 +4679,32 @@ async function persistDD31(lc, clientID, memdag, perdag, mutators, closed, forma
|
|
|
4679
4679
|
);
|
|
4680
4680
|
}
|
|
4681
4681
|
}
|
|
4682
|
+
if (!memdagBaseSnapshotPersisted) {
|
|
4683
|
+
const latestBase = await baseSnapshotFromCommit(
|
|
4684
|
+
latestPerdagMainClientGroupHeadCommit,
|
|
4685
|
+
perdagWrite
|
|
4686
|
+
);
|
|
4687
|
+
assertSnapshotCommitDD31(latestBase);
|
|
4688
|
+
if (compareCookiesForSnapshots(memdagBaseSnapshot, latestBase) <= 0 && (memdagBaseSnapshot.meta.lastMutationIDs[clientID] ?? 0) > await latestPerdagMainClientGroupHeadCommit.getMutationID(
|
|
4689
|
+
clientID,
|
|
4690
|
+
perdagWrite
|
|
4691
|
+
)) {
|
|
4692
|
+
lc.debug?.(
|
|
4693
|
+
"persist deferred: perdag head trails this client's confirmed LMID",
|
|
4694
|
+
{
|
|
4695
|
+
clientID,
|
|
4696
|
+
memdagLMID: memdagBaseSnapshot.meta.lastMutationIDs[clientID],
|
|
4697
|
+
perdagHeadLMID: await latestPerdagMainClientGroupHeadCommit.getMutationID(
|
|
4698
|
+
clientID,
|
|
4699
|
+
perdagWrite
|
|
4700
|
+
),
|
|
4701
|
+
memdagCookie: memdagBaseSnapshot.meta.cookieJSON,
|
|
4702
|
+
perdagCookie: latestBase.meta.cookieJSON
|
|
4703
|
+
}
|
|
4704
|
+
);
|
|
4705
|
+
return;
|
|
4706
|
+
}
|
|
4707
|
+
}
|
|
4682
4708
|
let zeroDataForPerdagHeadCommit;
|
|
4683
4709
|
if (!memdagBaseSnapshotPersisted && getZeroData) {
|
|
4684
4710
|
if (newMainClientGroupHeadHash !== perdagHeadHashAtRead) {
|
|
@@ -4823,7 +4849,9 @@ async function refresh(lc, memdag, perdag, clientID, mutators, diffConfig, close
|
|
|
4823
4849
|
if (shouldAbortRefresh(
|
|
4824
4850
|
memdagBaseSnapshot,
|
|
4825
4851
|
perdagClientGroupBaseSnapshot2,
|
|
4826
|
-
perdagClientGroupHeadHash2
|
|
4852
|
+
perdagClientGroupHeadHash2,
|
|
4853
|
+
perdagLmid2,
|
|
4854
|
+
clientID
|
|
4827
4855
|
)) {
|
|
4828
4856
|
return void 0;
|
|
4829
4857
|
}
|
|
@@ -4881,7 +4909,9 @@ async function refresh(lc, memdag, perdag, clientID, mutators, diffConfig, close
|
|
|
4881
4909
|
if (shouldAbortRefresh(
|
|
4882
4910
|
memdagBaseSnapshot2,
|
|
4883
4911
|
perdagClientGroupBaseSnapshot,
|
|
4884
|
-
perdagClientGroupHeadHash
|
|
4912
|
+
perdagClientGroupHeadHash,
|
|
4913
|
+
perdagLmid,
|
|
4914
|
+
clientID
|
|
4885
4915
|
)) {
|
|
4886
4916
|
return {
|
|
4887
4917
|
type: "aborted",
|
|
@@ -4962,12 +4992,12 @@ async function refresh(lc, memdag, perdag, clientID, mutators, diffConfig, close
|
|
|
4962
4992
|
diffs: result.diffs
|
|
4963
4993
|
};
|
|
4964
4994
|
}
|
|
4965
|
-
function shouldAbortRefresh(memdagBaseSnapshot, perdagClientGroupBaseSnapshot, perdagClientGroupHeadHash) {
|
|
4995
|
+
function shouldAbortRefresh(memdagBaseSnapshot, perdagClientGroupBaseSnapshot, perdagClientGroupHeadHash, perdagLmid, clientID) {
|
|
4966
4996
|
const baseSnapshotCookieCompareResult = compareCookiesForSnapshots(
|
|
4967
4997
|
memdagBaseSnapshot,
|
|
4968
4998
|
perdagClientGroupBaseSnapshot
|
|
4969
4999
|
);
|
|
4970
|
-
return baseSnapshotCookieCompareResult > 0 || baseSnapshotCookieCompareResult === 0 && perdagClientGroupHeadHash === perdagClientGroupBaseSnapshot.chunk.hash;
|
|
5000
|
+
return baseSnapshotCookieCompareResult > 0 || (memdagBaseSnapshot.meta.lastMutationIDs[clientID] ?? 0) > perdagLmid || baseSnapshotCookieCompareResult === 0 && perdagClientGroupHeadHash === perdagClientGroupBaseSnapshot.chunk.hash;
|
|
4971
5001
|
}
|
|
4972
5002
|
|
|
4973
5003
|
// ../replicache/src/process-scheduler.ts
|
|
@@ -6058,6 +6088,7 @@ var ReplicacheImpl = class {
|
|
|
6058
6088
|
resolve();
|
|
6059
6089
|
}
|
|
6060
6090
|
async maybeEndPull(syncHead, requestID) {
|
|
6091
|
+
let chunkRetries = 0;
|
|
6061
6092
|
for (; ; ) {
|
|
6062
6093
|
if (this.#closed) {
|
|
6063
6094
|
return;
|
|
@@ -6079,7 +6110,17 @@ var ReplicacheImpl = class {
|
|
|
6079
6110
|
void this.#schedulePersist();
|
|
6080
6111
|
return;
|
|
6081
6112
|
}
|
|
6082
|
-
|
|
6113
|
+
let zeroData2;
|
|
6114
|
+
try {
|
|
6115
|
+
zeroData2 = await this.#zero?.getTxData?.(syncHead);
|
|
6116
|
+
} catch (e) {
|
|
6117
|
+
if (e instanceof ChunkNotFoundError && ++chunkRetries <= 3) {
|
|
6118
|
+
lc.debug?.("IVM base moved during replay; retrying", e.message);
|
|
6119
|
+
await Promise.resolve();
|
|
6120
|
+
continue;
|
|
6121
|
+
}
|
|
6122
|
+
throw e;
|
|
6123
|
+
}
|
|
6083
6124
|
for (const mutation of replayMutations) {
|
|
6084
6125
|
if (this.#subscriptions.hasPendingSubscriptionRuns) {
|
|
6085
6126
|
await Promise.resolve();
|
|
@@ -15611,7 +15652,7 @@ function makeMessage(message, context, logLevel) {
|
|
|
15611
15652
|
}
|
|
15612
15653
|
|
|
15613
15654
|
// ../zero-client/src/client/version.ts
|
|
15614
|
-
var version2 = "2.2.
|
|
15655
|
+
var version2 = "2.2.9";
|
|
15615
15656
|
|
|
15616
15657
|
// ../zero-client/src/client/log-options.ts
|
|
15617
15658
|
var LevelFilterLogSink = class {
|
package/dist/react.js
CHANGED
package/dist/zero.js
CHANGED
package/package.json
CHANGED