@rocicorp/zero 0.18.2025032101 → 0.18.2025032400
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.
- package/out/{zql/src/query → ast-to-zql/src}/ast-to-zql.d.ts +1 -1
- package/out/ast-to-zql/src/ast-to-zql.d.ts.map +1 -0
- package/out/ast-to-zql/src/ast-to-zql.js +191 -0
- package/out/ast-to-zql/src/ast-to-zql.js.map +1 -0
- package/out/ast-to-zql/src/bin.d.ts +2 -0
- package/out/ast-to-zql/src/bin.d.ts.map +1 -0
- package/out/ast-to-zql/src/bin.js +92 -0
- package/out/ast-to-zql/src/bin.js.map +1 -0
- package/out/{chunk-KRZMF5WQ.js → chunk-DSUPSGE4.js} +10 -1
- package/out/{chunk-KRZMF5WQ.js.map → chunk-DSUPSGE4.js.map} +2 -2
- package/out/{chunk-AX7YNDMI.js → chunk-YAABAEJV.js} +163 -47
- package/out/{chunk-AX7YNDMI.js.map → chunk-YAABAEJV.js.map} +4 -4
- package/out/{inspector-SVHRQAQN.js → inspector-ROITQB3J.js} +164 -171
- package/out/inspector-ROITQB3J.js.map +7 -0
- package/out/shared/src/arrays.d.ts +2 -0
- package/out/shared/src/arrays.d.ts.map +1 -1
- package/out/shared/src/arrays.js +22 -0
- package/out/shared/src/arrays.js.map +1 -1
- package/out/solid.js +2 -2
- package/out/z2s/src/compiler.d.ts.map +1 -1
- package/out/z2s/src/compiler.js +1 -8
- package/out/z2s/src/compiler.js.map +1 -1
- package/out/zero/src/ast-to-zql.d.ts +3 -0
- package/out/zero/src/ast-to-zql.d.ts.map +1 -0
- package/out/zero/src/ast-to-zql.js +3 -0
- package/out/zero/src/ast-to-zql.js.map +1 -0
- package/out/zero-cache/src/auth/jwt.js +3 -2
- package/out/zero-cache/src/auth/jwt.js.map +1 -1
- package/out/zero-cache/src/config/zero-config.d.ts +5 -0
- package/out/zero-cache/src/config/zero-config.d.ts.map +1 -1
- package/out/zero-cache/src/config/zero-config.js +8 -0
- package/out/zero-cache/src/config/zero-config.js.map +1 -1
- package/out/zero-cache/src/server/multi/config.d.ts +5 -0
- package/out/zero-cache/src/server/multi/config.d.ts.map +1 -1
- package/out/zero-cache/src/server/syncer.d.ts.map +1 -1
- package/out/zero-cache/src/server/syncer.js +1 -1
- package/out/zero-cache/src/server/syncer.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.js +18 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.js.map +1 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-service.js +1 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-service.js.map +1 -1
- package/out/zero-cache/src/services/change-streamer/storer.d.ts +1 -1
- package/out/zero-cache/src/services/change-streamer/storer.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-streamer/storer.js +25 -12
- package/out/zero-cache/src/services/change-streamer/storer.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.d.ts +5 -4
- package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.js +97 -13
- package/out/zero-cache/src/services/mutagen/pusher.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-schema.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-schema.js +6 -1
- package/out/zero-cache/src/services/view-syncer/client-schema.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +5 -4
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.js +9 -7
- package/out/zero-cache/src/services/view-syncer/cvr-store.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr.js +16 -7
- package/out/zero-cache/src/services/view-syncer/cvr.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.js +16 -3
- package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
- package/out/zero-cache/src/types/streams.d.ts.map +1 -1
- package/out/zero-cache/src/types/streams.js +11 -15
- package/out/zero-cache/src/types/streams.js.map +1 -1
- package/out/zero-cache/src/workers/connection.d.ts +1 -0
- package/out/zero-cache/src/workers/connection.d.ts.map +1 -1
- package/out/zero-cache/src/workers/connection.js +16 -5
- package/out/zero-cache/src/workers/connection.js.map +1 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts.map +1 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.js +2 -2
- package/out/zero-cache/src/workers/syncer-ws-message-handler.js.map +1 -1
- package/out/zero-client/src/client/custom.d.ts +13 -3
- package/out/zero-client/src/client/custom.d.ts.map +1 -1
- package/out/zero-client/src/client/inspector/inspector.d.ts.map +1 -1
- package/out/zero-client/src/client/mutation-tracker.d.ts +21 -0
- package/out/zero-client/src/client/mutation-tracker.d.ts.map +1 -0
- package/out/zero-client/src/client/zero.d.ts.map +1 -1
- package/out/zero-protocol/src/down.d.ts +42 -1
- package/out/zero-protocol/src/down.d.ts.map +1 -1
- package/out/zero-protocol/src/down.js +2 -1
- package/out/zero-protocol/src/down.js.map +1 -1
- package/out/zero-protocol/src/protocol-version.d.ts +1 -1
- package/out/zero-protocol/src/protocol-version.js +1 -1
- package/out/zero-protocol/src/push.d.ts +88 -4
- package/out/zero-protocol/src/push.d.ts.map +1 -1
- package/out/zero-protocol/src/push.js +22 -3
- package/out/zero-protocol/src/push.js.map +1 -1
- package/out/zero.js +2 -2
- package/package.json +4 -3
- package/out/inspector-SVHRQAQN.js.map +0 -7
- package/out/zql/src/query/ast-to-zql.d.ts.map +0 -1
|
@@ -112,7 +112,7 @@ import {
|
|
|
112
112
|
withWrite,
|
|
113
113
|
withWriteNoImplicitCommit,
|
|
114
114
|
wrapIterable
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-DSUPSGE4.js";
|
|
116
116
|
import {
|
|
117
117
|
compareTTL,
|
|
118
118
|
hasOwn,
|
|
@@ -5980,7 +5980,7 @@ function escapeLike(val) {
|
|
|
5980
5980
|
|
|
5981
5981
|
// ../zero-client/src/client/zero.ts
|
|
5982
5982
|
import { LogContext as LogContext4 } from "@rocicorp/logger";
|
|
5983
|
-
import { resolver as
|
|
5983
|
+
import { resolver as resolver8 } from "@rocicorp/resolver";
|
|
5984
5984
|
|
|
5985
5985
|
// ../zero-protocol/src/delete-clients.ts
|
|
5986
5986
|
var deleteClientsBodySchema = valita_exports.union(
|
|
@@ -6212,34 +6212,10 @@ var pullResponseMessageSchema = valita_exports.tuple([
|
|
|
6212
6212
|
pullResponseBodySchema
|
|
6213
6213
|
]);
|
|
6214
6214
|
|
|
6215
|
-
// ../zero-protocol/src/warm.ts
|
|
6216
|
-
var warmBodySchema = valita_exports.object({
|
|
6217
|
-
payload: valita_exports.string()
|
|
6218
|
-
});
|
|
6219
|
-
var warmMessageSchema = valita_exports.tuple([valita_exports.literal("warm"), warmBodySchema]);
|
|
6220
|
-
|
|
6221
|
-
// ../zero-protocol/src/down.ts
|
|
6222
|
-
var downstreamSchema = valita_exports.union(
|
|
6223
|
-
connectedMessageSchema,
|
|
6224
|
-
warmMessageSchema,
|
|
6225
|
-
errorMessageSchema,
|
|
6226
|
-
pongMessageSchema,
|
|
6227
|
-
pokeStartMessageSchema,
|
|
6228
|
-
pokePartMessageSchema,
|
|
6229
|
-
pokeEndMessageSchema,
|
|
6230
|
-
pullResponseMessageSchema,
|
|
6231
|
-
deleteClientsMessageSchema
|
|
6232
|
-
);
|
|
6233
|
-
|
|
6234
6215
|
// ../zero-protocol/src/mutation-type-enum.ts
|
|
6235
6216
|
var CRUD = "crud";
|
|
6236
6217
|
var Custom = "custom";
|
|
6237
6218
|
|
|
6238
|
-
// ../zero-protocol/src/protocol-version.ts
|
|
6239
|
-
var PROTOCOL_VERSION = 8;
|
|
6240
|
-
var MIN_SERVER_SUPPORTED_SYNC_PROTOCOL = 6;
|
|
6241
|
-
assert(MIN_SERVER_SUPPORTED_SYNC_PROTOCOL < PROTOCOL_VERSION);
|
|
6242
|
-
|
|
6243
6219
|
// ../zero-protocol/src/push.ts
|
|
6244
6220
|
var CRUD_MUTATION_NAME = "_zero_crud";
|
|
6245
6221
|
var insertOpSchema = valita_exports.object({
|
|
@@ -6312,14 +6288,22 @@ var mutationIDSchema = valita_exports.object({
|
|
|
6312
6288
|
clientID: valita_exports.string()
|
|
6313
6289
|
});
|
|
6314
6290
|
var appErrorSchema = valita_exports.object({
|
|
6315
|
-
error: valita_exports.literal("app")
|
|
6316
|
-
|
|
6291
|
+
error: valita_exports.literal("app")
|
|
6292
|
+
// the user can add any additional fields in their API server
|
|
6317
6293
|
});
|
|
6318
6294
|
var zeroErrorSchema = valita_exports.object({
|
|
6319
6295
|
error: valita_exports.literal("ooo-mutation")
|
|
6320
6296
|
});
|
|
6297
|
+
var tokenErrorSchema = valita_exports.object({
|
|
6298
|
+
error: valita_exports.literal("token")
|
|
6299
|
+
// the user can add any additional fields in their API server
|
|
6300
|
+
});
|
|
6321
6301
|
var mutationOkSchema = valita_exports.object({});
|
|
6322
|
-
var mutationErrorSchema = valita_exports.union(
|
|
6302
|
+
var mutationErrorSchema = valita_exports.union(
|
|
6303
|
+
appErrorSchema,
|
|
6304
|
+
zeroErrorSchema,
|
|
6305
|
+
tokenErrorSchema
|
|
6306
|
+
);
|
|
6323
6307
|
var mutationResultSchema = valita_exports.union(mutationOkSchema, mutationErrorSchema);
|
|
6324
6308
|
var mutationResponseSchema = valita_exports.object({
|
|
6325
6309
|
id: mutationIDSchema,
|
|
@@ -6342,11 +6326,28 @@ var unsupportedSchemaVersionSchema = valita_exports.object({
|
|
|
6342
6326
|
// were not processed by the server.
|
|
6343
6327
|
mutationIDs: valita_exports.array(mutationIDSchema).optional()
|
|
6344
6328
|
});
|
|
6329
|
+
var httpErrorSchema = valita_exports.object({
|
|
6330
|
+
error: valita_exports.literal("http"),
|
|
6331
|
+
status: valita_exports.number(),
|
|
6332
|
+
details: valita_exports.string(),
|
|
6333
|
+
mutationIDs: valita_exports.array(mutationIDSchema).optional()
|
|
6334
|
+
});
|
|
6335
|
+
var zeroPusherErrorSchema = valita_exports.object({
|
|
6336
|
+
error: valita_exports.literal("zero-pusher"),
|
|
6337
|
+
details: valita_exports.string(),
|
|
6338
|
+
mutationIDs: valita_exports.array(mutationIDSchema).optional()
|
|
6339
|
+
});
|
|
6345
6340
|
var pushErrorSchema = valita_exports.union(
|
|
6346
6341
|
unsupportedPushVersionSchema,
|
|
6347
|
-
unsupportedSchemaVersionSchema
|
|
6342
|
+
unsupportedSchemaVersionSchema,
|
|
6343
|
+
httpErrorSchema,
|
|
6344
|
+
zeroPusherErrorSchema
|
|
6348
6345
|
);
|
|
6349
6346
|
var pushResponseSchema = valita_exports.union(pushOkSchema, pushErrorSchema);
|
|
6347
|
+
var pushResponseMessageSchema = valita_exports.tuple([
|
|
6348
|
+
valita_exports.literal("push-response"),
|
|
6349
|
+
pushResponseSchema
|
|
6350
|
+
]);
|
|
6350
6351
|
function mapCRUD(arg, map) {
|
|
6351
6352
|
return {
|
|
6352
6353
|
ops: arg.ops.map(
|
|
@@ -6362,6 +6363,31 @@ function mapCRUD(arg, map) {
|
|
|
6362
6363
|
};
|
|
6363
6364
|
}
|
|
6364
6365
|
|
|
6366
|
+
// ../zero-protocol/src/warm.ts
|
|
6367
|
+
var warmBodySchema = valita_exports.object({
|
|
6368
|
+
payload: valita_exports.string()
|
|
6369
|
+
});
|
|
6370
|
+
var warmMessageSchema = valita_exports.tuple([valita_exports.literal("warm"), warmBodySchema]);
|
|
6371
|
+
|
|
6372
|
+
// ../zero-protocol/src/down.ts
|
|
6373
|
+
var downstreamSchema = valita_exports.union(
|
|
6374
|
+
connectedMessageSchema,
|
|
6375
|
+
warmMessageSchema,
|
|
6376
|
+
errorMessageSchema,
|
|
6377
|
+
pongMessageSchema,
|
|
6378
|
+
pokeStartMessageSchema,
|
|
6379
|
+
pokePartMessageSchema,
|
|
6380
|
+
pokeEndMessageSchema,
|
|
6381
|
+
pullResponseMessageSchema,
|
|
6382
|
+
deleteClientsMessageSchema,
|
|
6383
|
+
pushResponseMessageSchema
|
|
6384
|
+
);
|
|
6385
|
+
|
|
6386
|
+
// ../zero-protocol/src/protocol-version.ts
|
|
6387
|
+
var PROTOCOL_VERSION = 9;
|
|
6388
|
+
var MIN_SERVER_SUPPORTED_SYNC_PROTOCOL = 6;
|
|
6389
|
+
assert(MIN_SERVER_SUPPORTED_SYNC_PROTOCOL < PROTOCOL_VERSION);
|
|
6390
|
+
|
|
6365
6391
|
// ../zql/src/mutate/custom.ts
|
|
6366
6392
|
function customMutatorKey(namespace, name) {
|
|
6367
6393
|
assert(!namespace.includes("|"), "mutator namespaces must not include a |");
|
|
@@ -7924,10 +7950,15 @@ var TransactionImpl = class {
|
|
|
7924
7950
|
query;
|
|
7925
7951
|
token;
|
|
7926
7952
|
};
|
|
7927
|
-
function makeReplicacheMutator(lc, mutator, schema, slowMaterializeThreshold) {
|
|
7953
|
+
function makeReplicacheMutator(lc, mutationTracker, mutator, schema, slowMaterializeThreshold) {
|
|
7928
7954
|
return (repTx, args) => {
|
|
7929
7955
|
const tx = new TransactionImpl(lc, repTx, schema, slowMaterializeThreshold);
|
|
7930
|
-
|
|
7956
|
+
const clientPromise = mutator(tx, args);
|
|
7957
|
+
if (repTx.reason === "initial") {
|
|
7958
|
+
const serverPromise = mutationTracker.trackMutation(repTx.mutationID);
|
|
7959
|
+
clientPromise.server = serverPromise;
|
|
7960
|
+
}
|
|
7961
|
+
return clientPromise;
|
|
7931
7962
|
};
|
|
7932
7963
|
}
|
|
7933
7964
|
function makeSchemaCRUD(schema, tx, ivmBranch) {
|
|
@@ -8298,7 +8329,7 @@ function makeMessage(message, context, logLevel) {
|
|
|
8298
8329
|
}
|
|
8299
8330
|
|
|
8300
8331
|
// ../zero-client/src/client/version.ts
|
|
8301
|
-
var version2 = "0.18.
|
|
8332
|
+
var version2 = "0.18.2025032400";
|
|
8302
8333
|
|
|
8303
8334
|
// ../zero-client/src/client/log-options.ts
|
|
8304
8335
|
var LevelFilterLogSink = class {
|
|
@@ -9272,6 +9303,84 @@ var ZeroRep = class {
|
|
|
9272
9303
|
};
|
|
9273
9304
|
};
|
|
9274
9305
|
|
|
9306
|
+
// ../zero-client/src/client/mutation-tracker.ts
|
|
9307
|
+
import { resolver as resolver7 } from "@rocicorp/resolver";
|
|
9308
|
+
var MutationTracker = class {
|
|
9309
|
+
#outstandingMutations;
|
|
9310
|
+
#clientID;
|
|
9311
|
+
constructor() {
|
|
9312
|
+
this.#outstandingMutations = /* @__PURE__ */ new Map();
|
|
9313
|
+
}
|
|
9314
|
+
set clientID(clientID) {
|
|
9315
|
+
this.#clientID = clientID;
|
|
9316
|
+
}
|
|
9317
|
+
trackMutation(id) {
|
|
9318
|
+
assert(!this.#outstandingMutations.has(id));
|
|
9319
|
+
const mutationResolver = resolver7();
|
|
9320
|
+
this.#outstandingMutations.set(id, mutationResolver);
|
|
9321
|
+
return mutationResolver.promise;
|
|
9322
|
+
}
|
|
9323
|
+
/**
|
|
9324
|
+
* Called if the mutation is never able to be sent to the server
|
|
9325
|
+
* and abandoned before persisted.
|
|
9326
|
+
* In that case, we have no `pushResponse` to process.
|
|
9327
|
+
*/
|
|
9328
|
+
rejectMutation(id, e) {
|
|
9329
|
+
const resolver9 = this.#outstandingMutations.get(id);
|
|
9330
|
+
assert(resolver9);
|
|
9331
|
+
resolver9.reject(e);
|
|
9332
|
+
this.#outstandingMutations.delete(id);
|
|
9333
|
+
}
|
|
9334
|
+
processPushResponse(response) {
|
|
9335
|
+
if ("error" in response) {
|
|
9336
|
+
this.#processPushError(response);
|
|
9337
|
+
} else {
|
|
9338
|
+
this.#processPushOk(response);
|
|
9339
|
+
}
|
|
9340
|
+
}
|
|
9341
|
+
get size() {
|
|
9342
|
+
return this.#outstandingMutations.size;
|
|
9343
|
+
}
|
|
9344
|
+
#processPushError(error) {
|
|
9345
|
+
const mids = error.mutationIDs;
|
|
9346
|
+
if (!mids) {
|
|
9347
|
+
return;
|
|
9348
|
+
}
|
|
9349
|
+
for (const mid of mids) {
|
|
9350
|
+
this.#processMutationError(mid, error);
|
|
9351
|
+
}
|
|
9352
|
+
}
|
|
9353
|
+
#processPushOk(ok) {
|
|
9354
|
+
for (const mutation of ok.mutations) {
|
|
9355
|
+
if ("error" in mutation.result) {
|
|
9356
|
+
this.#processMutationError(mutation.id, mutation.result);
|
|
9357
|
+
} else {
|
|
9358
|
+
this.#processMutationOk(mutation.result, mutation.id);
|
|
9359
|
+
}
|
|
9360
|
+
}
|
|
9361
|
+
}
|
|
9362
|
+
#processMutationError(mid, error) {
|
|
9363
|
+
assert(
|
|
9364
|
+
mid.clientID === this.#clientID,
|
|
9365
|
+
"received mutation for the wrong client"
|
|
9366
|
+
);
|
|
9367
|
+
const resolver9 = this.#outstandingMutations.get(mid.id);
|
|
9368
|
+
assert(resolver9);
|
|
9369
|
+
resolver9.reject(error);
|
|
9370
|
+
this.#outstandingMutations.delete(mid.id);
|
|
9371
|
+
}
|
|
9372
|
+
#processMutationOk(result, mid) {
|
|
9373
|
+
assert(
|
|
9374
|
+
mid.clientID === this.#clientID,
|
|
9375
|
+
"received mutation for the wrong client"
|
|
9376
|
+
);
|
|
9377
|
+
const resolver9 = this.#outstandingMutations.get(mid.id);
|
|
9378
|
+
assert(resolver9);
|
|
9379
|
+
resolver9.resolve(result);
|
|
9380
|
+
this.#outstandingMutations.delete(mid.id);
|
|
9381
|
+
}
|
|
9382
|
+
};
|
|
9383
|
+
|
|
9275
9384
|
// ../zero-client/src/client/zero.ts
|
|
9276
9385
|
var onSetConnectionStateSymbol = Symbol();
|
|
9277
9386
|
var exposedToTestingSymbol = Symbol();
|
|
@@ -9332,6 +9441,7 @@ var Zero = class {
|
|
|
9332
9441
|
#ivmMain;
|
|
9333
9442
|
#clientToServer;
|
|
9334
9443
|
#deleteClientsManager;
|
|
9444
|
+
#mutationTracker;
|
|
9335
9445
|
/**
|
|
9336
9446
|
* The queries we sent when inside the sec-protocol header when establishing a connection.
|
|
9337
9447
|
* More queries could be registered while we're waiting for the 'connected' message
|
|
@@ -9368,12 +9478,12 @@ var Zero = class {
|
|
|
9368
9478
|
#abortPingTimeout = () => {
|
|
9369
9479
|
};
|
|
9370
9480
|
#zeroContext;
|
|
9371
|
-
#connectResolver =
|
|
9481
|
+
#connectResolver = resolver8();
|
|
9372
9482
|
#pendingPullsByRequestID = /* @__PURE__ */ new Map();
|
|
9373
9483
|
#lastMutationIDReceived = 0;
|
|
9374
9484
|
#socket = void 0;
|
|
9375
|
-
#socketResolver =
|
|
9376
|
-
#connectionStateChangeResolver =
|
|
9485
|
+
#socketResolver = resolver8();
|
|
9486
|
+
#connectionStateChangeResolver = resolver8();
|
|
9377
9487
|
/**
|
|
9378
9488
|
* This resolver is only used for rejections. It is awaited in the connected
|
|
9379
9489
|
* state (including when waiting for a pong). It is rejected when we get an
|
|
@@ -9390,7 +9500,7 @@ var Zero = class {
|
|
|
9390
9500
|
}
|
|
9391
9501
|
this.#connectionState = state;
|
|
9392
9502
|
this.#connectionStateChangeResolver.resolve(state);
|
|
9393
|
-
this.#connectionStateChangeResolver =
|
|
9503
|
+
this.#connectionStateChangeResolver = resolver8();
|
|
9394
9504
|
if (false) {
|
|
9395
9505
|
asTestZero(this)[onSetConnectionStateSymbol]?.(state);
|
|
9396
9506
|
}
|
|
@@ -9470,6 +9580,7 @@ var Zero = class {
|
|
|
9470
9580
|
);
|
|
9471
9581
|
}
|
|
9472
9582
|
const lc = new LogContext4(logOptions.logLevel, {}, logOptions.logSink);
|
|
9583
|
+
this.#mutationTracker = new MutationTracker();
|
|
9473
9584
|
if (options.mutators) {
|
|
9474
9585
|
for (const [namespaceOrKey, mutatorOrMutators] of Object.entries(
|
|
9475
9586
|
options.mutators
|
|
@@ -9479,6 +9590,7 @@ var Zero = class {
|
|
|
9479
9590
|
assertUnique(key);
|
|
9480
9591
|
replicacheMutators[key] = makeReplicacheMutator(
|
|
9481
9592
|
lc,
|
|
9593
|
+
this.#mutationTracker,
|
|
9482
9594
|
mutatorOrMutators,
|
|
9483
9595
|
schema,
|
|
9484
9596
|
slowMaterializeThreshold
|
|
@@ -9494,6 +9606,7 @@ var Zero = class {
|
|
|
9494
9606
|
assertUnique(key);
|
|
9495
9607
|
replicacheMutators[key] = makeReplicacheMutator(
|
|
9496
9608
|
lc,
|
|
9609
|
+
this.#mutationTracker,
|
|
9497
9610
|
mutator,
|
|
9498
9611
|
schema,
|
|
9499
9612
|
slowMaterializeThreshold
|
|
@@ -9552,6 +9665,7 @@ var Zero = class {
|
|
|
9552
9665
|
this.#server = server;
|
|
9553
9666
|
this.userID = userID;
|
|
9554
9667
|
this.#lc = lc.withContext("clientID", rep.clientID);
|
|
9668
|
+
this.#mutationTracker.clientID = rep.clientID;
|
|
9555
9669
|
const onUpdateNeededCallback = onUpdateNeeded ?? ((reason, serverErrorMsg) => {
|
|
9556
9670
|
reloadWithReason(
|
|
9557
9671
|
this.#lc,
|
|
@@ -9828,6 +9942,8 @@ var Zero = class {
|
|
|
9828
9942
|
return this.#deleteClientsManager.clientsDeletedOnServer(
|
|
9829
9943
|
downMessage[1]
|
|
9830
9944
|
);
|
|
9945
|
+
case "push-response":
|
|
9946
|
+
return this.#mutationTracker.processPushResponse(downMessage[1]);
|
|
9831
9947
|
default:
|
|
9832
9948
|
msgType;
|
|
9833
9949
|
rejectInvalidMessage();
|
|
@@ -10105,9 +10221,9 @@ var Zero = class {
|
|
|
10105
10221
|
l.error?.("disconnect() called while disconnected");
|
|
10106
10222
|
break;
|
|
10107
10223
|
}
|
|
10108
|
-
this.#socketResolver =
|
|
10224
|
+
this.#socketResolver = resolver8();
|
|
10109
10225
|
l.debug?.("Creating new connect resolver");
|
|
10110
|
-
this.#connectResolver =
|
|
10226
|
+
this.#connectResolver = resolver8();
|
|
10111
10227
|
this.#setConnectionState(Disconnected);
|
|
10112
10228
|
this.#messageCount = 0;
|
|
10113
10229
|
this.#connectStart = void 0;
|
|
@@ -10158,12 +10274,12 @@ var Zero = class {
|
|
|
10158
10274
|
const body = pullResponseMessage[1];
|
|
10159
10275
|
lc = lc.withContext("requestID", body.requestID);
|
|
10160
10276
|
lc.debug?.("Handling pull response", body);
|
|
10161
|
-
const
|
|
10162
|
-
if (!
|
|
10277
|
+
const resolver9 = this.#pendingPullsByRequestID.get(body.requestID);
|
|
10278
|
+
if (!resolver9) {
|
|
10163
10279
|
lc.debug?.("No resolver found");
|
|
10164
10280
|
return;
|
|
10165
10281
|
}
|
|
10166
|
-
|
|
10282
|
+
resolver9.resolve(pullResponseMessage[1]);
|
|
10167
10283
|
}
|
|
10168
10284
|
async #pusher(req, requestID) {
|
|
10169
10285
|
assert(req.pushVersion === 1);
|
|
@@ -10294,7 +10410,7 @@ var Zero = class {
|
|
|
10294
10410
|
PING_INTERVAL_MS,
|
|
10295
10411
|
controller.signal
|
|
10296
10412
|
);
|
|
10297
|
-
this.#rejectMessageError =
|
|
10413
|
+
this.#rejectMessageError = resolver8();
|
|
10298
10414
|
const PING = 0;
|
|
10299
10415
|
const HIDDEN = 2;
|
|
10300
10416
|
const raceResult = await promiseRace([
|
|
@@ -10402,7 +10518,7 @@ var Zero = class {
|
|
|
10402
10518
|
}
|
|
10403
10519
|
];
|
|
10404
10520
|
send(socket, pullRequestMessage);
|
|
10405
|
-
const pullResponseResolver =
|
|
10521
|
+
const pullResponseResolver = resolver8();
|
|
10406
10522
|
this.#pendingPullsByRequestID.set(requestID, pullResponseResolver);
|
|
10407
10523
|
try {
|
|
10408
10524
|
const TIMEOUT = 0;
|
|
@@ -10460,7 +10576,7 @@ var Zero = class {
|
|
|
10460
10576
|
*/
|
|
10461
10577
|
async #ping(l, messageErrorRejectionPromise) {
|
|
10462
10578
|
l.debug?.("pinging");
|
|
10463
|
-
const { promise, resolve } =
|
|
10579
|
+
const { promise, resolve } = resolver8();
|
|
10464
10580
|
this.#onPong = resolve;
|
|
10465
10581
|
const pingMessage = ["ping", {}];
|
|
10466
10582
|
const t0 = performance.now();
|
|
@@ -10506,7 +10622,7 @@ var Zero = class {
|
|
|
10506
10622
|
*/
|
|
10507
10623
|
async inspect() {
|
|
10508
10624
|
BUNDLE_SIZE: {
|
|
10509
|
-
const m = await import("./inspector-
|
|
10625
|
+
const m = await import("./inspector-ROITQB3J.js");
|
|
10510
10626
|
return m.newInspector(this.#rep, this.#schema);
|
|
10511
10627
|
}
|
|
10512
10628
|
}
|
|
@@ -10625,4 +10741,4 @@ export {
|
|
|
10625
10741
|
escapeLike,
|
|
10626
10742
|
Zero
|
|
10627
10743
|
};
|
|
10628
|
-
//# sourceMappingURL=chunk-
|
|
10744
|
+
//# sourceMappingURL=chunk-YAABAEJV.js.map
|