Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fix(debug): don't force to reconect in the socket
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossantos74 committed Jul 17, 2024
1 parent b1c3a25 commit 79e99d7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
22 changes: 11 additions & 11 deletions src/services/io/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ export class IOC {
}

private handleConnectionState = (state: Socket.ConnectionState): void => {
const needsToReconnectStates = [
Socket.ClientState.DISCONNECTED,
Socket.ClientState.RECONNECT_ERROR,
];

if (
needsToReconnectStates.includes(state.state) &&
!['io client disconnect', 'Unauthorized connection'].includes(state.reason)
) {
this.forceReconnect();
}
// const needsToReconnectStates = [
// Socket.ClientState.DISCONNECTED,
// Socket.ClientState.RECONNECT_ERROR,
// ];

// if (
// needsToReconnectStates.includes(state.state) &&
// !['io client disconnect', 'Unauthorized connection'].includes(state.reason)
// ) {
// this.forceReconnect();
// }

if (state.reason === 'Unauthorized connection') {
console.error(
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2666,10 +2666,10 @@
resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553"
integrity sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==

"@superviz/[email protected].0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@superviz/socket-client/-/socket-client-1.9.0.tgz#fd14fb485e6b04275f810f2b90b38b62d8af972f"
integrity sha512-C6IkWJ6mWcL3y6cPvs2yVwTi0YZ/Nm76uYA+736X3vYOPsMna63Jl0nD+iNoIWj0l00hGAR5ZORTWLrMRnrAxA==
"@superviz/[email protected].1":
version "1.9.1"
resolved "https://registry.yarnpkg.com/@superviz/socket-client/-/socket-client-1.9.1.tgz#392c370b049996dd7ea4d668ef9f69f3d8f7a123"
integrity sha512-esDtE/bSGNW1DeSuqv9/gE4tVDyaYxeQDrSeAlTA+rHQWPLOsOKyYE6r0SyNQJtThzgm0/VLtAGc+pGdcdSc8g==
dependencies:
"@reactivex/rxjs" "^6.6.7"
debug "^4.3.5"
Expand Down

0 comments on commit 79e99d7

Please sign in to comment.