@onekeyfe/hd-core 1.1.21-alpha.0 → 1.1.21-alpha.1

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.
@@ -16,7 +16,6 @@ export default class FirmwareUpdateV3 extends FirmwareUpdateBaseMethod<FirmwareU
16
16
  private prepareFirmwareAndBleBinary;
17
17
  private executeUpdate;
18
18
  private extractUpdateModeProgress;
19
- private shouldSkipReconnect;
20
19
  private normalizeErrorMessage;
21
20
  waitForDeviceReconnect(timeout: number): Promise<void>;
22
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FirmwareUpdateV3.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV3.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAG/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAiB,MAAM,qBAAqB,CAAC;AAKnE,eAAO,MAAM,gCAAgC,UAAU,CAAC;AAaxD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,wBAAwB,CAAC,sBAAsB,CAAC;IAC5F,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAE1C,IAAI;IAmCE,GAAG;;;;;IA8CT,OAAO,CAAC,wBAAwB;YAiBlB,qBAAqB;YAoBrB,uBAAuB;YAiBvB,2BAA2B;YAiD3B,aAAa;IA+K3B,OAAO,CAAC,yBAAyB;IAgBjC,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,qBAAqB;IAuBvB,sBAAsB,CAAC,OAAO,EAAE,MAAM;CAoD7C"}
1
+ {"version":3,"file":"FirmwareUpdateV3.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV3.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAG/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAiB,MAAM,qBAAqB,CAAC;AAKnE,eAAO,MAAM,gCAAgC,UAAU,CAAC;AAaxD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,wBAAwB,CAAC,sBAAsB,CAAC;IAC5F,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAE1C,IAAI;IAmCE,GAAG;;;;;IA8CT,OAAO,CAAC,wBAAwB;YAiBlB,qBAAqB;YAoBrB,uBAAuB;YAiBvB,2BAA2B;YAiD3B,aAAa;IA6K3B,OAAO,CAAC,yBAAyB;IAajC,OAAO,CAAC,qBAAqB;IAuBvB,sBAAsB,CAAC,OAAO,EAAE,MAAM;CAoD7C"}
package/dist/index.js CHANGED
@@ -30539,13 +30539,11 @@ class FirmwareUpdateV3 extends FirmwareUpdateBaseMethod {
30539
30539
  }
30540
30540
  else {
30541
30541
  yield hdShared.wait(1000);
30542
- if (!this.shouldSkipReconnect(error)) {
30543
- const reconnectTimeout = this.isBleReconnect() && (this.params.bleBinary || this.params.bleVersion)
30544
- ? 3 * 60 * 1000
30545
- : 60 * 1000;
30546
- yield this.ensureWebUsbBootloaderReauthPrompt();
30547
- yield this.waitForDeviceReconnect(reconnectTimeout);
30548
- }
30542
+ const reconnectTimeout = this.isBleReconnect() && (this.params.bleBinary || this.params.bleVersion)
30543
+ ? 3 * 60 * 1000
30544
+ : 60 * 1000;
30545
+ yield this.ensureWebUsbBootloaderReauthPrompt();
30546
+ yield this.waitForDeviceReconnect(reconnectTimeout);
30549
30547
  }
30550
30548
  }
30551
30549
  }
@@ -30563,21 +30561,6 @@ class FirmwareUpdateV3 extends FirmwareUpdateBaseMethod {
30563
30561
  const progress = parseInt(match[1], 10);
30564
30562
  return Number.isNaN(progress) ? null : progress;
30565
30563
  }
