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

Messaging issue #6

Open
piyushx opened this issue Feb 19, 2022 · 3 comments
Open

Messaging issue #6

piyushx opened this issue Feb 19, 2022 · 3 comments

Comments

@piyushx
Copy link

piyushx commented Feb 19, 2022

I have been testing the messaging feature by chatting with myself from PC and mobile. When I send a message from PC, it instantly comes on the mobile. But when I message from the mobile, it doesn't come on the PC unless I refresh the page or switch tabs. Can you tell me why is this happening?

@raj074
Copy link
Owner

raj074 commented Feb 20, 2022

hi @piyushx , i checked it. It's working both ways. When new message arrive it's not scrolling chat to bottom but it's receiving message instantly without refreshing. Check left message tab it will show last message without refreshing.

@piyushx
Copy link
Author

piyushx commented Feb 20, 2022

Hi @raj074 ! Thanks for the reply. It got solved. However now when I'm trying to register myself on the localhost, I'm getting an error from the backend. Here it goes:

node:internal/errors:464
ErrorCaptureStackTrace(err);
^

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at new NodeError (node:internal/errors:371:5)
at ServerResponse.setHeader (node:_http_outgoing:576:11)
at ServerResponse.header (C:\Social\node_modules\express\lib\response.js:771:10)
at ServerResponse.send (C:\Social\node_modules\express\lib\response.js:170:12)
at ServerResponse.json (C:\Social\node_modules\express\lib\response.js:267:15)
at register (C:\Social\controllers\authCtrl.js:62:30)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 'ERR_HTTP_HEADERS_SENT'
}

Can you let me know why is this happening?

@Pavanshah0804
Copy link

Hi @raj074 ! Thanks for the reply. It got solved. However now when I'm trying to register myself on the localhost, I'm getting an error from the backend. Here it goes:

node:internal/errors:464 ErrorCaptureStackTrace(err); ^

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client at new NodeError (node:internal/errors:371:5) at ServerResponse.setHeader (node:_http_outgoing:576:11) at ServerResponse.header (C:\Social\node_modules\express\lib\response.js:771:10) at ServerResponse.send (C:\Social\node_modules\express\lib\response.js:170:12) at ServerResponse.json (C:\Social\node_modules\express\lib\response.js:267:15) at register (C:\Social\controllers\authCtrl.js:62:30) at processTicksAndRejections (node:internal/process/task_queues:96:5) { code: 'ERR_HTTP_HEADERS_SENT' }

Can you let me know why is this happening?

@piyushx , I am also contributor in above project.This error describes that res has been set more than once in your code.

remove line no. 60 res.json({ msg: "registered" });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants