@onekeyfe/hd-transport 1.2.0-alpha.29 → 1.2.0-alpha.30

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.
@@ -61,6 +61,26 @@ describe('Protocol V2 BLE frame writer', () => {
61
61
  expect(writePacket).not.toHaveBeenCalled();
62
62
  });
63
63
 
64
+ test('surfaces an abort that occurs while the final packet write is completing', async () => {
65
+ const controller = new AbortController();
66
+ const writePacket = jest.fn().mockImplementation(() => {
67
+ controller.abort();
68
+ return Promise.resolve();
69
+ });
70
+
71
+ await expect(
72
+ writeProtocolV2BleFrame({
73
+ frame: new Uint8Array(4),
74
+ packetCapacity: 4,
75
+ signal: controller.signal,
76
+ abortMessage: 'Protocol V2 BLE write aborted for Ping',
77
+ writePacket,
78
+ })
79
+ ).rejects.toThrow('Protocol V2 BLE write aborted for Ping');
80
+
81
+ expect(writePacket).toHaveBeenCalledTimes(1);
82
+ });
83
+
64
84
  test('applies bounded burst pauses and one final flush delay', async () => {
65
85
  const waits = [];
66
86
  const writePacket = jest.fn().mockResolvedValue(undefined);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-transport",
3
- "version": "1.2.0-alpha.29",
3
+ "version": "1.2.0-alpha.30",
4
4
  "description": "Transport layer abstractions and utilities for OneKey hardware SDK.",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -28,5 +28,5 @@
28
28
  "long": "^4.0.0",
29
29
  "protobufjs": "^6.11.2"
30
30
  },
31
- "gitHead": "4a4019e439cc472f89fd15ab47e84ef0ed43166a"
31
+ "gitHead": "07405d2e3dcdd0ba351ae98b7cf4f61690ef2913"
32
32
  }