@hot-updater/firebase 1.0.0-rc.38 → 1.0.0-rc.39

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.
@@ -4524,7 +4524,7 @@ const createKvAdapter = ({ store, tablePrefix = "" }) => {
4524
4524
  };
4525
4525
  //#endregion
4526
4526
  //#region ../../packages/server/dist/version.mjs
4527
- const HOT_UPDATER_SERVER_VERSION = "1.0.0-rc.38";
4527
+ const HOT_UPDATER_SERVER_VERSION = "1.0.0-rc.39";
4528
4528
  //#endregion
4529
4529
  //#region ../../packages/server/dist/handlerVersionRoutes.mjs
4530
4530
  /**
@@ -9471,17 +9471,25 @@ const countEvent = (tx, event) => {
9471
9471
  };
9472
9472
  /**
9473
9473
  * A stored event's outcome rows: its bundle filter's hour, when it has one
9474
- * (`bundleRefsOf`), and every stored event's UTC day.
9474
+ * (`bundleRefsOf`), and every stored event's UTC day. A download that a
9475
+ * launch or crash implied counts in its bundle's download hour too, in the
9476
+ * hour of that launch or crash, so the download series covers what the
9477
+ * release's downloads count; the launch or crash is its row.
9475
9478
  */
9476
9479
  const countOutcome = (tx, event) => {
9477
9480
  const shardBy = event.install_id;
9478
- for (const bundleRef of bundleRefsOf(event)) tx.aggregate("insights_outcomes", {
9481
+ const hour = (type, bundleRef) => tx.aggregate("insights_outcomes", {
9479
9482
  platform: event.platform,
9480
9483
  channel: event.channel,
9481
- type: event.type,
9484
+ type,
9482
9485
  bundle_ref: bundleRef,
9483
9486
  bucket_start_ms: hourOf(event.received_at_ms)
9484
9487
  }, { events: 1 }, { shardBy });
9488
+ for (const bundleRef of bundleRefsOf(event)) hour(event.type, bundleRef);
9489
+ if (event.metadata.implied_download === true) hour("UPDATE_DOWNLOADED", bundleRefOfFilter({
9490
+ type: "UPDATE_DOWNLOADED",
9491
+ toBundleId: event.type === "RECOVERED" ? event.from_bundle_id : event.to_bundle_id
9492
+ }));
9485
9493
  tx.aggregate("insights_outcomes", {
9486
9494
  ...DAILY_EVENTS,
9487
9495
  bucket_start_ms: dayOf(event.received_at_ms)
@@ -9914,7 +9922,11 @@ const countRaw = async (db, filter, from, to) => {
9914
9922
  }
9915
9923
  return total;
9916
9924
  };
9917
- /** Whole hours from outcome counters; the partial hours at either edge from raw events. */
9925
+ /**
9926
+ * Whole hours from outcome counters; the partial hours at either edge from
9927
+ * raw events. A download filter's whole hours count the downloads a launch
9928
+ * or crash implied too, which its raw events do not hold.
9929
+ */
9918
9930
  const countEvents = async (db, input) => {
9919
9931
  const { filter, sinceMs, beforeReceivedAtMs } = input;
9920
9932
  const start = hourCeil(sinceMs);
@@ -9933,8 +9945,9 @@ const countEvents = async (db, input) => {
9933
9945
  return await countRaw(db, filter, sinceMs, start) + hours.reduce((sum, row) => sum + row.events, 0) + await countRaw(db, filter, end, beforeReceivedAtMs);
9934
9946
  };
9935
9947
  /**
9936
- * A bundle filter's stored events in each interval of whole hours: one read
9937
- * of its hourly counts, every interval present.
9948
+ * A bundle filter's stored events in each interval of whole hours, and for a
9949
+ * download filter the downloads a launch or crash implied: one read of its
9950
+ * hourly counts, every interval present.
9938
9951
  */
9939
9952
  const countEventSeries = async (db, input) => {
9940
9953
  const { filter, intervalMs } = input;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/firebase",
3
3
  "type": "module",
4
- "version": "1.0.0-rc.38",
4
+ "version": "1.0.0-rc.39",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "main": "dist/index.cjs",
7
7
  "types": "dist/index.d.cts",
@@ -37,10 +37,10 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "hono": "4.12.34",
40
- "@hot-updater/cli-tools": "1.0.0-rc.38",
41
- "@hot-updater/protocol": "1.0.0-rc.38",
42
- "@hot-updater/plugin-core": "1.0.0-rc.38",
43
- "@hot-updater/server": "1.0.0-rc.38"
40
+ "@hot-updater/protocol": "1.0.0-rc.39",
41
+ "@hot-updater/plugin-core": "1.0.0-rc.39",
42
+ "@hot-updater/server": "1.0.0-rc.39",
43
+ "@hot-updater/cli-tools": "1.0.0-rc.39"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public"
@@ -55,8 +55,8 @@
55
55
  "firebase-tools": "15.29.0",
56
56
  "fkill": "^9.0.0",
57
57
  "mime": "^4.0.4",
58
- "@hot-updater/mock": "1.0.0-rc.38",
59
- "@hot-updater/test-utils": "1.0.0-rc.38"
58
+ "@hot-updater/test-utils": "1.0.0-rc.39",
59
+ "@hot-updater/mock": "1.0.0-rc.39"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "firebase-admin": "*",