@hot-updater/cloudflare 1.0.0-rc.33 → 1.0.0-rc.34
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/dist/index.d.cts +0 -15
- package/dist/index.d.mts +0 -15
- package/dist/worker/index.d.cts +0 -15
- package/dist/worker/index.d.mts +0 -15
- package/package.json +6 -6
- package/sql/bundles.sql +1 -1
- package/worker/dist/README.md +1 -1
- package/worker/dist/index.js +36 -91
- package/worker/dist/index.js.map +2 -2
- package/worker/migrations/0001_hot-updater_1.0.0.sql +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -54,8 +54,6 @@ type BundleEventFailure = DatabaseJsonObject & {
|
|
|
54
54
|
readonly origin_code?: string;
|
|
55
55
|
readonly error_message?: string;
|
|
56
56
|
readonly error_stack?: string;
|
|
57
|
-
/** Android's `ApplicationExitInfo` reason for the process before this one. */
|
|
58
|
-
readonly previous_process_exit?: string;
|
|
59
57
|
};
|
|
60
58
|
type DatabaseHttpResponse = DatabaseJsonObject & {
|
|
61
59
|
readonly resource: "catalog" | "artifact";
|
|
@@ -78,8 +76,6 @@ type DatabaseBundleEventMetadata = DatabaseJsonObject & {
|
|
|
78
76
|
readonly delivery?: "patch" | "manifest" | "archive" | "unknown";
|
|
79
77
|
/** `UPDATE_DOWNLOADED`: a patch failed and the full files came instead. */
|
|
80
78
|
readonly patch_fallback?: boolean;
|
|
81
|
-
/** `RECOVERED`: Android's `ApplicationExitInfo` reason for the crashed process. */
|
|
82
|
-
readonly previous_process_exit?: string;
|
|
83
79
|
};
|
|
84
80
|
type BundleEventRowBase = {
|
|
85
81
|
readonly id: string;
|
|
@@ -308,17 +304,6 @@ interface InsightsUpdateFailures {
|
|
|
308
304
|
};
|
|
309
305
|
/** Over a time range: failures by stage and reason, most first. */
|
|
310
306
|
readonly breakdown?: readonly InsightsFailureBreakdown[];
|
|
311
|
-
/**
|
|
312
|
-
* Over a time range: failed launches, and the recoveries whose crashed
|
|
313
|
-
* process exited for a reason Android 11+ reported, by reason, most first.
|
|
314
|
-
*/
|
|
315
|
-
readonly recoveries?: {
|
|
316
|
-
readonly failedLaunches: number;
|
|
317
|
-
readonly byExitReason: readonly {
|
|
318
|
-
readonly exitReason: string;
|
|
319
|
-
readonly events: number;
|
|
320
|
-
}[];
|
|
321
|
-
};
|
|
322
307
|
}
|
|
323
308
|
//#endregion
|
|
324
309
|
//#region ../api-keys/dist/server/model.d.mts
|
package/dist/index.d.mts
CHANGED
|
@@ -54,8 +54,6 @@ type BundleEventFailure = DatabaseJsonObject & {
|
|
|
54
54
|
readonly origin_code?: string;
|
|
55
55
|
readonly error_message?: string;
|
|
56
56
|
readonly error_stack?: string;
|
|
57
|
-
/** Android's `ApplicationExitInfo` reason for the process before this one. */
|
|
58
|
-
readonly previous_process_exit?: string;
|
|
59
57
|
};
|
|
60
58
|
type DatabaseHttpResponse = DatabaseJsonObject & {
|
|
61
59
|
readonly resource: "catalog" | "artifact";
|
|
@@ -78,8 +76,6 @@ type DatabaseBundleEventMetadata = DatabaseJsonObject & {
|
|
|
78
76
|
readonly delivery?: "patch" | "manifest" | "archive" | "unknown";
|
|
79
77
|
/** `UPDATE_DOWNLOADED`: a patch failed and the full files came instead. */
|
|
80
78
|
readonly patch_fallback?: boolean;
|
|
81
|
-
/** `RECOVERED`: Android's `ApplicationExitInfo` reason for the crashed process. */
|
|
82
|
-
readonly previous_process_exit?: string;
|
|
83
79
|
};
|
|
84
80
|
type BundleEventRowBase = {
|
|
85
81
|
readonly id: string;
|
|
@@ -308,17 +304,6 @@ interface InsightsUpdateFailures {
|
|
|
308
304
|
};
|
|
309
305
|
/** Over a time range: failures by stage and reason, most first. */
|
|
310
306
|
readonly breakdown?: readonly InsightsFailureBreakdown[];
|
|
311
|
-
/**
|
|
312
|
-
* Over a time range: failed launches, and the recoveries whose crashed
|
|
313
|
-
* process exited for a reason Android 11+ reported, by reason, most first.
|
|
314
|
-
*/
|
|
315
|
-
readonly recoveries?: {
|
|
316
|
-
readonly failedLaunches: number;
|
|
317
|
-
readonly byExitReason: readonly {
|
|
318
|
-
readonly exitReason: string;
|
|
319
|
-
readonly events: number;
|
|
320
|
-
}[];
|
|
321
|
-
};
|
|
322
307
|
}
|
|
323
308
|
//#endregion
|
|
324
309
|
//#region ../api-keys/dist/server/model.d.mts
|
package/dist/worker/index.d.cts
CHANGED
|
@@ -42,8 +42,6 @@ type BundleEventFailure = DatabaseJsonObject & {
|
|
|
42
42
|
readonly origin_code?: string;
|
|
43
43
|
readonly error_message?: string;
|
|
44
44
|
readonly error_stack?: string;
|
|
45
|
-
/** Android's `ApplicationExitInfo` reason for the process before this one. */
|
|
46
|
-
readonly previous_process_exit?: string;
|
|
47
45
|
};
|
|
48
46
|
type DatabaseHttpResponse = DatabaseJsonObject & {
|
|
49
47
|
readonly resource: "catalog" | "artifact";
|
|
@@ -66,8 +64,6 @@ type DatabaseBundleEventMetadata = DatabaseJsonObject & {
|
|
|
66
64
|
readonly delivery?: "patch" | "manifest" | "archive" | "unknown";
|
|
67
65
|
/** `UPDATE_DOWNLOADED`: a patch failed and the full files came instead. */
|
|
68
66
|
readonly patch_fallback?: boolean;
|
|
69
|
-
/** `RECOVERED`: Android's `ApplicationExitInfo` reason for the crashed process. */
|
|
70
|
-
readonly previous_process_exit?: string;
|
|
71
67
|
};
|
|
72
68
|
type BundleEventRowBase = {
|
|
73
69
|
readonly id: string;
|
|
@@ -296,17 +292,6 @@ interface InsightsUpdateFailures {
|
|
|
296
292
|
};
|
|
297
293
|
/** Over a time range: failures by stage and reason, most first. */
|
|
298
294
|
readonly breakdown?: readonly InsightsFailureBreakdown[];
|
|
299
|
-
/**
|
|
300
|
-
* Over a time range: failed launches, and the recoveries whose crashed
|
|
301
|
-
* process exited for a reason Android 11+ reported, by reason, most first.
|
|
302
|
-
*/
|
|
303
|
-
readonly recoveries?: {
|
|
304
|
-
readonly failedLaunches: number;
|
|
305
|
-
readonly byExitReason: readonly {
|
|
306
|
-
readonly exitReason: string;
|
|
307
|
-
readonly events: number;
|
|
308
|
-
}[];
|
|
309
|
-
};
|
|
310
295
|
}
|
|
311
296
|
//#endregion
|
|
312
297
|
//#region ../api-keys/dist/server/model.d.mts
|
package/dist/worker/index.d.mts
CHANGED
|
@@ -42,8 +42,6 @@ type BundleEventFailure = DatabaseJsonObject & {
|
|
|
42
42
|
readonly origin_code?: string;
|
|
43
43
|
readonly error_message?: string;
|
|
44
44
|
readonly error_stack?: string;
|
|
45
|
-
/** Android's `ApplicationExitInfo` reason for the process before this one. */
|
|
46
|
-
readonly previous_process_exit?: string;
|
|
47
45
|
};
|
|
48
46
|
type DatabaseHttpResponse = DatabaseJsonObject & {
|
|
49
47
|
readonly resource: "catalog" | "artifact";
|
|
@@ -66,8 +64,6 @@ type DatabaseBundleEventMetadata = DatabaseJsonObject & {
|
|
|
66
64
|
readonly delivery?: "patch" | "manifest" | "archive" | "unknown";
|
|
67
65
|
/** `UPDATE_DOWNLOADED`: a patch failed and the full files came instead. */
|
|
68
66
|
readonly patch_fallback?: boolean;
|
|
69
|
-
/** `RECOVERED`: Android's `ApplicationExitInfo` reason for the crashed process. */
|
|
70
|
-
readonly previous_process_exit?: string;
|
|
71
67
|
};
|
|
72
68
|
type BundleEventRowBase = {
|
|
73
69
|
readonly id: string;
|
|
@@ -296,17 +292,6 @@ interface InsightsUpdateFailures {
|
|
|
296
292
|
};
|
|
297
293
|
/** Over a time range: failures by stage and reason, most first. */
|
|
298
294
|
readonly breakdown?: readonly InsightsFailureBreakdown[];
|
|
299
|
-
/**
|
|
300
|
-
* Over a time range: failed launches, and the recoveries whose crashed
|
|
301
|
-
* process exited for a reason Android 11+ reported, by reason, most first.
|
|
302
|
-
*/
|
|
303
|
-
readonly recoveries?: {
|
|
304
|
-
readonly failedLaunches: number;
|
|
305
|
-
readonly byExitReason: readonly {
|
|
306
|
-
readonly exitReason: string;
|
|
307
|
-
readonly events: number;
|
|
308
|
-
}[];
|
|
309
|
-
};
|
|
310
295
|
}
|
|
311
296
|
//#endregion
|
|
312
297
|
//#region ../api-keys/dist/server/model.d.mts
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/cloudflare",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.34",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.mjs",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"cloudflare": "4.2.0",
|
|
57
57
|
"hono": "4.12.34",
|
|
58
58
|
"uuidv7": "^1.0.2",
|
|
59
|
-
"@hot-updater/cli-tools": "1.0.0-rc.
|
|
60
|
-
"@hot-updater/protocol": "1.0.0-rc.
|
|
61
|
-
"@hot-updater/
|
|
62
|
-
"@hot-updater/
|
|
59
|
+
"@hot-updater/cli-tools": "1.0.0-rc.34",
|
|
60
|
+
"@hot-updater/protocol": "1.0.0-rc.30",
|
|
61
|
+
"@hot-updater/plugin-core": "1.0.0-rc.30",
|
|
62
|
+
"@hot-updater/server": "1.0.0-rc.34"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@cloudflare/vitest-pool-workers": "0.13.0",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"vitest": "4.1.4",
|
|
76
76
|
"wrangler": "^4.69.0",
|
|
77
77
|
"xdg-app-paths": "^8.3.0",
|
|
78
|
-
"@hot-updater/test-utils": "1.0.0-rc.
|
|
78
|
+
"@hot-updater/test-utils": "1.0.0-rc.32"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"build": "tsdown && pnpm build:worker",
|
package/sql/bundles.sql
CHANGED
|
@@ -102,6 +102,6 @@ INSERT INTO "private_hot_updater_settings" ("key", "value", "_v") VALUES ('schem
|
|
|
102
102
|
|
|
103
103
|
INSERT INTO "private_hot_updater_settings" ("key", "value", "_v") VALUES ('schema.core', '1.0.0', 0) ON CONFLICT ("key") DO UPDATE SET "value" = excluded."value";
|
|
104
104
|
|
|
105
|
-
INSERT INTO "private_hot_updater_settings" ("key", "value", "_v") VALUES ('schema.insights', '1.
|
|
105
|
+
INSERT INTO "private_hot_updater_settings" ("key", "value", "_v") VALUES ('schema.insights', '1.0.0', 0) ON CONFLICT ("key") DO UPDATE SET "value" = excluded."value";
|
|
106
106
|
|
|
107
107
|
INSERT INTO "private_hot_updater_settings" ("key", "value", "_v") VALUES ('schema.apiKeys', '1.0.0', 0) ON CONFLICT ("key") DO UPDATE SET "value" = excluded."value";
|
package/worker/dist/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
This folder contains the built output assets for the worker "hot-updater" generated at 2026-10-
|
|
1
|
+
This folder contains the built output assets for the worker "hot-updater" generated at 2026-10-06T05:52:53.630Z.
|
package/worker/dist/index.js
CHANGED
|
@@ -4511,7 +4511,7 @@ var createSqlAdapter = /* @__PURE__ */ __name(({ executor, tablePrefix = "", max
|
|
|
4511
4511
|
}, "createSqlAdapter");
|
|
4512
4512
|
|
|
4513
4513
|
// ../../packages/server/dist/package.mjs
|
|
4514
|
-
var version = "1.0.0-rc.
|
|
4514
|
+
var version = "1.0.0-rc.34";
|
|
4515
4515
|
|
|
4516
4516
|
// ../../packages/server/dist/version.mjs
|
|
4517
4517
|
var HOT_UPDATER_SERVER_VERSION = version;
|
|
@@ -9556,8 +9556,8 @@ var apiKeys = /* @__PURE__ */ __name((options = {}) => {
|
|
|
9556
9556
|
var isOptional = /* @__PURE__ */ __name((value, key, valid) => !Object.hasOwn(value, key) || valid(value[key]), "isOptional");
|
|
9557
9557
|
var isString = /* @__PURE__ */ __name((value) => typeof value === "string", "isString");
|
|
9558
9558
|
var isDatabaseHttpResponse = /* @__PURE__ */ __name((value) => isDatabaseJsonObject(value) && (value.resource === "catalog" || value.resource === "artifact") && isString(value.path) && Number.isSafeInteger(value.status) && (value.body === null || isString(value.body)) && typeof value.body_truncated === "boolean" && Number.isSafeInteger(value.received_at_ms), "isDatabaseHttpResponse");
|
|
9559
|
-
var isDatabaseBundleEventFailure = /* @__PURE__ */ __name((value) => isDatabaseJsonObject(value) && isString(value.stage) && isString(value.reason) && isOptional(value, "resource", isString) && isOptional(value, "http_status", (status) => Number.isSafeInteger(status)) && isOptional(value, "transport", isString) && isOptional(value, "origin_code", isString) && isOptional(value, "error_message", isString) && isOptional(value, "error_stack", isString)
|
|
9560
|
-
var isDatabaseBundleEventMetadata = /* @__PURE__ */ __name((value) => isDatabaseJsonObject(value) && typeof value.cohort === "string" && (value.update_strategy === null || value.update_strategy === "fingerprint" || value.update_strategy === "appVersion") && (value.fingerprint_hash === null || typeof value.fingerprint_hash === "string") && (value.sdk_version === null || typeof value.sdk_version === "string") && isOptional(value, "failure", isDatabaseBundleEventFailure) && isOptional(value, "http_response", isDatabaseHttpResponse) && isOptional(value, "delivery", isString) && isOptional(value, "patch_fallback", (flag) => typeof flag === "boolean")
|
|
9559
|
+
var isDatabaseBundleEventFailure = /* @__PURE__ */ __name((value) => isDatabaseJsonObject(value) && isString(value.stage) && isString(value.reason) && isOptional(value, "resource", isString) && isOptional(value, "http_status", (status) => Number.isSafeInteger(status)) && isOptional(value, "transport", isString) && isOptional(value, "origin_code", isString) && isOptional(value, "error_message", isString) && isOptional(value, "error_stack", isString), "isDatabaseBundleEventFailure");
|
|
9560
|
+
var isDatabaseBundleEventMetadata = /* @__PURE__ */ __name((value) => isDatabaseJsonObject(value) && typeof value.cohort === "string" && (value.update_strategy === null || value.update_strategy === "fingerprint" || value.update_strategy === "appVersion") && (value.fingerprint_hash === null || typeof value.fingerprint_hash === "string") && (value.sdk_version === null || typeof value.sdk_version === "string") && isOptional(value, "failure", isDatabaseBundleEventFailure) && isOptional(value, "http_response", isDatabaseHttpResponse) && isOptional(value, "delivery", isString) && isOptional(value, "patch_fallback", (flag) => typeof flag === "boolean"), "isDatabaseBundleEventMetadata");
|
|
9561
9561
|
var isRecord5 = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isRecord");
|
|
9562
9562
|
var isIdentity = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length > 0 && value.length <= 255, "isIdentity");
|
|
9563
9563
|
var isTextOrNull2 = /* @__PURE__ */ __name((value) => value === null || typeof value === "string", "isTextOrNull");
|
|
@@ -9882,7 +9882,6 @@ function readFailure(value) {
|
|
|
9882
9882
|
const originCode = readCode(failure.originCode);
|
|
9883
9883
|
const errorMessage = typeof failure.errorMessage === "string" && failure.errorMessage.length <= 2048 ? failure.errorMessage : void 0;
|
|
9884
9884
|
const errorStack = typeof failure.errorStack === "string" && failure.errorStack.length <= 4096 ? failure.errorStack : void 0;
|
|
9885
|
-
const previousProcessExit = readCode(failure.previousProcessExit);
|
|
9886
9885
|
return {
|
|
9887
9886
|
stage: oneOf(STAGES, failure.stage),
|
|
9888
9887
|
reason: oneOf(REASONS, failure.reason),
|
|
@@ -9891,8 +9890,7 @@ function readFailure(value) {
|
|
|
9891
9890
|
...failure.transport == null ? {} : { transport: oneOf(TRANSPORTS, failure.transport) },
|
|
9892
9891
|
...originCode === void 0 ? {} : { originCode },
|
|
9893
9892
|
...errorMessage === void 0 ? {} : { errorMessage },
|
|
9894
|
-
...errorStack === void 0 ? {} : { errorStack }
|
|
9895
|
-
...previousProcessExit === void 0 ? {} : { previousProcessExit }
|
|
9893
|
+
...errorStack === void 0 ? {} : { errorStack }
|
|
9896
9894
|
};
|
|
9897
9895
|
}
|
|
9898
9896
|
__name(readFailure, "readFailure");
|
|
@@ -9987,21 +9985,11 @@ function requireEvent(payload) {
|
|
|
9987
9985
|
};
|
|
9988
9986
|
}
|
|
9989
9987
|
case "UPDATE_APPLIED":
|
|
9988
|
+
case "RECOVERED":
|
|
9990
9989
|
return {
|
|
9991
9990
|
...movement(),
|
|
9992
9991
|
type
|
|
9993
9992
|
};
|
|
9994
|
-
case "RECOVERED": {
|
|
9995
|
-
const previousProcessExit = readCode(metadata.previousProcessExit);
|
|
9996
|
-
return {
|
|
9997
|
-
...movement(),
|
|
9998
|
-
type,
|
|
9999
|
-
...previousProcessExit === void 0 ? {} : { metadata: {
|
|
10000
|
-
...httpMetadata,
|
|
10001
|
-
previousProcessExit
|
|
10002
|
-
} }
|
|
10003
|
-
};
|
|
10004
|
-
}
|
|
10005
9993
|
case "UPDATE_FAILED":
|
|
10006
9994
|
return {
|
|
10007
9995
|
...movement(),
|
|
@@ -10072,24 +10060,13 @@ function createBundleEventRow(input) {
|
|
|
10072
10060
|
};
|
|
10073
10061
|
}
|
|
10074
10062
|
case "UPDATE_APPLIED":
|
|
10063
|
+
case "RECOVERED":
|
|
10075
10064
|
return {
|
|
10076
10065
|
...base,
|
|
10077
10066
|
from_bundle_id: input.fromBundleId,
|
|
10078
10067
|
type: input.type,
|
|
10079
10068
|
metadata
|
|
10080
10069
|
};
|
|
10081
|
-
case "RECOVERED": {
|
|
10082
|
-
const exit = input.metadata?.previousProcessExit;
|
|
10083
|
-
return {
|
|
10084
|
-
...base,
|
|
10085
|
-
from_bundle_id: input.fromBundleId,
|
|
10086
|
-
type: input.type,
|
|
10087
|
-
metadata: {
|
|
10088
|
-
...metadata,
|
|
10089
|
-
...exit === void 0 ? {} : { previous_process_exit: exit }
|
|
10090
|
-
}
|
|
10091
|
-
};
|
|
10092
|
-
}
|
|
10093
10070
|
case "UPDATE_FAILED": {
|
|
10094
10071
|
const { failure } = input.metadata;
|
|
10095
10072
|
return {
|
|
@@ -10106,8 +10083,7 @@ function createBundleEventRow(input) {
|
|
|
10106
10083
|
...failure.resource === void 0 ? {} : { resource: failure.resource },
|
|
10107
10084
|
...failure.httpStatus === void 0 ? {} : { http_status: failure.httpStatus },
|
|
10108
10085
|
...failure.transport === void 0 ? {} : { transport: failure.transport },
|
|
10109
|
-
...failure.originCode === void 0 ? {} : { origin_code: failure.originCode }
|
|
10110
|
-
...failure.previousProcessExit === void 0 ? {} : { previous_process_exit: failure.previousProcessExit }
|
|
10086
|
+
...failure.originCode === void 0 ? {} : { origin_code: failure.originCode }
|
|
10111
10087
|
}
|
|
10112
10088
|
}
|
|
10113
10089
|
};
|
|
@@ -10273,8 +10249,7 @@ var toFailure = /* @__PURE__ */ __name((failure) => ({
|
|
|
10273
10249
|
...failure.resource === void 0 ? {} : { resource: failure.resource },
|
|
10274
10250
|
...failure.http_status === void 0 ? {} : { httpStatus: failure.http_status },
|
|
10275
10251
|
...failure.transport === void 0 ? {} : { transport: failure.transport },
|
|
10276
|
-
...failure.origin_code === void 0 ? {} : { originCode: failure.origin_code }
|
|
10277
|
-
...failure.previous_process_exit === void 0 ? {} : { previousProcessExit: failure.previous_process_exit }
|
|
10252
|
+
...failure.origin_code === void 0 ? {} : { originCode: failure.origin_code }
|
|
10278
10253
|
}), "toFailure");
|
|
10279
10254
|
var eventDetails = /* @__PURE__ */ __name(({ type, metadata }) => ({
|
|
10280
10255
|
...metadata.http_response !== void 0 ? { httpResponse: {
|
|
@@ -10287,8 +10262,7 @@ var eventDetails = /* @__PURE__ */ __name(({ type, metadata }) => ({
|
|
|
10287
10262
|
} } : {},
|
|
10288
10263
|
...type === "UPDATE_FAILED" && metadata.failure !== void 0 ? { failure: toFailure(metadata.failure) } : {},
|
|
10289
10264
|
...type === "UPDATE_DOWNLOADED" && metadata.delivery !== void 0 ? { delivery: metadata.delivery } : {},
|
|
10290
|
-
...type === "UPDATE_DOWNLOADED" && metadata.patch_fallback === true ? { patchFallback: true } : {}
|
|
10291
|
-
...type === "RECOVERED" && metadata.previous_process_exit !== void 0 ? { previousProcessExit: metadata.previous_process_exit } : {}
|
|
10265
|
+
...type === "UPDATE_DOWNLOADED" && metadata.patch_fallback === true ? { patchFallback: true } : {}
|
|
10292
10266
|
}), "eventDetails");
|
|
10293
10267
|
var toEventHistoryRow = /* @__PURE__ */ __name((row) => ({
|
|
10294
10268
|
...row.to_release_id == null ? {} : { toReleaseId: row.to_release_id },
|
|
@@ -11198,19 +11172,6 @@ var countFailure = /* @__PURE__ */ __name((tx, event) => {
|
|
|
11198
11172
|
detail: failureDetail(failure)
|
|
11199
11173
|
}, { events: 1 }, { shardBy });
|
|
11200
11174
|
}, "countFailure");
|
|
11201
|
-
var countExit = /* @__PURE__ */ __name((tx, event) => {
|
|
11202
|
-
const exit = event.metadata.previous_process_exit;
|
|
11203
|
-
if (event.type !== "RECOVERED" || exit === void 0) return;
|
|
11204
|
-
tx.aggregate("insights_failures", {
|
|
11205
|
-
platform: event.platform,
|
|
11206
|
-
channel: event.channel,
|
|
11207
|
-
bucket_start_ms: hourOf(event.received_at_ms),
|
|
11208
|
-
release_id: event.from_release_id ?? "",
|
|
11209
|
-
stage: "launch",
|
|
11210
|
-
reason: exit,
|
|
11211
|
-
detail: ""
|
|
11212
|
-
}, { events: 1 }, { shardBy: event.install_id });
|
|
11213
|
-
}, "countExit");
|
|
11214
11175
|
var isNewer = /* @__PURE__ */ __name((event, head) => event.received_at_ms !== head.received_at_ms ? event.received_at_ms > head.received_at_ms : compareUtf8(event.id, head.id) > 0, "isNewer");
|
|
11215
11176
|
var REPEATED_FIELDS = [
|
|
11216
11177
|
"channel",
|
|
@@ -11236,7 +11197,6 @@ var recordEvent = /* @__PURE__ */ __name((db, event) => {
|
|
|
11236
11197
|
return;
|
|
11237
11198
|
}
|
|
11238
11199
|
countEvent(tx, event);
|
|
11239
|
-
countExit(tx, event);
|
|
11240
11200
|
if (previous !== null && !isNewer(event, previous)) return;
|
|
11241
11201
|
if (previous === null) tx.create("bundle_event_heads", event);
|
|
11242
11202
|
else {
|
|
@@ -11669,20 +11629,16 @@ var isRange = /* @__PURE__ */ __name((range) => range === void 0 || Number.isSaf
|
|
|
11669
11629
|
var isText3 = /* @__PURE__ */ __name((value, maxLength) => typeof value === "string" && value.length > 0 && value.length <= maxLength, "isText");
|
|
11670
11630
|
var failed = /* @__PURE__ */ __name((...rows) => countDistinct(mergeDistinct(rows.flat().map((row) => row.failed_users))), "failed");
|
|
11671
11631
|
var mostFirst = /* @__PURE__ */ __name((counts) => [...counts].sort(([leftKey, left], [rightKey, right]) => right.events - left.events || compareUtf8(leftKey, rightKey)).map(([, entry]) => entry), "mostFirst");
|
|
11632
|
+
var FAILURE_STAGES = /* @__PURE__ */ new Set([
|
|
11633
|
+
"check",
|
|
11634
|
+
"download",
|
|
11635
|
+
"install",
|
|
11636
|
+
"unknown"
|
|
11637
|
+
]);
|
|
11672
11638
|
var breakdownOf = /* @__PURE__ */ __name((rows) => {
|
|
11673
11639
|
const failures = /* @__PURE__ */ new Map();
|
|
11674
|
-
const exits = /* @__PURE__ */ new Map();
|
|
11675
11640
|
for (const { stage, reason, detail, events } of rows) {
|
|
11676
11641
|
if (events <= 0) continue;
|
|
11677
|
-
if (stage === "launch") {
|
|
11678
|
-
const exit = exits.get(reason) ?? {
|
|
11679
|
-
value: reason,
|
|
11680
|
-
events: 0
|
|
11681
|
-
};
|
|
11682
|
-
exit.events += events;
|
|
11683
|
-
exits.set(reason, exit);
|
|
11684
|
-
continue;
|
|
11685
|
-
}
|
|
11686
11642
|
const key = JSON.stringify([stage, reason]);
|
|
11687
11643
|
const entry = failures.get(key) ?? {
|
|
11688
11644
|
value: {
|
|
@@ -11701,29 +11657,23 @@ var breakdownOf = /* @__PURE__ */ __name((rows) => {
|
|
|
11701
11657
|
entry.details.set(detail, known);
|
|
11702
11658
|
failures.set(key, entry);
|
|
11703
11659
|
}
|
|
11704
|
-
return {
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
|
|
11714
|
-
|
|
11715
|
-
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
}),
|
|
11722
|
-
byExitReason: mostFirst(exits).map(({ value, events }) => ({
|
|
11723
|
-
exitReason: value,
|
|
11724
|
-
events
|
|
11725
|
-
}))
|
|
11726
|
-
};
|
|
11660
|
+
return mostFirst(failures).map(({ value, events }) => {
|
|
11661
|
+
const { details } = failures.get(JSON.stringify([value.stage, value.reason]));
|
|
11662
|
+
return {
|
|
11663
|
+
...value,
|
|
11664
|
+
events,
|
|
11665
|
+
details: mostFirst(details).map(({ value: detail, events: events2 }) => {
|
|
11666
|
+
const [resource, httpStatus, originCode, transport] = JSON.parse(detail);
|
|
11667
|
+
return {
|
|
11668
|
+
resource,
|
|
11669
|
+
httpStatus,
|
|
11670
|
+
originCode,
|
|
11671
|
+
transport,
|
|
11672
|
+
events: events2
|
|
11673
|
+
};
|
|
11674
|
+
})
|
|
11675
|
+
};
|
|
11676
|
+
});
|
|
11727
11677
|
}, "breakdownOf");
|
|
11728
11678
|
var getUpdateFailures = /* @__PURE__ */ __name(async (db, input, now, retention) => {
|
|
11729
11679
|
const { platform, channel, releaseId, timeRange } = input;
|
|
@@ -11808,13 +11758,12 @@ var getUpdateFailures = /* @__PURE__ */ __name(async (db, input, now, retention)
|
|
|
11808
11758
|
}))
|
|
11809
11759
|
]);
|
|
11810
11760
|
const total = /* @__PURE__ */ __name((field) => counters2.reduce((sum, row) => sum + row[field], 0), "total");
|
|
11811
|
-
const scoped =
|
|
11761
|
+
const scoped = rows.filter((row) => FAILURE_STAGES.has(row.stage) && (releaseId === void 0 || row.release_id === releaseId));
|
|
11812
11762
|
const failuresAt = /* @__PURE__ */ __name((counted) => scoped.reduce((sum, row) => sum + (counted(row.stage) ? Math.max(0, row.events) : 0), 0), "failuresAt");
|
|
11813
|
-
const { breakdown, byExitReason } = breakdownOf(scoped);
|
|
11814
11763
|
return {
|
|
11815
11764
|
coverage: coverageOf(timeRange.start, kept.hour),
|
|
11816
11765
|
measuredAtMs: at,
|
|
11817
|
-
failedUpdates: failuresAt((stage) => stage !== "check"
|
|
11766
|
+
failedUpdates: failuresAt((stage) => stage !== "check"),
|
|
11818
11767
|
failedInstallations: failed(failures),
|
|
11819
11768
|
downloads: total("downloads"),
|
|
11820
11769
|
patchDownloads: total("patch_downloads"),
|
|
@@ -11824,11 +11773,7 @@ var getUpdateFailures = /* @__PURE__ */ __name(async (db, input, now, retention)
|
|
|
11824
11773
|
failedInstallations: failed(checks),
|
|
11825
11774
|
activeInstallations: countDistinct(mergeDistinct(active.map((row) => row.activity_users)))
|
|
11826
11775
|
} } : {},
|
|
11827
|
-
breakdown
|
|
11828
|
-
recoveries: {
|
|
11829
|
-
failedLaunches: total("failed_launches"),
|
|
11830
|
-
byExitReason
|
|
11831
|
-
}
|
|
11776
|
+
breakdown: breakdownOf(scoped)
|
|
11832
11777
|
};
|
|
11833
11778
|
}, "getUpdateFailures");
|
|
11834
11779
|
|
|
@@ -12077,7 +12022,7 @@ var insights = /* @__PURE__ */ __name((options = {}) => {
|
|
|
12077
12022
|
const plugin = definePlugin({
|
|
12078
12023
|
id: "insights",
|
|
12079
12024
|
namespace: false,
|
|
12080
|
-
schemaVersion: "1.
|
|
12025
|
+
schemaVersion: "1.0.0",
|
|
12081
12026
|
schema: createInsightsSchema(retention),
|
|
12082
12027
|
init: /* @__PURE__ */ __name(({ db, now }) => {
|
|
12083
12028
|
const api = createInsightsApi(db, now, retention);
|