@auroradao/datastream-connection
Advanced tools
Comparing version 1.1.3-alpha.0 to 1.1.3
@@ -6,2 +6,13 @@ # Change Log | ||
## [1.1.3](https://github.com/AuroraDAO/datastream-client-js/compare/v1.1.3-alpha.0...v1.1.3) (2019-03-11) | ||
### Bug Fixes | ||
* dont defer auto connect when enabled to prevent socket not defined error when sending synchronously ([173ec92](https://github.com/AuroraDAO/datastream-client-js/commit/173ec92)) | ||
## [1.1.3-alpha.0](https://github.com/AuroraDAO/datastream-client-js/compare/v1.1.2...v1.1.3-alpha.0) (2019-02-16) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@auroradao/datastream-connection", | ||
"version": "1.1.3-alpha.0", | ||
"version": "1.1.3", | ||
"description": "Internal package called by @auroradao/datastream-client which maintains the provided connector.", | ||
@@ -12,3 +12,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "32a31b59405fcbf895669eb8588527be4ba24da0" | ||
"gitHead": "a1d0ffed66f96e0a4cb8cf09bf2acd4b5d9d859a" | ||
} |
@@ -518,2 +518,7 @@ import * as $Datastream from '@auroradao/datastream-types'; | ||
} | ||
if (state !== STATE.HANDSHAKED && !buffer) { | ||
// when no buffer is defined, we throw an error that we are | ||
// not ready to send messages | ||
throw new DatastreamNotReadyError(message.rid, message.request, state); | ||
} | ||
if (!socket || (state === STATE.HANDSHAKED && !sid)) { | ||
@@ -527,6 +532,5 @@ // sanity check, should not occur | ||
} | ||
if (state !== STATE.HANDSHAKED) { | ||
if (state !== STATE.HANDSHAKED && shouldBufferRequest) { | ||
if (!buffer) { | ||
// when no buffer is defined, we throw an error that we are | ||
// not ready to send messages | ||
// this should never occur, sanity check | ||
throw new DatastreamNotReadyError( | ||
@@ -538,14 +542,13 @@ message.rid, | ||
} | ||
if (shouldBufferRequest) { | ||
if (config.log) { | ||
console.log( | ||
`[BUFFER] | DatastreamClient | Adding request "${ | ||
message.request | ||
}" to request buffer to be sent upon the next successful handshake` | ||
); | ||
} | ||
buffer.add(message); | ||
if (config.log) { | ||
console.log( | ||
`[BUFFER] | DatastreamClient | Adding request "${ | ||
message.request | ||
}" to request buffer to be sent upon the next successful handshake` | ||
); | ||
} | ||
buffer.add(message); | ||
return false; | ||
} | ||
const packet: $Datastream.Request$Complete<RID, REQ, string> = { | ||
@@ -552,0 +555,0 @@ sid, |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
66323
1375
1