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

Chatboxes stay empty after logging out and in again #1735

Open
ChaosKid42 opened this issue Sep 26, 2019 · 9 comments

Comments

@ChaosKid42
Copy link
Contributor

commented Sep 26, 2019

The MUC chatboxes open but stay empty if you log in immediately after log off.

  1. Go to converse.js
  2. Trusted device off and log in
  3. Open MUC chatbox (messages are shown)
  4. Log off
  5. Log in (no page reload in between)
  6. Open MUC (messages are not shown)

Expected behavior
Messages are shown

Environment (please complete the following information):

  • Desktop
  • Browser Chrome
  • Converse.js version 5.0.3

Ejabberd 19.08 self-hosted

@licaon-kter

This comment has been minimized.

Copy link
Contributor

commented Sep 26, 2019

Seeing the same too in Firefox, after logoff you need to CTRL-F5 force reload.

As with other issues reported by me, unless you cleanly logout and force reload (some sort of the cleanest state possible) stuff will randomly be broken :(

Eg. Don't close the tab while logged in, don't undo the closed tab, don't close the tab and restart the browser, etc.

Ref #1630

Also, I thought I reported this(!?), but on tab close & undo, the attachment icon disappears in MUCs.

@ChaosKid42

This comment has been minimized.

Copy link
Contributor Author

commented Sep 26, 2019

For now I'm simply using the following ugly hack:

diff --git a/src/headless/converse-core.js b/src/headless/converse-core.js
index d27a9c9f8..eaaa3ff0f 100644
--- a/src/headless/converse-core.js
+++ b/src/headless/converse-core.js
@@ -548,6 +548,7 @@ function clearSession  () {
      * @event _converse#clearSession
      */
     _converse.api.trigger('clearSession');
+    location.reload();
 }

But maybe this should be solved correctly by someone more educated than me :-)

@MotoGP-Fan

This comment has been minimized.

Copy link

commented Oct 2, 2019

Maybe this helps to locate the issue

Tested with:
Prosody 0.11.2
Firefox 69.0 + Chrome 77.0.3865.75

Converse 5.0.3 on local installation
Converse 5.0.3 over external "cdn" setup
(both with minified js+css)

converse.initialize({
debug: true,
authentication: 'login',
bosh_service_url: 'https://example.de/http-bind',
locked_domain: 'example.de',
allow_registration: false,
show_send_button: true,
roster_groups: true,
archived_messages_page_size: 25,
message_carbons: true,
theme: 'default',
view_mode: 'fullscreen'
});

Problem:
As soon as you add a MUC to your bookmarks and quit Conversejs, this message appears - see pic
If you login again immediately after logout no chat messages will be displayed.
To display received messages you need to press Ctrl+F5 when you are logged in.
It is also possible to press Ctrl+F5 after log out before you log in again.

If you delete all bookmarked MUCs, everything seems to work as usual (no "error message appears after logout).

If you need more information pls. let me know.
Pls. test Conversejs also with the current Chrome and FF browser because I got the information that "older" versions are not affected.

2019-10-02_WebChat Fullscreen_01

@ChaosKid42

This comment has been minimized.

Copy link
Contributor Author

commented Oct 4, 2019

@MotoGP-Fan: I'm quite sure that the chat boxes staying empty and the error message after logout are two different issues. The latter is already solved by 463caf3

@MotoGP-Fan

This comment has been minimized.

Copy link

commented Oct 9, 2019

@ChaosKid42: Yes, you are right. After updating to Converse 5.0.4 the error message "Connection failure ..." no longer appears. But chat boxes still stay empty after Login (without reloading the page).

@ChaosKid42

This comment has been minimized.

Copy link
Contributor Author

commented Oct 9, 2019

@MotoGP-Fan: Made a pull request for my solution to the problem: #1750. However, I believe there has to be a better solution, which unfortunately I'm not capable of implementing :-)

@jcbrand

This comment has been minimized.

Copy link
Member

commented Oct 10, 2019

Trusted device off and log in

I recently updated the code to wipe messages when you log out in untrusted ode, but I see that was after this issue was created:
fdb2412

However, setting trusted to off might still be relevant here. Can you replicate the issue when trusted is on?

@ChaosKid42

This comment has been minimized.

Copy link
Contributor Author

commented Oct 10, 2019

@jcbrand If I leave the checkbox "trusted" unchecked then the chatboxes will stay empty after relogin. In case i set the checkbox to "trusted" then the chatboxes won't open at all :-(

@MotoGP-Fan

This comment has been minimized.

Copy link

commented Oct 10, 2019

@jcbrand @ChaosKid42
No matter if the checkbox is marked as trusted or not, the chatboxes stay empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.