Comparing version 1.24.2 to 1.25.0
@@ -132,10 +132,23 @@ /* | ||
// pause for a couple of seconds to try and minimize chance for a service-side race | ||
await new Promise(resolve => setTimeout(resolve, 2000)); | ||
// The third connection that will cause the first one to be disconnected because it has the same client ID. | ||
const connectionDuplicate = await makeConnection(undefined, client_id); | ||
const onConnectDuplicate = once(connectionDuplicate, 'connect'); | ||
const onDisconnectDuplicate = once(connectionDuplicate, 'disconnect'); | ||
await connectionDuplicate.connect() | ||
const connectDuplicateResult = (await onConnectDuplicate)[0]; | ||
expect(connectDuplicateResult).toBeFalsy(); /* session present */ | ||
// Rarely, IoT Core disconnects the new connection and not the existing one, so retry in that case | ||
let continueConnecting = true; | ||
while (continueConnecting) { | ||
try { | ||
const onConnectDuplicate = once(connectionDuplicate, 'connect'); | ||
await connectionDuplicate.connect(); | ||
await onConnectDuplicate; | ||
continueConnecting = false; | ||
} catch (err) { | ||
await new Promise(resolve => setTimeout(resolve, 1000)); | ||
} | ||
} | ||
// The second connection should receive Will message after the first connection was kicked out. | ||
@@ -142,0 +155,0 @@ const messageReceivedArgs = (await onMessage); |
@@ -638,3 +638,3 @@ /* | ||
await setTimeout(()=>{}, 2000); | ||
await new Promise(resolve => setTimeout(resolve, 2000)); | ||
@@ -641,0 +641,0 @@ statistics = client.getOperationalStatistics(); |
{ | ||
"name": "aws-crt", | ||
"version": "1.24.2", | ||
"version": "1.25.0", | ||
"description": "NodeJS/browser bindings to the aws-c-* libraries", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/awslabs/aws-crt-nodejs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
31555423
368
50745
12