Skip to content

Commit

Permalink
chore: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
b-ma committed Sep 6, 2024
2 parents 3174c73 + 7b7d4df commit 493bb08
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## v4.0.0-alpha.27 - 06/09/2025

- Fix: assign to `const`

## v4.0.0-alpha.26 - 05/09/2025

- Fix: improve reconnect strategy in case of socket connection failure

## v4.0.0-alpha.25 - 24/05/2025

- Fix: better default behavior for WebSocket connection URL
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@soundworks/core",
"version": "4.0.0-alpha.25",
"version": "4.0.0-alpha.27",
"description": "Open-source creative coding framework for distributed applications based on Web technologies",
"authors": [
"Benjamin Matuszewski",
Expand Down
17 changes: 9 additions & 8 deletions src/client/ClientSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ class ClientSocket {
}

webSocketOptions = {
// handshakeTimeout: 2000,
// do not reject self-signed certificates
rejectUnauthorized: false,
};
}
Expand Down Expand Up @@ -132,18 +134,17 @@ class ClientSocket {
return; // do not propagate ping pong messages
}

// Parse incoming message and dispatch in pubsub system.
// Parse incoming message, dispatch in pubsub system and propagate raw event.
const [channel, args] = unpackStringMessage(e.data);
this.#dispatchEvent(channel, ...args);
this.#dispatchEvent('message', e);
});

// @todo - propagate raw 'message' events in the callback above, no
// need to execute to function instad of one per message...
['close', 'error', 'upgrade', 'message'].forEach(eventName => {
this.#socket.addEventListener(eventName, e => {
this.#dispatchEvent(eventName, e);
});
})
// Propagate other "native" events
this.#socket.addEventListener('close', e => this.#dispatchEvent('close', e));
this.#socket.addEventListener('error', e => this.#dispatchEvent('close', e));
// @note - isn't it too late for this one?
this.#socket.addEventListener('upgrade', e => this.#dispatchEvent('upgrade', e));

// Forward open event and continue initialization
this.#dispatchEvent('open', openEvent);
Expand Down
2 changes: 1 addition & 1 deletion src/common/version.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// [WARNING] This file is generated, do not edit
export default '4.0.0-alpha.25';
export default '4.0.0-alpha.27';
2 changes: 1 addition & 1 deletion src/server/ServerSockets.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class ServerSockets {
* JSON compatible data types (i.e. string, number, boolean, object, array and null).
*/
broadcast(roomIds, excludeSocket, channel, ...args) {
const targets = new Set();
let targets = new Set();

if (typeof roomIds === 'string' || Array.isArray(roomIds)) {
if (typeof roomIds === 'string') {
Expand Down

0 comments on commit 493bb08

Please sign in to comment.