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

fix(debug): don't force to reconect in the socket #721

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/socket-client@1.9.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/socket-client@1.9.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
Loading