Dun-sin / Whisper

A fun Application to have a random chat with people safely
https://whisper.favour.dev/
MIT License
379 stars 342 forks source link

[BUG] chat isn't visible #586

Closed MJinH closed 8 months ago

MJinH commented 8 months ago

Description

When you connect to chat as anonymous and send messages, the other person doesn't receive messages and what you type isn't visible.

Screenshots

Screenshot (212)

Additional information

No response

🥦 Browser

Google Chrome

👀 Have you checked if this issue has been raised before?

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

Yes I am willing to submit a PR!

github-actions[bot] commented 8 months ago

This issue is waiting to be approved so it's locked until approved
Thank you @MJinH for creating an issue, while you wait for a response, consider reading the Contributing.md file If you have any questions, please reach out to us on Discord or follow up on the issue itself. Welcome to the community!!

Log | Bot Usage
github-actions[bot] commented 8 months ago

This issue is ready for dev and assigned to anyone who properly asks

Log | Bot Usage
Dun-sin commented 8 months ago

go for it @MJinH. Follow the guidelines here, or your PR won't be accepted and will be closed. Good luck!

MJinH commented 8 months ago

go for it @MJinH. Follow the guidelines here, or your PR won't be accepted and will be closed. Good luck!

Hi @Dun-sin , before creating a PR, can I briefly ask why we are disconnecting the socket here in the 'anonymous.tsx' file?.

Screenshot (213)

Dun-sin commented 8 months ago

go for it @MJinH. Follow the guidelines here, or your PR won't be accepted and will be closed. Good luck!

Hi @Dun-sin , before creating a PR, can I briefly ask why we are disconnecting the socket here in the 'anonymous.tsx' file?.

Screenshot (213)

Notice it's in the return of the useEffect, which is meant for cleaning up useEffects, it's there because it's a cleanup and not the actual code

MJinH commented 8 months ago

I noticed that if we don't comment that out, socket.connect will become false, and whenever we send a message, it gets stuck here and returns immediately. Is there any way to keep connect as true without commenting out this part?

Screenshot (214)

Dun-sin commented 8 months ago

I noticed that if we don't comment that out, socket.connect will become false, and whenever we send a message, it gets stuck here and returns immediately. Is there any way to keep connect as true without commenting out this part?

Screenshot (214)

the whole application runs on socket so we do always need it to be true, in that case removing the socket,disconnect is our safest and best bet