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

Chrome: lot of Disconnection / Reconnection logged into a chatbox #2770

Closed
SilverYoCha opened this issue Jan 10, 2022 · 13 comments
Closed

Chrome: lot of Disconnection / Reconnection logged into a chatbox #2770

SilverYoCha opened this issue Jan 10, 2022 · 13 comments

Comments

@SilverYoCha
Copy link
Contributor

Describe the bug
When a user is using a Chrome or Chrome like browser the other users see lot of disconnection / reconnection from this user info chat or group chat room.
Have someone got same observation?
Still, their internet connection works perfectly.

To Reproduce
One user on Firefox and an other on a Chrome or Chrome like chatting between each other.
After a while, the user on Firefox will see regular disconnections / reconnections from Chrome user.

Expected behavior
Avoiding to get the disconnections / reconnections.

Screenshots
For example:
image

Environment

  • Desktop
  • Browser Chrome (recent version)
  • Converse.js version 9.0.0
@licaon-kter
Copy link
Contributor

Console log, debug level, says what?

@SilverYoCha
Copy link
Contributor Author

I tried to capture some logs after detecting the thing.
Not sure to get enough.

The context:

  • an opened chat (one to one) between userA and userB (userB on Chrome and userA on Firefox)
  • an opened group chat where userA and userB are also participants

console-export-2022-1-10_12-7-31.txt

@jcbrand
Copy link
Member

jcbrand commented Jan 10, 2022

I don't see anything in those logs, are they from the Firefox user?

I think it would be better to set your server's logs to debug level and see what gets logged there.

@licaon-kter
Copy link
Contributor

@SilverYoCha why is your picture blue? Whah theme is that? How did you install Converse?

@SilverYoCha
Copy link
Contributor Author

@jcbrand yes logs comes from Firefox user.
OK, I will try to investigate the logs on the ejabberd server.

@licaon-kter default theme is used. There is just some CSS changes defined into an external CSS file.
ConverseJS is used in overlayed mode.

Initialization options
 converse.initialize({
          'view_mode' : 'overlayed',
          'i18n' : 'a language',
          'assets_path' : '/myserver/chat/converse/',
          'sounds_path' : '/myserver/chat/converse/',
          'play_sounds' : false,
          'bosh_service_url' : 'bosh url',
          'allow_logout' : false,
          'auto_login' : true,
          'auto_reconnect' : true,
          'jid' : 'a jid',
          'default_domain' : 'a domain',
          'domain_placeholder' : 'a domain',
          'password' : 'a password',
          'autocomplete_add_contact' : false,
          'notification_icon' : 'aLogo.png',
          'muc_domain' : 'conference.a.domain',
          'locked_muc_domain' : 'hidden',
          'muc_disable_slash_commands' : true,
          'locked_muc_nickname' : true,
          'nickname' : 'a nickname',
          'auto_register_muc_nickname' : true,
          'notify_all_room_messages' : true,
          'auto_join_on_invite' : false,
          'roster_groups' : false,
          'allow_adhoc_commands' : false,
          'allow_contact_removal' : false,
          'allow_contact_requests' : false,
          'allow_registration' : false,
          'show_controlbox_by_default' : false,
          'discover_connection_methods' : false
        });

@jcbrand
Copy link
Member

jcbrand commented Jan 11, 2022

@SilverYoCha Concerning Converse logs, the logs from the Chrome user will be more useful than from the Firefox user.

@SilverYoCha
Copy link
Contributor Author

@jcbrand I got logs of my interlocutor which is using a chrome like browser.
Hope it can be helpful.

userA uses Firefox and userB the chrome like browser

Chrome like browser details
Vicaldi 5.0.2497.32 (Stable channel) stable (64 bits)
Révision    4891cb2a30270ebb895cf22eb99642090bde0046
Système d’exploitation    Linux
JavaScript    V8 9.6.180.21
Agent utilisateur    Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.113 Safari/537.36
Ligne de commande    /usr/bin/vivaldi-stable --new-window --enable-crashpad --flag-switches-begin --flag-switches-end --origin-trial-disabled-features=CaptureHandle --save-page-as-mhtml
Chemin d’accès à l’exécutable    /opt/vivaldi/vivaldi
Chemin d’accès au profil    /home/dle/.config/vivaldi/Default

server.com-1641898021606.log

@JohnXLivingston
Copy link
Contributor

I use ConverseJS in a Peertube plugin (Peertube is a FOSS streaming platform). I have a user that seems to have the same issue: JohnXLivingston/peertube-plugin-livechat#88

The browser logs are in the screenshots.

ConverseJS can't reconnect, but this is maybe due to the way I use Converse (i will investigate next week).

@jcbrand
Copy link
Member

jcbrand commented Jan 25, 2022

@SilverYoCha: I see that the person is using BOSH to connect instead of websocket.

At some point, the XMPP server returns:

log.js:70  2022-01-11T10:44:20.660Z DEBUG: <body xmlns="http://jabber.org/protocol/httpbind" type="terminate" condition="item-not-found"/>

This can happen for multiple reasons:
https://xmpp.org/extensions/xep-0124.html#table-2

I think you should check your XMPP server's logs for information as to why it terminates the BOSH session.
Might be that it has expired, or might have something to do with Chrome throttling requests (e.g. when the tab is in the background).

You can also just use websocket instead of BOSH. It's faster, simpler and better.

@JohnXLivingston
Copy link
Contributor

@jcbrand , any idea of what explains the difference between Chrome and Firefox? Maybe Chrome closes some connections after a timeout when tab is in background?

@jcbrand
Copy link
Member

jcbrand commented Jan 25, 2022

@JohnXLivingston I think the issue is that Chrome throttles HTTP connections and that this causes the BOSH session to expire.

One possible solution could be to increase the BOSH wait period. You should apply the latest commit I made:
007b4bc

And then you can change BOSH_WAIT to be some larger value. There's even a small chance that my commit fixes the problem without requiring you to change the value.

Better yet would be to just use websocket.

@JohnXLivingston
Copy link
Contributor

Thanks. I'll test that (not this week, I'm working on another project, but soon).

I can't use websocket in my project... (I have to use the Peertube server as a proxy, I can't add a websocket server).

SilverYoCha added a commit to Silverpeas/Silverpeas-Core that referenced this issue Jan 25, 2022
…onversejs/converse.js#2770 : the possibility to set the use of websocket has been implemented.
@SilverYoCha
Copy link
Contributor Author

Thank you for your recommendations @jcbrand.
I just set up websocket communications and it does indeed the job, and so, it fixes the problem.
I did not take time to try the commit 007b4bc @JohnXLivingston , but I hope it will fix yours.

@jcbrand jcbrand closed this as completed Feb 11, 2022
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

4 participants