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

Socket Error #170

Open
emmanuel-omegaalexis opened this issue Aug 17, 2023 · 12 comments
Open

Socket Error #170

emmanuel-omegaalexis opened this issue Aug 17, 2023 · 12 comments

Comments

@emmanuel-omegaalexis
Copy link

The username and password are correct but I keep getting a websocket error.
WebSocket connection to 'wss://api.chatengine.io/person_v4/?session_token=' failed:

@kuldeepperumalla
Copy link

kuldeepperumalla commented Aug 28, 2023

same error! did you found any fix?

@emmanuel-omegaalexis
Copy link
Author

I had to delete some of my Chats to get to work again (I had over 50). Maybe there is a limit or it was a fluke.

@HaAymar
Copy link

HaAymar commented Oct 15, 2023

Is there any one who found the solution of how to solve the problem with the socket error pleasee !!
I can send message but , it can't show me the message I sent and also the response, but in the side of admin I can see all messages

Thank you

@HridoyHazard
Copy link

facing the same error
image

@HridoyHazard
Copy link

@kuladeepperumalla @emmanuel-omegaalexis @HaAymar @alamorre

@emmanuel-omegaalexis
Copy link
Author

@HridoyHazard I deleted the chats and created new ones, I have not seen the error since. I thought was because I had too many chats (each user has over 200 chats each) but I have not been able to confirm that.

@HridoyHazard
Copy link

i tried this but still not working...getting the same error. but message is sending to the user but it needs to reload to see it from user end @emmanuel-omegaalexis

@AdiNehama
Copy link

did you solve it already? @HridoyHazard

@AdiNehama
Copy link

@alamorre

@adityaChauhan2510
Copy link

how to solve this error

@ClearConnect
Copy link

ClearConnect commented Jun 30, 2024

Hi @alamorre having similar problem with one important difference: While ChatFeed is working with the support example ( though I had to increase the timeout to 4000 to get it to work
image, I get Socket Closed in our app ( I'm working for a healthcare startup)
image

Any suggestions will be much appreciated!

@ClearConnect
Copy link

ClearConnect commented Jun 30, 2024

By ellimination I figured out the websock problem was caused by </React.StrictMode> as soon as I removed it the problem went away. Chat GPT suggests Best Practices
Here are some best practices to handle such issues without removing <React.StrictMode>:

Idempotent Side Effects: Ensure that side effects (like WebSocket connections) are idempotent, meaning that initializing or cleaning them up multiple times has no adverse effects.
Check for Duplicates: Before creating a new WebSocket connection, check if one already exists and is in the correct state.
Proper Cleanup: Make sure that side effects are properly cleaned up in useEffect cleanup functions.
Does this make sense @alamorre ?

In case you guys are still struggling with this @kuldeepperumalla @emmanuel-omegaalexis @HaAymar @adityaChauhan2510 @adityaChauhan2510 @emmanuel-omegaalexis

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

No branches or pull requests

7 participants