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

Contacts do not show up online until chat is opened with them. #3123

Closed
ganderatc opened this issue Jan 10, 2023 · 22 comments
Closed

Contacts do not show up online until chat is opened with them. #3123

ganderatc opened this issue Jan 10, 2023 · 22 comments
Labels

Comments

@ganderatc
Copy link

Describe the bug
Since upgrading from Converse 10.0.0 to 10.1.0, every contact in my contact list shows as offline (gray dot and the tooltip says "offline") until I click their name to open the chat with them. Javascript console shows no errors with either version.

Curiously, the contact list does still sort online contacts above offline contacts.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Desktop environment, Windows 10
  • Chrome 108.0.5359.125
  • Converse.js version 10.1.0
  • The server is running nginx on Debian and the client is connecting to a local server via websocket. None of that's changed.

Also verified on my iPhone 11 in Safari.

@jcbrand
Copy link
Member

jcbrand commented Jan 16, 2023

Does the problem go away when you log out and log in again?

You can also try clicking the refresh button (the two arrows pointing at one another) to refetch the roster.

Screenshot from 2023-01-16 10-17-14

@samjunction
Copy link

samjunction commented Jan 16, 2023

Does the problem go away when you log out and log in again?

You can also try clicking the refresh button (the two arrows pointing at one another) to refetch the roster.

Screenshot from 2023-01-16 10-17-14

When i was connecting via BOSH, it was happening frequently but after switching to websocket it is much better but issue does happen randomly and clicking on Refresh button does not refetch or update the roster.

@ganderatc
Copy link
Author

Does the problem go away when you log out and log in again?

You can also try clicking the refresh button (the two arrows pointing at one another) to refetch the roster.

Screenshot from 2023-01-16 10-17-14

Problem persists when I log out and back in. Refresh button does nothing and doesn’t generate any JavaScript console errors.

The only time the contact status updates is if I open a chat with a user, that user’s status will update once.

@jcbrand
Copy link
Member

jcbrand commented Jan 17, 2023

So, all contacts are shown as offline and then wen you click on a contact to start chatting with them they become green (assuming they're online at that time)?

Works fine on my end, I haven't seen this behavior recently.

Have you tried on a different browser? Perhaps related to something cached in that specific browser.

@SilverYoCha
Copy link
Contributor

Hello, I also have this behaviour.
I noticed that the presence statuses of the contacts in a MUC room are correct. So a contact can be shown as online in a MUC room while it is shown as offline in the control box contacts.
(In my environment, it was already the case with previous versions)

@jcbrand jcbrand added the bug label Jan 17, 2023
@jcbrand
Copy link
Member

jcbrand commented Jan 17, 2023

@SilverYoCha Are you using BOSH or websocket?

@SilverYoCha
Copy link
Contributor

I am using websocket @jcbrand.

@samjunction
Copy link

Hello, I also have this behaviour. I noticed that the presence statuses of the contacts in a MUC room are correct. So a contact can be shown as online in a MUC room while it is shown as offline in the control box contacts. (In my environment, it was already the case with previous versions)

I am also having exactly same issue. I am using websocket.

@licaon-kter
Copy link
Contributor

I'm running ejabberd HEAD, websockets, but not seeing this issue.

Can you also state complete server info?

@samjunction
Copy link

I'm running ejabberd HEAD, websockets, but not seeing this issue.

Can you also state complete server info?
Using openfire

serverinformation

@ganderatc
Copy link
Author

@SilverYoCha Are you using BOSH or websocket?

I have tried it both ways, with the same behavior. Normally run WebSocket.

So, all contacts are shown as offline and then wen you click on a contact to start chatting with them they become green (assuming they're online at that time)?

I have tried with Chrome on Windows, Chrome on Mac, Safari on iOS, and Safari on Mac. Retried using private browsing mode on all. Same behavior everywhere. Doesn't seem to be a caching problem.

Running ejabberd 21.01 (Debian Bullseye).

@licaon-kter
Copy link
Contributor

licaon-kter commented Jan 17, 2023

Ok, oddly enough now I'm seeing it too :( and worse, it does not appear online even if I write messages between the accounts.

/LE: log off, log in, contact appears offline, wait a few seconds, view refreshes (like a websockets reconnection), contact appears as online

@drlight17
Copy link
Member

I confirm this behaviour. I tested it on the CDN versions 6.0.1, 7.0.5, 8.0.1, 9.1.1 and 10.x.x. BOSH and websocket. With websocket it can be fixed on click at refresh button, but not with BOSH.
At 5.0.5 CDN version statuses work correctly in my cases.

@p42ity
Copy link

p42ity commented May 18, 2023

I can confirm this behaviour, too.

@samjunction
Copy link

Doing below change in function presenceHandler(presence) in converse.js should fix the issue :
Change:
var status_message = presence.querySelector('status')?.textContent;
To:
var status_message = presence.querySelector('status')?.textContent;
if (status_message === undefined) {
status_message = presence.querySelector('show')?.textContent;
}

@drlight17
Copy link
Member

Doing below change in function presenceHandler(presence) in converse.js should fix the issue : Change: var status_message = presence.querySelector('status')?.textContent; To: var status_message = presence.querySelector('status')?.textContent; if (status_message === undefined) { status_message = presence.querySelector('show')?.textContent; }

I will check this, thank you.

@brneor
Copy link
Contributor

brneor commented May 22, 2023

Doing below change in function presenceHandler(presence) in converse.js should fix the issue : Change: var status_message = presence.querySelector('status')?.textContent; To: var status_message = presence.querySelector('status')?.textContent; if (status_message === undefined) { status_message = presence.querySelector('show')?.textContent; }

Tried to build it myself with your fix but still didn't work... Am I missing something?

@samjunction
Copy link

Doing below change in function presenceHandler(presence) in converse.js should fix the issue : Change: var status_message = presence.querySelector('status')?.textContent; To: var status_message = presence.querySelector('status')?.textContent; if (status_message === undefined) { status_message = presence.querySelector('show')?.textContent; }

Tried to build it myself with your fix but still didn't work... Am I missing something?

I did changes in released version.

conversejs-dist

@licaon-kter
Copy link
Contributor

@samjunction fyi 7-zip is open source and better than proprietary stuff ffs

@brneor
Copy link
Contributor

brneor commented May 22, 2023

Found out that I was not setting assets_path which messed things up.

Your fix almost worked 100% for me, now if I reload the page logged as User A I only see the status of User B if they change it, otherwise I see it as offline.

@jcbrand jcbrand closed this as completed in cb1f929 Jun 9, 2023
@jcbrand
Copy link
Member

jcbrand commented Jun 9, 2023

Should be fixed now.

Please let me know if the problem persists somehow.

@brneor
Copy link
Contributor

brneor commented Jun 9, 2023

That's great!

@jcbrand how can I test it?


Edit: just built from master to test. The fix not worked for the scenario I described earlier. Not sure if it's the same issue.

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

No branches or pull requests

8 participants