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

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.37";
4527
+ const HOT_UPDATER_SERVER_VERSION = "1.0.0-rc.38";
4528
4528
  //#endregion
4529
4529
  //#region ../../packages/server/dist/handlerVersionRoutes.mjs
4530
4530
  /**
@@ -9596,19 +9596,25 @@ const minBundleIdOf = (row) => row.metadata?.min_bundle_id;
9596
9596
  /** When the client made a report, from the UUIDv7 it gave it. */
9597
9597
  const madeAt = (id) => isUUIDv7(id) ? extractTimestampFromUUIDv7(id) : null;
9598
9598
  /**
9599
- * A report that arrived after its installation moved past it: a download or
9600
- * an apply of the bundle the head already runs, or an UNCHANGED report of the
9601
- * bundle an apply head left, made before that apply. A reload can cut one
9602
- * runtime's report short and deliver it after the next runtime's. It stays
9603
- * in history but moves and counts nothing.
9599
+ * A report its installation already moved past, which stays in history but
9600
+ * moves and counts nothing:
9601
+ * - a download or an apply of the bundle the head already runs, or a
9602
+ * download that repeats the head's pending one, from the same bundle to
9603
+ * the same bundle: the installation's download or launch already counted;
9604
+ * - an UNCHANGED report made, by its UUIDv7, before the head's report, even
9605
+ * after a later report replaced the apply it preceded: a reload can cut
9606
+ * one runtime's report short and deliver it after the next runtime's.
9607
+ *
9608
+ * Report IDs are made on the device, so a device whose clock jumps back has
9609
+ * its launch reports judged late until its clock passes its latest report.
9604
9610
  */
9605
9611
  const isLate = (event, head) => {
9606
9612
  if (head === null) return false;
9607
- if (event.type === "UPDATE_DOWNLOADED" || event.type === "UPDATE_APPLIED") return event.to_bundle_id === runningOf(head).bundle_id;
9608
- if (event.type === "UNCHANGED" && head.type === "UPDATE_APPLIED" && event.to_bundle_id === head.from_bundle_id) {
9613
+ if (event.type === "UPDATE_DOWNLOADED" || event.type === "UPDATE_APPLIED") return event.to_bundle_id === runningOf(head).bundle_id || event.type === "UPDATE_DOWNLOADED" && head.type === "UPDATE_DOWNLOADED" && event.from_bundle_id === head.from_bundle_id && event.to_bundle_id === head.to_bundle_id;
9614
+ if (event.type === "UNCHANGED") {
9609
9615
  const made = madeAt(event.id);
9610
- const applied = madeAt(head.id);
9611
- return made !== null && applied !== null && made < applied;
9616
+ const latest = madeAt(head.id);
9617
+ return made !== null && latest !== null && made < latest;
9612
9618
  }
9613
9619
  return false;
9614
9620
  };
package/dist/index.d.cts CHANGED
@@ -99,9 +99,10 @@ type DatabaseBundleEventMetadata = DatabaseJsonObject & {
99
99
  /** A kept `UNCHANGED` row: what it changed, which the server sets. */
100
100
  readonly change?: BundleEventChange;
101
101
  /**
102
- * A download or apply that arrived after its installation already ran its
103
- * target, as when a reload cut the first runtime's report short: the
104
- * server keeps it in history, but it moves and counts nothing.
102
+ * A download or apply of a target its installation already ran, as when
103
+ * a reload cut the first runtime's report short, or a download that
104
+ * repeats the pending one: the server keeps it in history, but it moves
105
+ * and counts nothing.
105
106
  */
106
107
  readonly late?: true;
107
108
  /**
package/dist/index.d.mts CHANGED
@@ -99,9 +99,10 @@ type DatabaseBundleEventMetadata = DatabaseJsonObject & {
99
99
  /** A kept `UNCHANGED` row: what it changed, which the server sets. */
100
100
  readonly change?: BundleEventChange;
101
101
  /**
102
- * A download or apply that arrived after its installation already ran its
103
- * target, as when a reload cut the first runtime's report short: the
104
- * server keeps it in history, but it moves and counts nothing.
102
+ * A download or apply of a target its installation already ran, as when
103
+ * a reload cut the first runtime's report short, or a download that
104
+ * repeats the pending one: the server keeps it in history, but it moves
105
+ * and counts nothing.
105
106
  */
106
107
  readonly late?: true;
107
108
  /**
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.37",
4
+ "version": "1.0.0-rc.38",
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.37",
41
- "@hot-updater/protocol": "1.0.0-rc.37",
42
- "@hot-updater/plugin-core": "1.0.0-rc.37",
43
- "@hot-updater/server": "1.0.0-rc.37"
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"
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.37",
59
- "@hot-updater/test-utils": "1.0.0-rc.37"
58
+ "@hot-updater/mock": "1.0.0-rc.38",
59
+ "@hot-updater/test-utils": "1.0.0-rc.38"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "firebase-admin": "*",