Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): update dependency socket.io-client to ^4.6.1 #566

Merged
merged 1 commit into from
May 1, 2023

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 1, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
socket.io-client ^4.5.4 -> ^4.6.1 age adoption passing confidence

Release Notes

socketio/socket.io-client

v4.6.1

Compare Source

Bug Fixes
  • do not drain the queue while the socket is offline (4996f9e)
  • prevent duplicate connections when multiplexing (46213a6)
Dependencies

v4.6.0

Compare Source

Bug Fixes
  • typings: do not expose browser-specific types (4d6d95e)
  • ensure manager.socket() returns an active socket (b7dd891)
  • typings: properly type emits with timeout (#​1570) (33e4172)
Features
A new "addTrailingSlash" option

The trailing slash which was added by default can now be disabled:

import { io } from "socket.io-client";

const socket = io("https://example.com", {
  addTrailingSlash: false
});

In the example above, the request URL will be https://example.com/socket.io instead of https://example.com/socket.io/.

Added in 21a6e12.

Promise-based acknowledgements

This commit adds some syntactic sugar around acknowledgements:

// without timeout
const response = await socket.emitWithAck("hello", "world");

// with a specific timeout
try {
  const response = await socket.timeout(1000).emitWithAck("hello", "world");
} catch (err) {
  // the server did not acknowledge the event in the given delay
}

Note: environments that do not support Promises will need to add a polyfill in order to use this feature.

Added in 47b979d.

Connection state recovery

This feature allows a client to reconnect after a temporary disconnection and restore its ID and receive any packets that was missed during the disconnection gap. It must be enabled on the server side.

A new boolean attribute named recovered is added on the socket object:

socket.on("connect", () => {
  console.log(socket.recovered); // whether the recovery was successful
});

Added in 54d5ee0 (server) and b4e20c5 (client).

Retry mechanism

Two new options are available:

  • retries: the maximum number of retries. Above the limit, the packet will be discarded.
  • ackTimeout: the default timeout in milliseconds used when waiting for an acknowledgement (not to be mixed up with the already existing timeout option, which is used by the Manager during the connection)
const socket = io({
  retries: 3,
  ackTimeout: 10000
});

// implicit ack
socket.emit("my-event");

// explicit ack
socket.emit("my-event", (err, val) => { /* ... */ });

// custom timeout (in that case the ackTimeout is optional)
socket.timeout(5000).emit("my-event", (err, val) => { /* ... */ });

In all examples above, "my-event" will be sent up to 4 times (1 + 3), until the server sends an acknowledgement.

Assigning a unique ID to each packet is the duty of the user, in order to allow deduplication on the server side.

Added in 655dce9.

Dependencies

Configuration

📅 Schedule: Branch creation - "on the 1st day of the month" in timezone Asia/Shanghai, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label May 1, 2023
@mergify mergify bot added the waiting-approval waiting code reviewers to approval PR label May 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2023

Preview Deployment

Build URL time
Sites netlify preview 2023-04-01 01:28:19Z
Storybook netlify preview 2023-04-01 01:29:58Z

@codecov
Copy link

codecov bot commented May 1, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (cdc1386) 82.47% compared to head (e7ed7dd) 82.47%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #566   +/-   ##
=======================================
  Coverage   82.47%   82.47%           
=======================================
  Files          98       98           
  Lines        5952     5952           
  Branches      422      422           
=======================================
  Hits         4909     4909           
  Misses       1037     1037           
  Partials        6        6           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@trim21 trim21 merged commit 86557bc into master May 1, 2023
@trim21 trim21 deleted the renovate/socket.io-packages branch May 1, 2023 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file size/XS waiting-approval waiting code reviewers to approval PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant