@rocicorp/zero 0.19.2025041602 → 0.19.2025042201
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/analyze-query/src/bin-cache-stats.js +75 -5
- package/out/analyze-query/src/bin-cache-stats.js.map +1 -1
- package/out/{chunk-2FSGOJV7.js → chunk-CEZ72T6H.js} +256 -104
- package/out/chunk-CEZ72T6H.js.map +7 -0
- package/out/react.js.map +1 -1
- package/out/shared/src/logging-test-utils.d.ts +1 -1
- package/out/shared/src/logging-test-utils.d.ts.map +1 -1
- package/out/solid.js +1 -1
- package/out/zero-cache/src/server/syncer.d.ts.map +1 -1
- package/out/zero-cache/src/server/syncer.js +1 -0
- package/out/zero-cache/src/server/syncer.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/initial-sync.js +2 -2
- package/out/zero-cache/src/services/change-source/pg/initial-sync.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.js +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.d.ts +2 -2
- package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.js +2 -2
- package/out/zero-cache/src/services/mutagen/pusher.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.js +1 -0
- package/out/zero-cache/src/services/view-syncer/client-handler.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.js +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/key-columns.js +1 -1
- package/out/zero-cache/src/services/view-syncer/key-columns.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 +5 -2
- package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
- package/out/zero-cache/src/types/schema-versions.js +1 -1
- package/out/zero-cache/src/types/schema-versions.js.map +1 -1
- package/out/zero-cache/src/workers/connection.d.ts +1 -1
- package/out/zero-cache/src/workers/connection.d.ts.map +1 -1
- package/out/zero-cache/src/workers/connection.js +2 -2
- package/out/zero-cache/src/workers/connection.js.map +1 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.js +1 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.js.map +1 -1
- package/out/zero-cache/src/workers/syncer.d.ts.map +1 -1
- package/out/zero-cache/src/workers/syncer.js +4 -1
- package/out/zero-cache/src/workers/syncer.js.map +1 -1
- package/out/zero-client/src/client/context.d.ts +2 -2
- package/out/zero-client/src/client/context.d.ts.map +1 -1
- package/out/zero-client/src/client/custom.d.ts +3 -3
- package/out/zero-client/src/client/custom.d.ts.map +1 -1
- package/out/zero-client/src/client/delete-clients-manager.d.ts +2 -2
- package/out/zero-client/src/client/delete-clients-manager.d.ts.map +1 -1
- package/out/zero-client/src/client/metrics.d.ts +4 -5
- package/out/zero-client/src/client/metrics.d.ts.map +1 -1
- package/out/zero-client/src/client/mutation-tracker.d.ts +3 -3
- package/out/zero-client/src/client/mutation-tracker.d.ts.map +1 -1
- package/out/zero-client/src/client/on-error-kind-enum.d.ts +17 -0
- package/out/zero-client/src/client/on-error-kind-enum.d.ts.map +1 -0
- package/out/zero-client/src/client/on-error-kind.d.ts +5 -0
- package/out/zero-client/src/client/on-error-kind.d.ts.map +1 -0
- package/out/zero-client/src/client/on-error.d.ts +9 -0
- package/out/zero-client/src/client/on-error.d.ts.map +1 -0
- package/out/zero-client/src/client/options.d.ts +18 -4
- package/out/zero-client/src/client/options.d.ts.map +1 -1
- package/out/zero-client/src/client/reload-error-handler.d.ts +5 -3
- package/out/zero-client/src/client/reload-error-handler.d.ts.map +1 -1
- package/out/zero-client/src/client/server-error.d.ts +1 -3
- package/out/zero-client/src/client/server-error.d.ts.map +1 -1
- package/out/zero-client/src/client/update-needed-reason-type-enum.d.ts +20 -0
- package/out/zero-client/src/client/update-needed-reason-type-enum.d.ts.map +1 -0
- package/out/zero-client/src/client/update-needed-reason-type.d.ts +5 -0
- package/out/zero-client/src/client/update-needed-reason-type.d.ts.map +1 -0
- package/out/zero-client/src/client/zero-log-context.d.ts +7 -0
- package/out/zero-client/src/client/zero-log-context.d.ts.map +1 -0
- package/out/zero-client/src/client/zero-poke-handler.d.ts +2 -2
- package/out/zero-client/src/client/zero-poke-handler.d.ts.map +1 -1
- package/out/zero-client/src/client/zero.d.ts +2 -2
- package/out/zero-client/src/client/zero.d.ts.map +1 -1
- package/out/zero-client/src/mod.d.ts +4 -0
- package/out/zero-client/src/mod.d.ts.map +1 -1
- package/out/zero-protocol/src/error-kind.d.ts +5 -0
- package/out/zero-protocol/src/error-kind.d.ts.map +1 -0
- package/out/zero-protocol/src/error-kind.js +3 -0
- package/out/zero-protocol/src/error-kind.js.map +1 -0
- package/out/zero-protocol/src/error.d.ts +2 -0
- package/out/zero-protocol/src/error.d.ts.map +1 -1
- package/out/zero-protocol/src/error.js +2 -1
- package/out/zero-protocol/src/error.js.map +1 -1
- package/out/zero-react/src/use-query.d.ts +1 -1
- package/out/zero.js +8 -2
- package/package.json +2 -2
- package/out/chunk-2FSGOJV7.js.map +0 -7
|
@@ -121,6 +121,7 @@ import {
|
|
|
121
121
|
wrapIterable
|
|
122
122
|
} from "./chunk-2QVFOPGX.js";
|
|
123
123
|
import {
|
|
124
|
+
__export,
|
|
124
125
|
assert,
|
|
125
126
|
assertArray,
|
|
126
127
|
assertNotNull,
|
|
@@ -5536,6 +5537,45 @@ function canDatabaseBeCollectedAndGetDeletedClientIDs(enableMutationRecovery, pe
|
|
|
5536
5537
|
});
|
|
5537
5538
|
}
|
|
5538
5539
|
|
|
5540
|
+
// ../zero-protocol/src/error-kind-enum.ts
|
|
5541
|
+
var error_kind_enum_exports = {};
|
|
5542
|
+
__export(error_kind_enum_exports, {
|
|
5543
|
+
AuthInvalidated: () => AuthInvalidated,
|
|
5544
|
+
ClientNotFound: () => ClientNotFound,
|
|
5545
|
+
Internal: () => Internal,
|
|
5546
|
+
InvalidConnectionRequest: () => InvalidConnectionRequest,
|
|
5547
|
+
InvalidConnectionRequestBaseCookie: () => InvalidConnectionRequestBaseCookie,
|
|
5548
|
+
InvalidConnectionRequestClientDeleted: () => InvalidConnectionRequestClientDeleted,
|
|
5549
|
+
InvalidConnectionRequestLastMutationID: () => InvalidConnectionRequestLastMutationID,
|
|
5550
|
+
InvalidMessage: () => InvalidMessage,
|
|
5551
|
+
InvalidPush: () => InvalidPush,
|
|
5552
|
+
MutationFailed: () => MutationFailed,
|
|
5553
|
+
MutationRateLimited: () => MutationRateLimited,
|
|
5554
|
+
Rebalance: () => Rebalance,
|
|
5555
|
+
Rehome: () => Rehome,
|
|
5556
|
+
SchemaVersionNotSupported: () => SchemaVersionNotSupported,
|
|
5557
|
+
ServerOverloaded: () => ServerOverloaded,
|
|
5558
|
+
Unauthorized: () => Unauthorized,
|
|
5559
|
+
VersionNotSupported: () => VersionNotSupported
|
|
5560
|
+
});
|
|
5561
|
+
var AuthInvalidated = "AuthInvalidated";
|
|
5562
|
+
var ClientNotFound = "ClientNotFound";
|
|
5563
|
+
var InvalidConnectionRequest = "InvalidConnectionRequest";
|
|
5564
|
+
var InvalidConnectionRequestBaseCookie = "InvalidConnectionRequestBaseCookie";
|
|
5565
|
+
var InvalidConnectionRequestLastMutationID = "InvalidConnectionRequestLastMutationID";
|
|
5566
|
+
var InvalidConnectionRequestClientDeleted = "InvalidConnectionRequestClientDeleted";
|
|
5567
|
+
var InvalidMessage = "InvalidMessage";
|
|
5568
|
+
var InvalidPush = "InvalidPush";
|
|
5569
|
+
var MutationFailed = "MutationFailed";
|
|
5570
|
+
var MutationRateLimited = "MutationRateLimited";
|
|
5571
|
+
var Rebalance = "Rebalance";
|
|
5572
|
+
var Rehome = "Rehome";
|
|
5573
|
+
var Unauthorized = "Unauthorized";
|
|
5574
|
+
var VersionNotSupported = "VersionNotSupported";
|
|
5575
|
+
var SchemaVersionNotSupported = "SchemaVersionNotSupported";
|
|
5576
|
+
var ServerOverloaded = "ServerOverloaded";
|
|
5577
|
+
var Internal = "Internal";
|
|
5578
|
+
|
|
5539
5579
|
// ../zero-schema/src/builder/relationship-builder.ts
|
|
5540
5580
|
function relationships(table2, cb) {
|
|
5541
5581
|
const relationships2 = cb({ many, one });
|
|
@@ -6084,8 +6124,58 @@ function escapeLike(val) {
|
|
|
6084
6124
|
return val.replace(/[%_]/g, "\\$&");
|
|
6085
6125
|
}
|
|
6086
6126
|
|
|
6127
|
+
// ../zero-client/src/client/on-error-kind-enum.ts
|
|
6128
|
+
var on_error_kind_enum_exports = {};
|
|
6129
|
+
__export(on_error_kind_enum_exports, {
|
|
6130
|
+
AuthInvalidated: () => AuthInvalidated,
|
|
6131
|
+
ClientNotFound: () => ClientNotFound,
|
|
6132
|
+
Internal: () => Internal,
|
|
6133
|
+
InvalidConnectionRequest: () => InvalidConnectionRequest,
|
|
6134
|
+
InvalidConnectionRequestBaseCookie: () => InvalidConnectionRequestBaseCookie,
|
|
6135
|
+
InvalidConnectionRequestClientDeleted: () => InvalidConnectionRequestClientDeleted,
|
|
6136
|
+
InvalidConnectionRequestLastMutationID: () => InvalidConnectionRequestLastMutationID,
|
|
6137
|
+
InvalidMessage: () => InvalidMessage,
|
|
6138
|
+
InvalidPush: () => InvalidPush,
|
|
6139
|
+
InvalidState: () => InvalidState,
|
|
6140
|
+
Metrics: () => Metrics,
|
|
6141
|
+
Mutation: () => Mutation,
|
|
6142
|
+
MutationFailed: () => MutationFailed,
|
|
6143
|
+
MutationRateLimited: () => MutationRateLimited,
|
|
6144
|
+
Network: () => Network,
|
|
6145
|
+
NewClientGroup: () => NewClientGroup,
|
|
6146
|
+
Poke: () => Poke,
|
|
6147
|
+
Push: () => Push,
|
|
6148
|
+
Rebalance: () => Rebalance,
|
|
6149
|
+
Rehome: () => Rehome,
|
|
6150
|
+
SchemaVersionNotSupported: () => SchemaVersionNotSupported2,
|
|
6151
|
+
ServerOverloaded: () => ServerOverloaded,
|
|
6152
|
+
Unauthorized: () => Unauthorized,
|
|
6153
|
+
Unknown: () => Unknown,
|
|
6154
|
+
VersionNotSupported: () => VersionNotSupported2
|
|
6155
|
+
});
|
|
6156
|
+
|
|
6157
|
+
// ../zero-client/src/client/update-needed-reason-type-enum.ts
|
|
6158
|
+
var update_needed_reason_type_enum_exports = {};
|
|
6159
|
+
__export(update_needed_reason_type_enum_exports, {
|
|
6160
|
+
NewClientGroup: () => NewClientGroup,
|
|
6161
|
+
SchemaVersionNotSupported: () => SchemaVersionNotSupported2,
|
|
6162
|
+
VersionNotSupported: () => VersionNotSupported2
|
|
6163
|
+
});
|
|
6164
|
+
var NewClientGroup = "NewClientGroup";
|
|
6165
|
+
var VersionNotSupported2 = "VersionNotSupported";
|
|
6166
|
+
var SchemaVersionNotSupported2 = "SchemaVersionNotSupported";
|
|
6167
|
+
|
|
6168
|
+
// ../zero-client/src/client/on-error-kind-enum.ts
|
|
6169
|
+
var Poke = "Poke";
|
|
6170
|
+
var Mutation = "Mutation";
|
|
6171
|
+
var Push = "Push";
|
|
6172
|
+
var Metrics = "Metrics";
|
|
6173
|
+
var Unknown = "Unknown";
|
|
6174
|
+
var InvalidState = "InvalidState";
|
|
6175
|
+
var Network = "Network";
|
|
6176
|
+
|
|
6087
6177
|
// ../zero-client/src/client/zero.ts
|
|
6088
|
-
import
|
|
6178
|
+
import "@rocicorp/logger";
|
|
6089
6179
|
import { resolver as resolver8 } from "@rocicorp/resolver";
|
|
6090
6180
|
|
|
6091
6181
|
// ../zero-protocol/src/delete-clients.ts
|
|
@@ -6147,50 +6237,31 @@ function encodeSecProtocols(initConnectionMessage, authToken) {
|
|
|
6147
6237
|
return encodeURIComponent(btoa(JSON.stringify(protocols)));
|
|
6148
6238
|
}
|
|
6149
6239
|
|
|
6150
|
-
// ../zero-protocol/src/error-kind-enum.ts
|
|
6151
|
-
var AuthInvalidated = "AuthInvalidated";
|
|
6152
|
-
var ClientNotFound = "ClientNotFound";
|
|
6153
|
-
var InvalidConnectionRequest = "InvalidConnectionRequest";
|
|
6154
|
-
var InvalidConnectionRequestBaseCookie = "InvalidConnectionRequestBaseCookie";
|
|
6155
|
-
var InvalidConnectionRequestLastMutationID = "InvalidConnectionRequestLastMutationID";
|
|
6156
|
-
var InvalidConnectionRequestClientDeleted = "InvalidConnectionRequestClientDeleted";
|
|
6157
|
-
var InvalidMessage = "InvalidMessage";
|
|
6158
|
-
var InvalidPush = "InvalidPush";
|
|
6159
|
-
var MutationFailed = "MutationFailed";
|
|
6160
|
-
var MutationRateLimited = "MutationRateLimited";
|
|
6161
|
-
var Rebalance = "Rebalance";
|
|
6162
|
-
var Rehome = "Rehome";
|
|
6163
|
-
var Unauthorized = "Unauthorized";
|
|
6164
|
-
var VersionNotSupported = "VersionNotSupported";
|
|
6165
|
-
var SchemaVersionNotSupported = "SchemaVersionNotSupported";
|
|
6166
|
-
var ServerOverloaded = "ServerOverloaded";
|
|
6167
|
-
var Internal = "Internal";
|
|
6168
|
-
|
|
6169
6240
|
// ../zero-protocol/src/error.ts
|
|
6170
6241
|
var basicErrorKindSchema = valita_exports.union(
|
|
6171
|
-
valita_exports.literal(AuthInvalidated),
|
|
6172
|
-
valita_exports.literal(ClientNotFound),
|
|
6173
|
-
valita_exports.literal(InvalidConnectionRequest),
|
|
6174
|
-
valita_exports.literal(InvalidConnectionRequestBaseCookie),
|
|
6175
|
-
valita_exports.literal(InvalidConnectionRequestLastMutationID),
|
|
6176
|
-
valita_exports.literal(InvalidConnectionRequestClientDeleted),
|
|
6177
|
-
valita_exports.literal(InvalidMessage),
|
|
6178
|
-
valita_exports.literal(InvalidPush),
|
|
6179
|
-
valita_exports.literal(MutationRateLimited),
|
|
6180
|
-
valita_exports.literal(MutationFailed),
|
|
6181
|
-
valita_exports.literal(Unauthorized),
|
|
6182
|
-
valita_exports.literal(VersionNotSupported),
|
|
6183
|
-
valita_exports.literal(SchemaVersionNotSupported),
|
|
6184
|
-
valita_exports.literal(Internal)
|
|
6242
|
+
valita_exports.literal(error_kind_enum_exports.AuthInvalidated),
|
|
6243
|
+
valita_exports.literal(error_kind_enum_exports.ClientNotFound),
|
|
6244
|
+
valita_exports.literal(error_kind_enum_exports.InvalidConnectionRequest),
|
|
6245
|
+
valita_exports.literal(error_kind_enum_exports.InvalidConnectionRequestBaseCookie),
|
|
6246
|
+
valita_exports.literal(error_kind_enum_exports.InvalidConnectionRequestLastMutationID),
|
|
6247
|
+
valita_exports.literal(error_kind_enum_exports.InvalidConnectionRequestClientDeleted),
|
|
6248
|
+
valita_exports.literal(error_kind_enum_exports.InvalidMessage),
|
|
6249
|
+
valita_exports.literal(error_kind_enum_exports.InvalidPush),
|
|
6250
|
+
valita_exports.literal(error_kind_enum_exports.MutationRateLimited),
|
|
6251
|
+
valita_exports.literal(error_kind_enum_exports.MutationFailed),
|
|
6252
|
+
valita_exports.literal(error_kind_enum_exports.Unauthorized),
|
|
6253
|
+
valita_exports.literal(error_kind_enum_exports.VersionNotSupported),
|
|
6254
|
+
valita_exports.literal(error_kind_enum_exports.SchemaVersionNotSupported),
|
|
6255
|
+
valita_exports.literal(error_kind_enum_exports.Internal)
|
|
6185
6256
|
);
|
|
6186
6257
|
var basicErrorBodySchema = valita_exports.object({
|
|
6187
6258
|
kind: basicErrorKindSchema,
|
|
6188
6259
|
message: valita_exports.string()
|
|
6189
6260
|
});
|
|
6190
6261
|
var backoffErrorKindSchema = valita_exports.union(
|
|
6191
|
-
valita_exports.literal(Rebalance),
|
|
6192
|
-
valita_exports.literal(Rehome),
|
|
6193
|
-
valita_exports.literal(ServerOverloaded)
|
|
6262
|
+
valita_exports.literal(error_kind_enum_exports.Rebalance),
|
|
6263
|
+
valita_exports.literal(error_kind_enum_exports.Rehome),
|
|
6264
|
+
valita_exports.literal(error_kind_enum_exports.ServerOverloaded)
|
|
6194
6265
|
);
|
|
6195
6266
|
var backoffBodySchema = valita_exports.object({
|
|
6196
6267
|
kind: backoffErrorKindSchema,
|
|
@@ -6206,6 +6277,10 @@ var backoffBodySchema = valita_exports.object({
|
|
|
6206
6277
|
// reconnect, and not after that.
|
|
6207
6278
|
reconnectParams: valita_exports.record(valita_exports.string()).optional()
|
|
6208
6279
|
});
|
|
6280
|
+
var errorKindSchema = valita_exports.union(
|
|
6281
|
+
basicErrorKindSchema,
|
|
6282
|
+
backoffErrorKindSchema
|
|
6283
|
+
);
|
|
6209
6284
|
var errorBodySchema = valita_exports.union(basicErrorBodySchema, backoffBodySchema);
|
|
6210
6285
|
var errorMessageSchema = valita_exports.tuple([
|
|
6211
6286
|
valita_exports.literal("error"),
|
|
@@ -7786,6 +7861,7 @@ var ZeroContext = class {
|
|
|
7786
7861
|
listener();
|
|
7787
7862
|
} catch (e) {
|
|
7788
7863
|
this.#lc.error?.(
|
|
7864
|
+
error_kind_enum_exports.Internal,
|
|
7789
7865
|
"Failed notifying a commit listener of IVM updates",
|
|
7790
7866
|
e
|
|
7791
7867
|
);
|
|
@@ -8431,7 +8507,7 @@ function makeMessage(message, context, logLevel) {
|
|
|
8431
8507
|
}
|
|
8432
8508
|
|
|
8433
8509
|
// ../zero-client/src/client/version.ts
|
|
8434
|
-
var version2 = "0.19.
|
|
8510
|
+
var version2 = "0.19.2025042201";
|
|
8435
8511
|
|
|
8436
8512
|
// ../zero-client/src/client/log-options.ts
|
|
8437
8513
|
var LevelFilterLogSink = class {
|
|
@@ -8628,7 +8704,10 @@ var MetricManager = class {
|
|
|
8628
8704
|
async flush() {
|
|
8629
8705
|
const lc = this.#lc;
|
|
8630
8706
|
if (this.#timerID === null) {
|
|
8631
|
-
lc.error?.(
|
|
8707
|
+
lc.error?.(
|
|
8708
|
+
on_error_kind_enum_exports.InvalidState,
|
|
8709
|
+
"MetricManager.flush() called but already stopped"
|
|
8710
|
+
);
|
|
8632
8711
|
return;
|
|
8633
8712
|
}
|
|
8634
8713
|
const allSeries = [];
|
|
@@ -8649,12 +8728,15 @@ var MetricManager = class {
|
|
|
8649
8728
|
try {
|
|
8650
8729
|
await this.#reporter(allSeries);
|
|
8651
8730
|
} catch (e) {
|
|
8652
|
-
lc?.error?.(`Error reporting metrics: ${e}`);
|
|
8731
|
+
lc?.error?.(on_error_kind_enum_exports.Metrics, `Error reporting metrics: ${e}`);
|
|
8653
8732
|
}
|
|
8654
8733
|
}
|
|
8655
8734
|
stop() {
|
|
8656
8735
|
if (this.#timerID === null) {
|
|
8657
|
-
this.#lc.error?.(
|
|
8736
|
+
this.#lc.error?.(
|
|
8737
|
+
on_error_kind_enum_exports.InvalidState,
|
|
8738
|
+
"MetricManager.stop() called but already stopped"
|
|
8739
|
+
);
|
|
8658
8740
|
return;
|
|
8659
8741
|
}
|
|
8660
8742
|
clearInterval(this.#timerID);
|
|
@@ -8782,6 +8864,7 @@ var MutationTracker = class {
|
|
|
8782
8864
|
processPushResponse(response) {
|
|
8783
8865
|
if ("error" in response) {
|
|
8784
8866
|
this.#lc.error?.(
|
|
8867
|
+
on_error_kind_enum_exports.Push,
|
|
8785
8868
|
"Received an error response when pushing mutations",
|
|
8786
8869
|
response
|
|
8787
8870
|
);
|
|
@@ -8852,7 +8935,11 @@ var MutationTracker = class {
|
|
|
8852
8935
|
mid.clientID === this.#clientID,
|
|
8853
8936
|
"received mutation for the wrong client"
|
|
8854
8937
|
);
|
|
8855
|
-
this.#lc.error?.(
|
|
8938
|
+
this.#lc.error?.(
|
|
8939
|
+
on_error_kind_enum_exports.Mutation,
|
|
8940
|
+
`Mutation ${mid.id} returned an error`,
|
|
8941
|
+
error
|
|
8942
|
+
);
|
|
8856
8943
|
const ephemeralID = this.#ephemeralIDsByMutationID.get(mid.id);
|
|
8857
8944
|
assert(
|
|
8858
8945
|
ephemeralID,
|
|
@@ -9104,10 +9191,20 @@ var QueryManager = class {
|
|
|
9104
9191
|
}
|
|
9105
9192
|
};
|
|
9106
9193
|
|
|
9194
|
+
// ../zero-client/src/client/options.ts
|
|
9195
|
+
var updateNeededReasonTypeSchema = valita_exports.union(
|
|
9196
|
+
valita_exports.literal(update_needed_reason_type_enum_exports.NewClientGroup),
|
|
9197
|
+
valita_exports.literal(update_needed_reason_type_enum_exports.VersionNotSupported),
|
|
9198
|
+
valita_exports.literal(update_needed_reason_type_enum_exports.SchemaVersionNotSupported)
|
|
9199
|
+
);
|
|
9200
|
+
|
|
9107
9201
|
// ../zero-client/src/client/reload-error-handler.ts
|
|
9108
|
-
import "@rocicorp/logger";
|
|
9109
9202
|
var RELOAD_REASON_STORAGE_KEY = "_zeroReloadReason";
|
|
9110
9203
|
var RELOAD_BACKOFF_STATE_KEY = "_zeroReloadBackoffState";
|
|
9204
|
+
var reloadReasonSchema = valita_exports.tuple([
|
|
9205
|
+
valita_exports.union(updateNeededReasonTypeSchema, errorKindSchema),
|
|
9206
|
+
valita_exports.string()
|
|
9207
|
+
]);
|
|
9111
9208
|
var backoffStateSchema = valita_exports.object({
|
|
9112
9209
|
lastReloadTime: valita_exports.number().default(0),
|
|
9113
9210
|
nextIntervalMs: valita_exports.number().default(0)
|
|
@@ -9116,16 +9213,19 @@ var MIN_RELOAD_INTERVAL_MS = 500;
|
|
|
9116
9213
|
var MAX_RELOAD_INTERVAL_MS = 6e4;
|
|
9117
9214
|
var FALLBACK_RELOAD_INTERVAL_MS = 1e4;
|
|
9118
9215
|
var reloadTimer = null;
|
|
9119
|
-
function reloadWithReason(lc, reload2, reason) {
|
|
9216
|
+
function reloadWithReason(lc, reload2, reason, message) {
|
|
9120
9217
|
if (reloadTimer) {
|
|
9121
|
-
lc.
|
|
9218
|
+
lc.info?.("reload timer already scheduled");
|
|
9122
9219
|
return;
|
|
9123
9220
|
}
|
|
9124
9221
|
const now = Date.now();
|
|
9125
9222
|
const backoff = nextBackoff(lc, now);
|
|
9126
9223
|
if (typeof sessionStorage !== "undefined") {
|
|
9127
9224
|
sessionStorage.setItem(RELOAD_BACKOFF_STATE_KEY, JSON.stringify(backoff));
|
|
9128
|
-
sessionStorage.setItem(
|
|
9225
|
+
sessionStorage.setItem(
|
|
9226
|
+
RELOAD_REASON_STORAGE_KEY,
|
|
9227
|
+
JSON.stringify([reason, message])
|
|
9228
|
+
);
|
|
9129
9229
|
}
|
|
9130
9230
|
const delay = backoff.lastReloadTime - now;
|
|
9131
9231
|
lc.error?.(
|
|
@@ -9141,10 +9241,17 @@ function reloadWithReason(lc, reload2, reason) {
|
|
|
9141
9241
|
}
|
|
9142
9242
|
function reportReloadReason(lc) {
|
|
9143
9243
|
if (typeof sessionStorage !== "undefined") {
|
|
9144
|
-
const
|
|
9145
|
-
if (
|
|
9244
|
+
const value = sessionStorage.getItem(RELOAD_REASON_STORAGE_KEY);
|
|
9245
|
+
if (value) {
|
|
9146
9246
|
sessionStorage.removeItem(RELOAD_REASON_STORAGE_KEY);
|
|
9147
|
-
|
|
9247
|
+
try {
|
|
9248
|
+
const parsed = JSON.parse(value);
|
|
9249
|
+
const [reasonType, message] = parse(parsed, reloadReasonSchema);
|
|
9250
|
+
lc.error?.(reasonType, "Zero reloaded the page.", message);
|
|
9251
|
+
} catch (e) {
|
|
9252
|
+
lc.error?.(on_error_kind_enum_exports.InvalidState, "Zero reloaded the page.", e);
|
|
9253
|
+
return;
|
|
9254
|
+
}
|
|
9148
9255
|
}
|
|
9149
9256
|
}
|
|
9150
9257
|
}
|
|
@@ -9210,14 +9317,14 @@ function isAuthError(ex) {
|
|
|
9210
9317
|
return isServerError(ex) && isAuthErrorKind(ex.kind);
|
|
9211
9318
|
}
|
|
9212
9319
|
function isAuthErrorKind(kind) {
|
|
9213
|
-
return kind === AuthInvalidated || kind === Unauthorized;
|
|
9320
|
+
return kind === error_kind_enum_exports.AuthInvalidated || kind === error_kind_enum_exports.Unauthorized;
|
|
9214
9321
|
}
|
|
9215
9322
|
function isBackoffError(ex) {
|
|
9216
9323
|
if (isServerError(ex)) {
|
|
9217
9324
|
switch (ex.errorBody.kind) {
|
|
9218
|
-
case Rebalance:
|
|
9219
|
-
case Rehome:
|
|
9220
|
-
case ServerOverloaded:
|
|
9325
|
+
case error_kind_enum_exports.Rebalance:
|
|
9326
|
+
case error_kind_enum_exports.Rehome:
|
|
9327
|
+
case error_kind_enum_exports.ServerOverloaded:
|
|
9221
9328
|
return ex.errorBody;
|
|
9222
9329
|
}
|
|
9223
9330
|
}
|
|
@@ -9285,6 +9392,10 @@ function getServer(server) {
|
|
|
9285
9392
|
return validateServerParam("server", server);
|
|
9286
9393
|
}
|
|
9287
9394
|
|
|
9395
|
+
// ../zero-client/src/client/zero-log-context.ts
|
|
9396
|
+
import { LogContext as LogContext3 } from "@rocicorp/logger";
|
|
9397
|
+
var ZeroLogContext = LogContext3;
|
|
9398
|
+
|
|
9288
9399
|
// ../zero-client/src/client/zero-poke-handler.ts
|
|
9289
9400
|
import { Lock as Lock3 } from "@rocicorp/lock";
|
|
9290
9401
|
var PokeHandler = class {
|
|
@@ -9408,7 +9519,11 @@ var PokeHandler = class {
|
|
|
9408
9519
|
if (String(e).includes("unexpected base cookie for poke")) {
|
|
9409
9520
|
this.#lc.debug?.("clearing due to", e);
|
|
9410
9521
|
} else {
|
|
9411
|
-
this.#lc.error?.(
|
|
9522
|
+
this.#lc.error?.(
|
|
9523
|
+
on_error_kind_enum_exports.Poke,
|
|
9524
|
+
"clearing due to unexpected poke error",
|
|
9525
|
+
e
|
|
9526
|
+
);
|
|
9412
9527
|
}
|
|
9413
9528
|
this.#clear();
|
|
9414
9529
|
this.#onPokeError();
|
|
@@ -9628,7 +9743,7 @@ var NULL_LAST_MUTATION_ID_SENT = { clientID: "", id: -1 };
|
|
|
9628
9743
|
function convertOnUpdateNeededReason(reason) {
|
|
9629
9744
|
return { type: reason.type };
|
|
9630
9745
|
}
|
|
9631
|
-
function
|
|
9746
|
+
function updateNeededReloadReasonMessage(reason, serverErrMsg) {
|
|
9632
9747
|
const { type } = reason;
|
|
9633
9748
|
let reasonMsg = "";
|
|
9634
9749
|
switch (type) {
|
|
@@ -9649,9 +9764,7 @@ function updateNeededReloadReason(reason, serverErrMsg) {
|
|
|
9649
9764
|
}
|
|
9650
9765
|
return reasonMsg;
|
|
9651
9766
|
}
|
|
9652
|
-
|
|
9653
|
-
return `Server reported that client is ahead of server (${kind}). This probably happened because the server is in development mode and restarted. Currently when this happens, the dev server loses its state and on reconnect sees the client as ahead. If you see this in other cases, it may be a bug in Zero.`;
|
|
9654
|
-
}
|
|
9767
|
+
var serverAheadReloadReason = `Server reported that client is ahead of server. This probably happened because the server is in development mode and restarted. Currently when this happens, the dev server loses its state and on reconnect sees the client as ahead. If you see this in other cases, it may be a bug in Zero.`;
|
|
9655
9768
|
function onClientStateNotFoundServerReason(serverErrMsg) {
|
|
9656
9769
|
return `Server could not find state needed to synchronize this client. ${serverErrMsg}`;
|
|
9657
9770
|
}
|
|
@@ -9811,7 +9924,21 @@ var Zero = class {
|
|
|
9811
9924
|
`A mutator, or mutator namespace, has already been defined for ${key}`
|
|
9812
9925
|
);
|
|
9813
9926
|
}
|
|
9814
|
-
const
|
|
9927
|
+
const { onError } = options;
|
|
9928
|
+
const sink = logOptions.logSink;
|
|
9929
|
+
const logSink = {
|
|
9930
|
+
log(level, context, ...args) {
|
|
9931
|
+
if (level === "error" && onError) {
|
|
9932
|
+
onError(...args);
|
|
9933
|
+
} else {
|
|
9934
|
+
sink.log(level, context, ...args);
|
|
9935
|
+
}
|
|
9936
|
+
},
|
|
9937
|
+
async flush() {
|
|
9938
|
+
await sink.flush?.();
|
|
9939
|
+
}
|
|
9940
|
+
};
|
|
9941
|
+
const lc = new ZeroLogContext(logOptions.logLevel, {}, logSink);
|
|
9815
9942
|
this.#mutationTracker = new MutationTracker(lc);
|
|
9816
9943
|
if (options.mutators) {
|
|
9817
9944
|
for (const [namespaceOrKey, mutatorOrMutators] of Object.entries(
|
|
@@ -9902,13 +10029,18 @@ var Zero = class {
|
|
|
9902
10029
|
this.userID = userID;
|
|
9903
10030
|
this.#lc = lc.withContext("clientID", rep.clientID);
|
|
9904
10031
|
this.#mutationTracker.clientID = rep.clientID;
|
|
9905
|
-
const onUpdateNeededCallback =
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
10032
|
+
const onUpdateNeededCallback = (reason, serverErrorMsg) => {
|
|
10033
|
+
if (onUpdateNeeded) {
|
|
10034
|
+
onUpdateNeeded(reason);
|
|
10035
|
+
} else {
|
|
10036
|
+
reloadWithReason(
|
|
10037
|
+
this.#lc,
|
|
10038
|
+
this.#reload,
|
|
10039
|
+
reason.type,
|
|
10040
|
+
updateNeededReloadReasonMessage(reason, serverErrorMsg)
|
|
10041
|
+
);
|
|
10042
|
+
}
|
|
10043
|
+
};
|
|
9912
10044
|
this.#onUpdateNeeded = onUpdateNeededCallback;
|
|
9913
10045
|
this.#rep.onUpdateNeeded = (reason) => {
|
|
9914
10046
|
onUpdateNeededCallback(convertOnUpdateNeededReason(reason));
|
|
@@ -9917,6 +10049,7 @@ var Zero = class {
|
|
|
9917
10049
|
reloadWithReason(
|
|
9918
10050
|
this.#lc,
|
|
9919
10051
|
this.#reload,
|
|
10052
|
+
error_kind_enum_exports.ClientNotFound,
|
|
9920
10053
|
reason ?? ON_CLIENT_STATE_NOT_FOUND_REASON_CLIENT
|
|
9921
10054
|
);
|
|
9922
10055
|
});
|
|
@@ -10188,7 +10321,8 @@ var Zero = class {
|
|
|
10188
10321
|
const l = addWebSocketIDFromSocketToLogContext(this.#socket, this.#lc);
|
|
10189
10322
|
if (this.#connectStart === void 0) {
|
|
10190
10323
|
l.error?.(
|
|
10191
|
-
|
|
10324
|
+
on_error_kind_enum_exports.InvalidState,
|
|
10325
|
+
"Got open event but connect start time is undefined."
|
|
10192
10326
|
);
|
|
10193
10327
|
} else {
|
|
10194
10328
|
const now = Date.now();
|
|
@@ -10200,20 +10334,27 @@ var Zero = class {
|
|
|
10200
10334
|
}
|
|
10201
10335
|
};
|
|
10202
10336
|
#onClose = (e) => {
|
|
10203
|
-
const
|
|
10337
|
+
const lc = addWebSocketIDFromSocketToLogContext(this.#socket, this.#lc);
|
|
10204
10338
|
const { code, reason, wasClean } = e;
|
|
10205
|
-
|
|
10206
|
-
|
|
10339
|
+
if (code <= 1001) {
|
|
10340
|
+
lc.info?.("Got socket close event", { code, reason, wasClean });
|
|
10341
|
+
} else {
|
|
10342
|
+
lc.error?.(on_error_kind_enum_exports.Network, "Got unexpected socket close event", {
|
|
10343
|
+
code,
|
|
10344
|
+
reason,
|
|
10345
|
+
wasClean
|
|
10346
|
+
});
|
|
10347
|
+
}
|
|
10207
10348
|
const closeKind = wasClean ? "CleanClose" : "AbruptClose";
|
|
10208
10349
|
this.#connectResolver.reject(new CloseError(closeKind));
|
|
10209
|
-
this.#disconnect(
|
|
10350
|
+
this.#disconnect(lc, { client: closeKind });
|
|
10210
10351
|
};
|
|
10211
10352
|
// An error on the connection is fatal for the connection.
|
|
10212
10353
|
async #handleErrorMessage(lc, downMessage) {
|
|
10213
10354
|
const [, { kind, message }] = downMessage;
|
|
10214
|
-
if (kind === MutationRateLimited) {
|
|
10355
|
+
if (kind === error_kind_enum_exports.MutationRateLimited) {
|
|
10215
10356
|
this.#lastMutationIDSent = NULL_LAST_MUTATION_ID_SENT;
|
|
10216
|
-
lc.error?.("Mutation rate limited", { message });
|
|
10357
|
+
lc.error?.(kind, "Mutation rate limited", { message });
|
|
10217
10358
|
return;
|
|
10218
10359
|
}
|
|
10219
10360
|
lc.info?.(`${kind}: ${message}}`);
|
|
@@ -10222,17 +10363,17 @@ var Zero = class {
|
|
|
10222
10363
|
lc.debug?.("Rejecting connect resolver due to error", error);
|
|
10223
10364
|
this.#connectResolver.reject(error);
|
|
10224
10365
|
this.#disconnect(lc, { server: kind });
|
|
10225
|
-
if (kind === VersionNotSupported) {
|
|
10366
|
+
if (kind === error_kind_enum_exports.VersionNotSupported) {
|
|
10226
10367
|
this.#onUpdateNeeded?.({ type: kind }, message);
|
|
10227
|
-
} else if (kind === SchemaVersionNotSupported) {
|
|
10368
|
+
} else if (kind === error_kind_enum_exports.SchemaVersionNotSupported) {
|
|
10228
10369
|
await this.#rep.disableClientGroup();
|
|
10229
10370
|
this.#onUpdateNeeded?.({ type: "SchemaVersionNotSupported" }, message);
|
|
10230
|
-
} else if (kind === ClientNotFound) {
|
|
10371
|
+
} else if (kind === error_kind_enum_exports.ClientNotFound) {
|
|
10231
10372
|
await this.#rep.disableClientGroup();
|
|
10232
10373
|
this.#onClientStateNotFound?.(onClientStateNotFoundServerReason(message));
|
|
10233
|
-
} else if (kind === InvalidConnectionRequestLastMutationID || kind === InvalidConnectionRequestBaseCookie) {
|
|
10374
|
+
} else if (kind === error_kind_enum_exports.InvalidConnectionRequestLastMutationID || kind === error_kind_enum_exports.InvalidConnectionRequestBaseCookie) {
|
|
10234
10375
|
await dropDatabase(this.#rep.idbName);
|
|
10235
|
-
reloadWithReason(lc, this.#reload, serverAheadReloadReason
|
|
10376
|
+
reloadWithReason(lc, this.#reload, kind, serverAheadReloadReason);
|
|
10236
10377
|
}
|
|
10237
10378
|
}
|
|
10238
10379
|
async #handleConnectedMessage(lc, connectedMessage) {
|
|
@@ -10253,7 +10394,8 @@ var Zero = class {
|
|
|
10253
10394
|
let connectMsgLatencyMs;
|
|
10254
10395
|
if (this.#connectStart === void 0) {
|
|
10255
10396
|
lc.error?.(
|
|
10256
|
-
|
|
10397
|
+
on_error_kind_enum_exports.InvalidState,
|
|
10398
|
+
"Got connected message but connect start time is undefined."
|
|
10257
10399
|
);
|
|
10258
10400
|
} else {
|
|
10259
10401
|
timeToConnectMs = now - this.#connectStart;
|
|
@@ -10264,7 +10406,8 @@ var Zero = class {
|
|
|
10264
10406
|
let totalTimeToConnectMs;
|
|
10265
10407
|
if (this.#totalToConnectStart === void 0) {
|
|
10266
10408
|
lc.error?.(
|
|
10267
|
-
|
|
10409
|
+
on_error_kind_enum_exports.InvalidState,
|
|
10410
|
+
"Got connected message but total to connect start time is undefined."
|
|
10268
10411
|
);
|
|
10269
10412
|
} else {
|
|
10270
10413
|
totalTimeToConnectMs = now - this.#totalToConnectStart;
|
|
@@ -10336,12 +10479,12 @@ var Zero = class {
|
|
|
10336
10479
|
* is received before the connected message is received or if the connection
|
|
10337
10480
|
* attempt times out.
|
|
10338
10481
|
*/
|
|
10339
|
-
async #connect(
|
|
10482
|
+
async #connect(lc, additionalConnectParams) {
|
|
10340
10483
|
assert(this.#server);
|
|
10341
10484
|
assert(this.#connectionState === Disconnected);
|
|
10342
10485
|
const wsid = nanoid();
|
|
10343
|
-
|
|
10344
|
-
|
|
10486
|
+
lc = addWebSocketIDToLogContext(wsid, lc);
|
|
10487
|
+
lc.info?.("Connecting...", { navigatorOnline: localNavigator?.onLine });
|
|
10345
10488
|
this.#setConnectionState(Connecting);
|
|
10346
10489
|
assert(this.#connectStart === void 0);
|
|
10347
10490
|
const now = Date.now();
|
|
@@ -10360,9 +10503,9 @@ var Zero = class {
|
|
|
10360
10503
|
return;
|
|
10361
10504
|
}
|
|
10362
10505
|
const timeoutID = setTimeout(() => {
|
|
10363
|
-
|
|
10506
|
+
lc.debug?.("Rejecting connect resolver due to timeout");
|
|
10364
10507
|
this.#connectResolver.reject(new TimedOutError("Connect"));
|
|
10365
|
-
this.#disconnect(
|
|
10508
|
+
this.#disconnect(lc, {
|
|
10366
10509
|
client: "ConnectTimeout"
|
|
10367
10510
|
});
|
|
10368
10511
|
}, CONNECT_TIMEOUT_MS);
|
|
@@ -10384,7 +10527,7 @@ var Zero = class {
|
|
|
10384
10527
|
this.#lastMutationIDReceived,
|
|
10385
10528
|
wsid,
|
|
10386
10529
|
this.#options.logLevel === "debug",
|
|
10387
|
-
|
|
10530
|
+
lc,
|
|
10388
10531
|
this.#options.push,
|
|
10389
10532
|
this.#options.maxHeaderLength,
|
|
10390
10533
|
additionalConnectParams
|
|
@@ -10404,7 +10547,7 @@ var Zero = class {
|
|
|
10404
10547
|
this.#onPageHide
|
|
10405
10548
|
);
|
|
10406
10549
|
try {
|
|
10407
|
-
|
|
10550
|
+
lc.debug?.("Waiting for connection to be acknowledged");
|
|
10408
10551
|
await this.#connectResolver.promise;
|
|
10409
10552
|
this.#mutationTracker.onConnected(this.#lastMutationIDReceived);
|
|
10410
10553
|
this.#rep.push().catch(() => {
|
|
@@ -10417,11 +10560,11 @@ var Zero = class {
|
|
|
10417
10560
|
);
|
|
10418
10561
|
}
|
|
10419
10562
|
}
|
|
10420
|
-
#disconnect(
|
|
10563
|
+
#disconnect(lc, reason, closeCode, closeReason) {
|
|
10421
10564
|
if (this.#connectionState === Connecting) {
|
|
10422
10565
|
this.#connectErrorCount++;
|
|
10423
10566
|
}
|
|
10424
|
-
|
|
10567
|
+
lc.info?.("disconnecting", {
|
|
10425
10568
|
navigatorOnline: localNavigator?.onLine,
|
|
10426
10569
|
reason,
|
|
10427
10570
|
connectStart: this.#connectStart,
|
|
@@ -10435,8 +10578,9 @@ var Zero = class {
|
|
|
10435
10578
|
switch (this.#connectionState) {
|
|
10436
10579
|
case Connected: {
|
|
10437
10580
|
if (this.#connectStart !== void 0) {
|
|
10438
|
-
|
|
10439
|
-
|
|
10581
|
+
lc.error?.(
|
|
10582
|
+
on_error_kind_enum_exports.InvalidState,
|
|
10583
|
+
"disconnect() called while connected but connect start time is defined."
|
|
10440
10584
|
);
|
|
10441
10585
|
}
|
|
10442
10586
|
break;
|
|
@@ -10451,18 +10595,22 @@ var Zero = class {
|
|
|
10451
10595
|
);
|
|
10452
10596
|
}
|
|
10453
10597
|
if (this.#connectStart === void 0) {
|
|
10454
|
-
|
|
10455
|
-
|
|
10598
|
+
lc.error?.(
|
|
10599
|
+
on_error_kind_enum_exports.InvalidState,
|
|
10600
|
+
"disconnect() called while connecting but connect start time is undefined."
|
|
10456
10601
|
);
|
|
10457
10602
|
}
|
|
10458
10603
|
break;
|
|
10459
10604
|
}
|
|
10460
10605
|
case Disconnected:
|
|
10461
|
-
|
|
10606
|
+
lc.error?.(
|
|
10607
|
+
on_error_kind_enum_exports.InvalidState,
|
|
10608
|
+
"disconnect() called while disconnected"
|
|
10609
|
+
);
|
|
10462
10610
|
break;
|
|
10463
10611
|
}
|
|
10464
10612
|
this.#socketResolver = resolver8();
|
|
10465
|
-
|
|
10613
|
+
lc.debug?.("Creating new connect resolver");
|
|
10466
10614
|
this.#connectResolver = resolver8();
|
|
10467
10615
|
this.#setConnectionState(Disconnected);
|
|
10468
10616
|
this.#messageCount = 0;
|
|
@@ -10640,7 +10788,7 @@ var Zero = class {
|
|
|
10640
10788
|
break;
|
|
10641
10789
|
}
|
|
10642
10790
|
case Connecting:
|
|
10643
|
-
lc.error?.(
|
|
10791
|
+
lc.error?.(on_error_kind_enum_exports.InvalidState);
|
|
10644
10792
|
gotError = true;
|
|
10645
10793
|
break;
|
|
10646
10794
|
case Connected: {
|
|
@@ -10688,7 +10836,8 @@ var Zero = class {
|
|
|
10688
10836
|
} catch (ex) {
|
|
10689
10837
|
if (this.#connectionState !== Connected) {
|
|
10690
10838
|
const level = isAuthError(ex) ? "warn" : "error";
|
|
10691
|
-
|
|
10839
|
+
const kind = isServerError(ex) ? ex.kind : on_error_kind_enum_exports.Unknown;
|
|
10840
|
+
lc[level]?.(kind, "Failed to connect", ex, {
|
|
10692
10841
|
lmid: this.#lastMutationIDReceived,
|
|
10693
10842
|
baseCookie: this.#connectCookie
|
|
10694
10843
|
});
|
|
@@ -10788,7 +10937,7 @@ var Zero = class {
|
|
|
10788
10937
|
};
|
|
10789
10938
|
}
|
|
10790
10939
|
default:
|
|
10791
|
-
|
|
10940
|
+
unreachable();
|
|
10792
10941
|
}
|
|
10793
10942
|
} finally {
|
|
10794
10943
|
pullResponseResolver.reject("timed out");
|
|
@@ -10815,8 +10964,8 @@ var Zero = class {
|
|
|
10815
10964
|
* If it takes too long to get a pong we disconnect and this returns
|
|
10816
10965
|
* {@linkcode PingResult.TimedOut}.
|
|
10817
10966
|
*/
|
|
10818
|
-
async #ping(
|
|
10819
|
-
|
|
10967
|
+
async #ping(lc, messageErrorRejectionPromise) {
|
|
10968
|
+
lc.debug?.("pinging");
|
|
10820
10969
|
const { promise, resolve } = resolver8();
|
|
10821
10970
|
this.#onPong = resolve;
|
|
10822
10971
|
const pingMessage = ["ping", {}];
|
|
@@ -10830,13 +10979,13 @@ var Zero = class {
|
|
|
10830
10979
|
]) === 0;
|
|
10831
10980
|
const delta = performance.now() - t0;
|
|
10832
10981
|
if (!connected) {
|
|
10833
|
-
|
|
10834
|
-
this.#disconnect(
|
|
10982
|
+
lc.info?.("ping failed in", delta, "ms - disconnecting");
|
|
10983
|
+
this.#disconnect(lc, {
|
|
10835
10984
|
client: "PingTimeout"
|
|
10836
10985
|
});
|
|
10837
10986
|
return TimedOut;
|
|
10838
10987
|
}
|
|
10839
|
-
|
|
10988
|
+
lc.debug?.("ping succeeded in", delta, "ms");
|
|
10840
10989
|
return Success;
|
|
10841
10990
|
}
|
|
10842
10991
|
// Sends a set of metrics to the server. Throws unless the server
|
|
@@ -10973,6 +11122,7 @@ export {
|
|
|
10973
11122
|
makeIDBName,
|
|
10974
11123
|
dropDatabase,
|
|
10975
11124
|
dropAllDatabases,
|
|
11125
|
+
error_kind_enum_exports,
|
|
10976
11126
|
relationships,
|
|
10977
11127
|
table,
|
|
10978
11128
|
string3 as string,
|
|
@@ -10986,6 +11136,8 @@ export {
|
|
|
10986
11136
|
NOBODY_CAN,
|
|
10987
11137
|
definePermissions,
|
|
10988
11138
|
escapeLike,
|
|
11139
|
+
update_needed_reason_type_enum_exports,
|
|
11140
|
+
on_error_kind_enum_exports,
|
|
10989
11141
|
Zero
|
|
10990
11142
|
};
|
|
10991
|
-
//# sourceMappingURL=chunk-
|
|
11143
|
+
//# sourceMappingURL=chunk-CEZ72T6H.js.map
|