@nxtedition/deepstream.io-client-js 23.4.54 → 23.4.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/deepstream.io-client-js",
3
- "version": "23.4.54",
3
+ "version": "23.4.55",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "bugs": {
@@ -129,7 +129,13 @@ Connection.prototype.send = function (message) {
129
129
  return false
130
130
  }
131
131
 
132
- return this._submit(message)
132
+ if (
133
+ this._state === C.CONNECTION_STATE.OPEN &&
134
+ this._endpoint.readyState === this._endpoint.OPEN
135
+ ) {
136
+ this.emit('send', message)
137
+ this._endpoint.send(message)
138
+ }
133
139
  }
134
140
 
135
141
  Connection.prototype._submit = function (message) {
@@ -139,10 +145,7 @@ Connection.prototype._submit = function (message) {
139
145
  const err = new Error(`Packet to big: ${message.length} > ${maxPacketSize}`)
140
146
  this._client._$onError(C.TOPIC.CONNECTION, C.EVENT.CONNECTION_ERROR, err)
141
147
  return false
142
- } else if (
143
- this._state === C.CONNECTION_STATE.OPEN &&
144
- this._endpoint.readyState === this._endpoint.OPEN
145
- ) {
148
+ } else if (this._endpoint.readyState === this._endpoint.OPEN) {
146
149
  this.emit('send', message)
147
150
  this._endpoint.send(message)
148
151
  return true