socketcluster-client
Advanced tools
Comparing version 18.0.0 to 18.0.1
@@ -157,4 +157,4 @@ const StreamDemux = require('stream-demux'); | ||
let protocolOptionError = new InvalidArgumentsError( | ||
'The "protocol" option does not affect socketcluster-client - ' + | ||
'If you want to utilize SSL/TLS, use "secure" option instead' | ||
'The protocol option does not affect socketcluster-client - ' + | ||
'If you want to utilize SSL/TLS, use the secure option instead' | ||
); | ||
@@ -656,3 +656,3 @@ this._onError(protocolOptionError); | ||
delete eventObject.callback; | ||
let errorMessage = `Event "${eventObject.event}" was aborted due to a bad connection`; | ||
let errorMessage = `Event ${eventObject.event} was aborted due to a bad connection`; | ||
let error = new BadConnectionError(errorMessage, failureType); | ||
@@ -775,3 +775,3 @@ | ||
delete eventObject.callback; | ||
let error = new TimeoutError(`Event response for "${eventObject.event}" timed out`); | ||
let error = new TimeoutError(`Event response for ${eventObject.event} event timed out`); | ||
callback.call(eventObject, error, eventObject); | ||
@@ -778,0 +778,0 @@ } |
@@ -21,3 +21,3 @@ const AGClientSocket = require('./clientsocket'); | ||
'The host option should include both' + | ||
' the hostname and the port number in the format "hostname:port"' | ||
' the hostname and the port number in the hostname:port format' | ||
); | ||
@@ -29,3 +29,3 @@ } | ||
'The host option should already include' + | ||
' the hostname and the port number in the format "hostname:port"' + | ||
' the hostname and the port number in the hostname:port format' + | ||
' - Because of this, you should never use host and hostname options together' | ||
@@ -38,3 +38,3 @@ ); | ||
'The host option should already include' + | ||
' the hostname and the port number in the format "hostname:port"' + | ||
' the hostname and the port number in the hostname:port format' + | ||
' - Because of this, you should never use host and port options together' | ||
@@ -41,0 +41,0 @@ ); |
@@ -232,3 +232,3 @@ const AGRequest = require('ag-request'); | ||
let errorMessage = `Event "${eventObject.event}" was aborted due to a bad connection`; | ||
let errorMessage = `Event ${eventObject.event} was aborted due to a bad connection`; | ||
let badConnectionError = new BadConnectionError(errorMessage, failureType); | ||
@@ -399,3 +399,3 @@ | ||
delete eventObject.callback; | ||
let error = new TimeoutError(`Event response for "${eventObject.event}" timed out`); | ||
let error = new TimeoutError(`Event response for ${eventObject.event} event timed out`); | ||
callback.call(eventObject, error, eventObject); | ||
@@ -402,0 +402,0 @@ } |
{ | ||
"name": "socketcluster-client", | ||
"description": "SocketCluster JavaScript client", | ||
"version": "18.0.0", | ||
"version": "18.0.1", | ||
"homepage": "https://socketcluster.io/", | ||
@@ -52,4 +52,4 @@ "contributors": [ | ||
"rollup": "^3.28.1", | ||
"socketcluster-server": "^17.4.1" | ||
"socketcluster-server": "^18.0.1" | ||
} | ||
} |
@@ -943,3 +943,3 @@ const assert = require('assert'); | ||
describe('Order of events', function () { | ||
describe('Events', function () { | ||
it('Should trigger unsubscribe event on channel before disconnect event', async function () { | ||
@@ -1227,2 +1227,19 @@ client = socketClusterClient.create(clientOptions); | ||
}); | ||
it('Should support event listener timeout using once(timeout) method', async function () { | ||
client = socketClusterClient.create(clientOptions); | ||
let event; | ||
let error; | ||
try { | ||
// Since the authStateChange event will not trigger, this should timeout. | ||
event = await client.listener('authStateChange').once(100); | ||
} catch (err) { | ||
error = err; | ||
} | ||
assert.notEqual(error, null); | ||
assert.equal(error.name, 'TimeoutError'); | ||
}); | ||
}); | ||
@@ -1229,0 +1246,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
215909
3424
0