30566
- shouldSkipReconnect(error) {
30567
- const message = this.normalizeErrorMessage(error);
30568
- if (!message) {
30569
- return false;
30570
- }
30571
- const normalized = message.toLowerCase();
30572
- const transientKeywords = [
30573
- 'operation was cancelled',
30574
- 'force clean bluetooth run promise',
30575
- 'getfeatures timeout',
30576
- 'timeout after 3 seconds',
30577
- 'transport cancel',
30578
- ];
30579
- return transientKeywords.some(keyword => normalized.includes(keyword));
30580
- }
30581
30564
  normalizeErrorMessage(error) {
30582
30565
  if (!error) {
30583
30566
  return '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "1.1.21-alpha.0",
3
+ "version": "1.1.21-alpha.1",
4
4
  "description": "Core processes and APIs for communicating with OneKey hardware devices.",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -25,8 +25,8 @@
25
25
  "url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
26
26
  },
27
27
  "dependencies": {
28
- "@onekeyfe/hd-shared": "1.1.21-alpha.0",
29
- "@onekeyfe/hd-transport": "1.1.21-alpha.0",
28
+ "@onekeyfe/hd-shared": "1.1.21-alpha.1",
29
+ "@onekeyfe/hd-transport": "1.1.21-alpha.1",
30
30
  "axios": "1.12.2",
31
31
  "bignumber.js": "^9.0.2",
32
32
  "bytebuffer": "^5.0.1",
@@ -44,5 +44,5 @@
44
44
  "@types/w3c-web-usb": "^1.0.10",
45
45
  "@types/web-bluetooth": "^0.0.21"
46
46
  },
47
- "gitHead": "07cd6d68356b267de165368bba5168ae319ff5fa"
47
+ "gitHead": "933dbbcf45753b685ba7f76500158de42b68215b"
48
48
  }
@@ -377,20 +377,18 @@ export default class FirmwareUpdateV3 extends FirmwareUpdateBaseMethod<FirmwareU
377
377
  await wait(1000);
378
378
  } else {
379
379
  await wait(1000);
380
- if (!this.shouldSkipReconnect(error)) {
381
- /**
382
- * Needs second reconnect case:
383
- * 1. While including 'Ble firmwware' in ble connect type
384
- * 2. While including bootloader upgrade
385
- */
386
- const reconnectTimeout =
387
- this.isBleReconnect() && (this.params.bleBinary || this.params.bleVersion)
388
- ? 3 * 60 * 1000 // 3 minutes for BLE reconnect
389
- : 60 * 1000; // 1 minute for normal reconnect
390
-
391
- await this.ensureWebUsbBootloaderReauthPrompt();
392
- await this.waitForDeviceReconnect(reconnectTimeout);
393
- }
380
+ /**
381
+ * Needs second reconnect case:
382
+ * 1. While including 'Ble firmwware' in ble connect type
383
+ * 2. While including bootloader upgrade
384
+ */
385
+ const reconnectTimeout =
386
+ this.isBleReconnect() && (this.params.bleBinary || this.params.bleVersion)
387
+ ? 3 * 60 * 1000 // 3 minutes for BLE reconnect
388
+ : 60 * 1000; // 1 minute for normal reconnect
389
+
390
+ await this.ensureWebUsbBootloaderReauthPrompt();
391
+ await this.waitForDeviceReconnect(reconnectTimeout);
394
392
  }
395
393
  }
396
394
  }
@@ -412,25 +410,6 @@ export default class FirmwareUpdateV3 extends FirmwareUpdateBaseMethod<FirmwareU
412
410
  return Number.isNaN(progress) ? null : progress;
413
411
  }
414
412
 
415
- /**
416
- * Check whether the error is a transient BLE reconnect/timeout hint (e.g., force clean/cancel).
417
- */
418
- private shouldSkipReconnect(error: unknown): boolean {
419
- const message = this.normalizeErrorMessage(error);
420
- if (!message) {
421
- return false;
422
- }
423
- const normalized = message.toLowerCase();
424
- const transientKeywords = [
425
- 'operation was cancelled',
426
- 'force clean bluetooth run promise',
427
- 'getfeatures timeout',
428
- 'timeout after 3 seconds',
429
- 'transport cancel',
430
- ];
431
- return transientKeywords.some(keyword => normalized.includes(keyword));
432
- }
433
-
434
413
  private normalizeErrorMessage(error: unknown): string {
435
414
  if (!error) {
436
415
  return '';