@hot-updater/plugin-insights 1.0.0-rc.46 → 1.0.0

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.
@@ -218,7 +218,6 @@ const setUpInsights = (options, pluginContext) => {
218
218
  return;
219
219
  }
220
220
  if (event.failureKey !== null) state.recordFailure(event.day, event.failureKey);
221
- if (delivery === "refused") return;
222
221
  state.resume();
223
222
  if (event.report !== null) state.recordReport(event.report);
224
223
  else state.forgetReport();
@@ -217,7 +217,6 @@ const setUpInsights = (options, pluginContext) => {
217
217
  return;
218
218
  }
219
219
  if (event.failureKey !== null) state.recordFailure(event.day, event.failureKey);
220
- if (delivery === "refused") return;
221
220
  state.resume();
222
221
  if (event.report !== null) state.recordReport(event.report);
223
222
  else state.forgetReport();
@@ -27,7 +27,6 @@ const postInsightsEvent = async (fetch, event) => {
27
27
  });
28
28
  if (response.status === 204) return "delivered";
29
29
  if (response.status === 404) return "disabled";
30
- if (response.status === 400 && event.type === "UPDATE_FAILED") return "refused";
31
30
  return {
32
31
  error: /* @__PURE__ */ new Error(`Expected HTTP 204 from /events, received ${response.status}`),
33
32
  retryable: response.status === 429 || response.status >= 500,
@@ -27,7 +27,6 @@ const postInsightsEvent = async (fetch, event) => {
27
27
  });
28
28
  if (response.status === 204) return "delivered";
29
29
  if (response.status === 404) return "disabled";
30
- if (response.status === 400 && event.type === "UPDATE_FAILED") return "refused";
31
30
  return {
32
31
  error: /* @__PURE__ */ new Error(`Expected HTTP 204 from /events, received ${response.status}`),
33
32
  retryable: response.status === 429 || response.status >= 500,
@@ -88,7 +88,7 @@ const createInsightsState = (storage) => {
88
88
  forgetReport() {
89
89
  if (read("report") !== null) write("report", null);
90
90
  },
91
- /** Whether a failure was already reported, or refused, that day. */
91
+ /** Whether a failure was already reported that day. */
92
92
  hasFailure(day, key) {
93
93
  const failures = parseFailures(read("failures"));
94
94
  return failures?.day === day && failures.keys.includes(key);
@@ -88,7 +88,7 @@ const createInsightsState = (storage) => {
88
88
  forgetReport() {
89
89
  if (read("report") !== null) write("report", null);
90
90
  },
91
- /** Whether a failure was already reported, or refused, that day. */
91
+ /** Whether a failure was already reported that day. */
92
92
  hasFailure(day, key) {
93
93
  const failures = parseFailures(read("failures"));
94
94
  return failures?.day === day && failures.keys.includes(key);
@@ -47,7 +47,7 @@ type CreateBundleEventRequestBase = {
47
47
  /**
48
48
  * The bundle ID the native build ships as its built-in bundle. A report
49
49
  * whose running bundle is this one, with no Release, runs the built-in
50
- * bundle. Older SDKs leave it out.
50
+ * bundle.
51
51
  */
52
52
  readonly minBundleId?: string | null;
53
53
  readonly fromReleaseId: string | null;
@@ -47,7 +47,7 @@ type CreateBundleEventRequestBase = {
47
47
  /**
48
48
  * The bundle ID the native build ships as its built-in bundle. A report
49
49
  * whose running bundle is this one, with no Release, runs the built-in
50
- * bundle. Older SDKs leave it out.
50
+ * bundle.
51
51
  */
52
52
  readonly minBundleId?: string | null;
53
53
  readonly fromReleaseId: string | null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/plugin-insights",
3
3
  "type": "module",
4
- "version": "1.0.0-rc.46",
4
+ "version": "1.0.0",
5
5
  "description": "Hot Updater's Insights plugin: launch, download, and update failure events, for the server and the React Native app",
6
6
  "exports": {
7
7
  "./client": {
@@ -33,10 +33,10 @@
33
33
  "package.json"
34
34
  ],
35
35
  "dependencies": {
36
- "@hot-updater/protocol": "1.0.0-rc.46"
36
+ "@hot-updater/protocol": "1.0.0"
37
37
  },
38
38
  "peerDependencies": {
39
- "@hot-updater/plugin-core": "^1.0.0-rc.46"
39
+ "@hot-updater/plugin-core": "^1.0.0"
40
40
  },
41
41
  "peerDependenciesMeta": {
42
42
  "@hot-updater/plugin-core": {
@@ -46,8 +46,8 @@
46
46
  "devDependencies": {
47
47
  "@types/node": "^20",
48
48
  "vitest": "4.1.4",
49
- "@hot-updater/plugin-core": "1.0.0-rc.46",
50
- "@hot-updater/test-utils": "1.0.0-rc.46"
49
+ "@hot-updater/plugin-core": "1.0.0",
50
+ "@hot-updater/test-utils": "1.0.0"
51
51
  },
52
52
  "nx": {
53
53
  "implicitDependencies": [