@onekeyfe/hd-transport-react-native 1.2.0-alpha.145 → 1.2.0-alpha.146

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.ts CHANGED
@@ -123,8 +123,6 @@ declare class ReactNativeBleTransport {
123
123
  private sessionProtocols;
124
124
  /** Endpoints that answered a V2 probe in this transport lifetime. Survives disconnect. */
125
125
  private confirmedProtocolV2;
126
- /** First expected-V2 miss for an unconfirmed endpoint; the next miss is a stale bond. */
127
- private retryableV2Mismatch;
128
126
  /** Consecutive detections that failed while trusting sessionProtocols. */
129
127
  private protocolReprobeFailures;
130
128
  private protocolV2Assemblers;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAIL,UAAU,IAAI,aAAa,EAG5B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,SAAS,EAAE,EAChB,KAAK,oBAAoB,EAIzB,KAAK,YAAY,EAKjB,KAAK,oBAAoB,EAI1B,MAAM,wBAAwB,CAAC;AA0BhC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAI1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgBjE,KAAK,4BAA4B,GAAG,WAAW,CAAC;AAChD,KAAK,0BAA0B,GAAG;IAChC,mBAAmB,EAAE,cAAc,CAAC;IACpC,oBAAoB,EAAE,cAAc,CAAC;CACtC,CAAC;AAkCF,eAAO,MAAM,+BAA+B,UACnC,OAAO,KACb,4BAA4B,GAAG,IAsBjC,CAAC;AAcF,eAAO,MAAM,2BAA2B,QAAS,CA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AAO,CAAC,wBAAwB;IAgChC,OAAO,CAAC,kBAAkB;YAcZ,cAAc;IA8C5B,OAAO,CAAC,kBAAkB;IA6B1B,OAAO,CAAC,eAAe;IAmDvB,OAAO,CAAC,2BAA2B;IAUnC,OAAO,CAAC,4BAA4B;IAOpC,OAAO,CAAC,kBAAkB;IAU1B,OAAO,CAAC,iBAAiB;YAIX,cAAc;YA0Gd,iCAAiC;YAoDjC,eAAe;YAwBf,eAAe;IA0B7B,OAAO,CAAC,4BAA4B;IA2BpC,OAAO,CAAC,uBAAuB;IAS/B,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,sBAAsB;YAShB,mBAAmB;YAiBnB,qBAAqB;YA2DrB,oBAAoB;YAgCpB,cAAc;YAqEd,iCAAiC;IAiB/C,OAAO,CAAC,8BAA8B;YAQxB,mCAAmC;IAsBjD,OAAO,CAAC,yCAAyC;YAanC,gCAAgC;IAoB9C,OAAO,CAAC,uBAAuB;IAmD/B,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;CAGxD"}
package/dist/index.js CHANGED
@@ -402,7 +402,6 @@ class ReactNativeBleTransport {
402
402
  this.deviceProtocolHints = new Map();
403
403
  this.sessionProtocols = new Map();
404
404
  this.confirmedProtocolV2 = new Set();
405
- this.retryableV2Mismatch = new Set();
406
405
  this.protocolReprobeFailures = new Map();
407
406
  this.protocolV2Assemblers = new Map();
408
407
  this.protocolV2FrameQueues = new Map();
@@ -1659,7 +1658,6 @@ class ReactNativeBleTransport {
1659
1658
  this.probingProtocols.clear();
1660
1659
  this.sessionProtocols.clear();
1661
1660
  this.confirmedProtocolV2.clear();
1662
- this.retryableV2Mismatch.clear();
1663
1661
  this.protocolReprobeFailures.clear();
1664
1662
  this.writeTimeoutCounts.clear();
1665
1663
  this.connectionSetupTimeoutCounts.clear();
@@ -1673,14 +1671,7 @@ class ReactNativeBleTransport {
1673
1671
  }
1674
1672
  }
1675
1673
  createProtocolMismatchError(expected, uuid) {
1676
- const isStaleV2Bond = expected === 'V2' &&
1677
- (this.confirmedProtocolV2.has(uuid) || this.retryableV2Mismatch.has(uuid));
1678
- if (expected === 'V2' && !isStaleV2Bond) {
1679
- this.retryableV2Mismatch.add(uuid);
1680
- }
1681
- else if (isStaleV2Bond) {
1682
- this.retryableV2Mismatch.delete(uuid);
1683
- }
1674
+ const isStaleV2Bond = expected === 'V2' && this.confirmedProtocolV2.has(uuid);
1684
1675
  return hdShared.ERRORS.TypedError(isStaleV2Bond ? hdShared.HardwareErrorCode.BleDeviceBondError : hdShared.HardwareErrorCode.RuntimeError, `Device protocol mismatch: expected ${expected}, but device did not respond to expected protocol`);
1685
1676
  }
1686
1677
  createProtocolDetectionError() {
@@ -1728,7 +1719,6 @@ class ReactNativeBleTransport {
1728
1719
  this.deviceProtocol.set(uuid, 'V2');
1729
1720
  this.sessionProtocols.set(uuid, 'V2');
1730
1721
  this.confirmedProtocolV2.add(uuid);
1731
- this.retryableV2Mismatch.delete(uuid);
1732
1722
  Log === null || Log === void 0 ? void 0 : Log.debug('[ReactNativeBleTransport] protocol detected', {
1733
1723
  deviceId: uuid,
1734
1724
  protocol: 'V2',
@@ -1762,7 +1752,6 @@ class ReactNativeBleTransport {
1762
1752
  this.sessionProtocols.set(uuid, protocol);
1763
1753
  if (protocol === 'V2') {
1764
1754
  this.confirmedProtocolV2.add(uuid);
1765
- this.retryableV2Mismatch.delete(uuid);
1766
1755
  }
1767
1756
  this.protocolReprobeFailures.delete(uuid);
1768
1757
  Log === null || Log === void 0 ? void 0 : Log.debug('[ReactNativeBleTransport] protocol detected', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-transport-react-native",
3
- "version": "1.2.0-alpha.145",
3
+ "version": "1.2.0-alpha.146",
4
4
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -20,11 +20,11 @@
20
20
  "lint:fix": "eslint . --fix"
21
21
  },
22
22
  "dependencies": {
23
- "@onekeyfe/hd-core": "1.2.0-alpha.145",
24
- "@onekeyfe/hd-shared": "1.2.0-alpha.145",
25
- "@onekeyfe/hd-transport": "1.2.0-alpha.145",
23
+ "@onekeyfe/hd-core": "1.2.0-alpha.146",
24
+ "@onekeyfe/hd-shared": "1.2.0-alpha.146",
25
+ "@onekeyfe/hd-transport": "1.2.0-alpha.146",
26
26
  "@onekeyfe/react-native-ble-utils": "^0.1.6",
27
27
  "react-native-ble-plx": "3.5.1"
28
28
  },
29
- "gitHead": "9a136f881865c15e603ef271ae820c2b5a991dcc"
29
+ "gitHead": "447f0806b061695326a6dcba63d8c228b871d01a"
30
30
  }
@@ -441,7 +441,7 @@ describe('ReactNativeBleTransport Protocol V2 link lifecycle', () => {
441
441
  );
442
442
 
443
443
  test.each(['ios', 'android'] as const)(
444
- 'reports a stale bond on %s after a second expected Protocol V2 probe miss',
444
+ 'keeps a second expected Protocol V2 probe miss retryable on %s',
445
445
  async platform => {
446
446
  setPlatformOS(platform);
447
447
  const { transport, uuid, device } = createHarness();
@@ -451,10 +451,10 @@ describe('ReactNativeBleTransport Protocol V2 link lifecycle', () => {
451
451
  errorCode: HardwareErrorCode.RuntimeError,
452
452
  });
453
453
  await expect(transport.acquire({ uuid, expectedProtocol: 'V2' })).rejects.toMatchObject({
454
- errorCode: HardwareErrorCode.BleDeviceBondError,
454
+ errorCode: HardwareErrorCode.RuntimeError,
455
455
  });
456
456
 
457
- expect(device.cancelConnection).toHaveBeenCalledTimes(1);
457
+ expect(device.cancelConnection).not.toHaveBeenCalled();
458
458
  expect(transport.getProtocolType(uuid)).toBeUndefined();
459
459
  }
460
460
  );
package/src/index.ts CHANGED
@@ -380,9 +380,6 @@ export default class ReactNativeBleTransport {
380
380
  /** Endpoints that answered a V2 probe in this transport lifetime. Survives disconnect. */
381
381
  private confirmedProtocolV2 = new Set<string>();
382
382
 
383
- /** First expected-V2 miss for an unconfirmed endpoint; the next miss is a stale bond. */
384
- private retryableV2Mismatch = new Set<string>();
385
-
386
383
  /** Consecutive detections that failed while trusting sessionProtocols. */
387
384
  private protocolReprobeFailures: Map<string, number> = new Map();
388
385
 
@@ -1966,7 +1963,6 @@ export default class ReactNativeBleTransport {
1966
1963
  this.probingProtocols.clear();
1967
1964
  this.sessionProtocols.clear();
1968
1965
  this.confirmedProtocolV2.clear();
1969
- this.retryableV2Mismatch.clear();
1970
1966
  this.protocolReprobeFailures.clear();
1971
1967
  this.writeTimeoutCounts.clear();
1972
1968
  this.connectionSetupTimeoutCounts.clear();
@@ -1980,17 +1976,9 @@ export default class ReactNativeBleTransport {
1980
1976
  }
1981
1977
 
1982
1978
  private createProtocolMismatchError(expected: ProtocolType, uuid: string) {
1983
- // Caller `expectedProtocol: 'V2'` is not proof this endpoint already answered.
1984
- // A first-connect or flaky Ping must stay retryable. A later miss after a
1985
- // confirmed V2 answer, or a second miss on the same uuid, is a stale bond.
1986
- const isStaleV2Bond =
1987
- expected === 'V2' &&
1988
- (this.confirmedProtocolV2.has(uuid) || this.retryableV2Mismatch.has(uuid));
1989
- if (expected === 'V2' && !isStaleV2Bond) {
1990
- this.retryableV2Mismatch.add(uuid);
1991
- } else if (isStaleV2Bond) {
1992
- this.retryableV2Mismatch.delete(uuid);
1993
- }
1979
+ // A generic Ping miss is not a bond failure. Only a later miss after this
1980
+ // endpoint already answered V2, or a native encryption/pairing error, is.
1981
+ const isStaleV2Bond = expected === 'V2' && this.confirmedProtocolV2.has(uuid);
1994
1982
  return ERRORS.TypedError(
1995
1983
  isStaleV2Bond ? HardwareErrorCode.BleDeviceBondError : HardwareErrorCode.RuntimeError,
1996
1984
  `Device protocol mismatch: expected ${expected}, but device did not respond to expected protocol`
@@ -2056,7 +2044,6 @@ export default class ReactNativeBleTransport {
2056
2044
  this.deviceProtocol.set(uuid, 'V2');
2057
2045
  this.sessionProtocols.set(uuid, 'V2');
2058
2046
  this.confirmedProtocolV2.add(uuid);
2059
- this.retryableV2Mismatch.delete(uuid);
2060
2047
  Log?.debug('[ReactNativeBleTransport] protocol detected', {
2061
2048
  deviceId: uuid,
2062
2049
  protocol: 'V2',
@@ -2101,7 +2088,6 @@ export default class ReactNativeBleTransport {
2101
2088
  this.sessionProtocols.set(uuid, protocol);
2102
2089
  if (protocol === 'V2') {
2103
2090
  this.confirmedProtocolV2.add(uuid);
2104
- this.retryableV2Mismatch.delete(uuid);
2105
2091
  }
2106
2092
  this.protocolReprobeFailures.delete(uuid);
2107
2093
  Log?.debug('[ReactNativeBleTransport] protocol detected', {