@onekeyfe/hd-transport-react-native 1.2.0-alpha.26 → 1.2.0-alpha.27

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.js CHANGED
@@ -298,7 +298,7 @@ const getFirmwareUploadWriteRetryType = (error) => {
298
298
  const resolveFirmwareUploadRetryDelay = (attempt, baseDelayMs = 200, maxDelayMs = 1200) => Math.min(baseDelayMs * Math.pow(2, attempt), maxDelayMs);
299
299
  const PROTOCOL_PROBE_TIMEOUT_MS = 1000;
300
300
  const PROTOCOL_V2_PROBE_TIMEOUT_MS = 10000;
301
- const DEVICE_SCAN_TIMEOUT_MS = 8000;
301
+ const DEVICE_SCAN_TIMEOUT_MS = 3000;
302
302
  const IOS_NOTIFY_READY_DELAY_MS = 150;
303
303
  const ANDROID_NOTIFY_READY_DELAY_MS = 300;
304
304
  const DEFAULT_PROTOCOL_V2_BLE_TUNING = {
package/jest.config.js ADDED
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ preset: '../../jest.config.js',
3
+ testEnvironment: 'node',
4
+ modulePathIgnorePatterns: ['node_modules', '<rootDir>/dist'],
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-transport-react-native",
3
- "version": "1.2.0-alpha.26",
3
+ "version": "1.2.0-alpha.27",
4
4
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -15,15 +15,16 @@
15
15
  "scripts": {
16
16
  "dev": "rimraf dist && rollup -c ../../build/rollup.config.js -w",
17
17
  "build": "rimraf dist && rollup -c ../../build/rollup.config.js",
18
+ "test": "jest",
18
19
  "lint": "eslint .",
19
20
  "lint:fix": "eslint . --fix"
20
21
  },
21
22
  "dependencies": {
22
- "@onekeyfe/hd-core": "1.2.0-alpha.26",
23
- "@onekeyfe/hd-shared": "1.2.0-alpha.26",
24
- "@onekeyfe/hd-transport": "1.2.0-alpha.26",
23
+ "@onekeyfe/hd-core": "1.2.0-alpha.27",
24
+ "@onekeyfe/hd-shared": "1.2.0-alpha.27",
25
+ "@onekeyfe/hd-transport": "1.2.0-alpha.27",
25
26
  "@onekeyfe/react-native-ble-utils": "^0.1.6",
26
27
  "react-native-ble-plx": "3.5.1"
27
28
  },
28
- "gitHead": "1401fef3eb93f5a83ed5e8375b99181b7aaa6054"
29
+ "gitHead": "ea3c188364a6fb968875484805085e4466d3ef99"
29
30
  }
@@ -182,6 +182,10 @@ const createHarness = () => {
182
182
  };
183
183
 
184
184
  describe('ReactNativeBleTransport Protocol V2 link lifecycle', () => {
185
+ test('keeps the legacy default BLE scan timeout', () => {
186
+ expect(new ReactNativeBleTransport({}).scanTimeout).toBe(3000);
187
+ });
188
+
185
189
  afterEach(() => {
186
190
  resetProtocolV2BleTuning();
187
191
  });
package/src/index.ts CHANGED
@@ -107,7 +107,7 @@ const resolveFirmwareUploadRetryDelay = (attempt: number, baseDelayMs = 200, max
107
107
  Math.min(baseDelayMs * 2 ** attempt, maxDelayMs);
108
108
  const PROTOCOL_PROBE_TIMEOUT_MS = 1000;
109
109
  const PROTOCOL_V2_PROBE_TIMEOUT_MS = 10_000;
110
- const DEVICE_SCAN_TIMEOUT_MS = 8000;
110
+ const DEVICE_SCAN_TIMEOUT_MS = 3000;
111
111
  const IOS_NOTIFY_READY_DELAY_MS = 150;
112
112
  const ANDROID_NOTIFY_READY_DELAY_MS = 300;
113
113
  export type ProtocolV2BleTuning = {