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

Messages not realtime #814

Closed
anubra266 opened this issue Sep 30, 2020 · 6 comments
Closed

Messages not realtime #814

anubra266 opened this issue Sep 30, 2020 · 6 comments

Comments

@anubra266
Copy link

Just cloned it, and can't find all those advanced features, such as password protected rooms. And I have to refresh page to see messages after i send them. It's not realtime, what's causing this, The response makes me pretty sure, this is not how everyone's copy is behaving

@anubra266 anubra266 changed the title Just cloned to my local computer Messages not realtime Sep 30, 2020
@simonhabran
Copy link

Hello Anubra. Just installed and same issue for me

@anubra266
Copy link
Author

Thanks @simonhabran. What platform are you on? I'm on Ubuntu 20

@src-r-r
Copy link

src-r-r commented Nov 1, 2020

Doing some investigation I think I found the source of this problem.

If you open the console (F12 for Firefox) and type a message, an error is raised:

Uncaught TypeError: message.owner is null
    addMessage http://localhost:5000/media/dist/chat-90111456a06d8b27e1c3ea2e0f460141.js:735

And doing some debugging, it seems that message.owner is indeed null, but only when posting a message (the addMethod is used when showing message history, and the owner is set accordingly).

I'll be doing more digging into this. Obviously, the owner is stored in Mongo, otherwise, they wouldn't appear. Somewhere along the line of passing the message to the callback the owner is not being set.

My only question: where is the callback for when a user posts a message? From there I can discover where the user is not being set.

@eusebiu-biroas
Copy link

Hi,
The issue is on app/core/messages.js on line 44.
A quickfix would be to replace it with this:
User.findOne({'_id': message.owner}, function(err, user) {

@alexdparis
Copy link

alexdparis commented Jan 10, 2021

Hi, thanks for the trick, but unfortunately file upload doesn't work either.
Waiting forward for another fix :).

EDIT: just try this fix locally in app/core/files.js online 80 as well :
User.findOne({'_id': options.owner}, function(err, user) {
seems to work like a charm.

Cheers

@YeKoHein
Copy link

YeKoHein commented Sep 27, 2022

The issue is on app/core/messages.js on line 44.
A quickfix would be to replace it with this:
User.findOne({'_id': message.owner}, function(err, user) {

@eusebiu-biroas Thanks. It is work for me.

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

6 participants