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

chore(deps): update dependency socket.io-client to v4.6.1 #525

Merged
merged 1 commit into from
Mar 14, 2023

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Mar 14, 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 - "before 3am on Monday" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

β™» 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.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4412170611

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 74.775%

Totals Coverage Status
Change from base Build 4403408731: 0.0%
Covered Lines: 94
Relevant Lines: 105

πŸ’› - Coveralls

@coveralls
Copy link

coveralls commented Mar 14, 2023

Pull Request Test Coverage Report for Build 4412300646

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 74.775%

Totals Coverage Status
Change from base Build 4412291796: 0.0%
Covered Lines: 94
Relevant Lines: 105

πŸ’› - Coveralls

@renovate renovate bot force-pushed the renovate/socket.io-packages branch from 9c5f868 to 13b0940 Compare March 14, 2023 04:29
@9renpoto 9renpoto self-assigned this Mar 14, 2023
@renovate renovate bot force-pushed the renovate/socket.io-packages branch from 13b0940 to b4f08c7 Compare March 14, 2023 04:33
@renovate renovate bot force-pushed the renovate/socket.io-packages branch from b4f08c7 to 61f68de Compare March 14, 2023 04:43
@9renpoto 9renpoto merged commit f9334f7 into master Mar 14, 2023
@renovate renovate bot deleted the renovate/socket.io-packages branch March 14, 2023 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants