question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enabling clear_messages_on_reconnection causes missed messages

See original GitHub issue

Describe the bug Using Converse 5.0.5, discovered with https://github.com/conversejs/converse-integration-tests

If you enable clear_messages_on_reconnection, MUC messages sent to you while you are offline/disconnected will go missing. My guess is that the clear_messages_on_reconnection code will clear some messages after the MAM/Smacks/whatever code runs.

Thinking about this, I’m not sure if we still really need this option in the first place.

For example, if you want to prevent the chat history from getting too long or if you want to avoid gaps in the chat history (for example due to MAM not returning all messages since the last cached message).

  • To prevent the chat history from getting too long, it would be better to clear messages on Converse initialization instead of _reconnection. That way there won’t be any interactions with other code.

  • The issue with MAM paging has since been fixed, afaik.

I currently use the following workaround to clear messages on Converse initizalization. Perhaps this can be added as a clear_messages_on_initizalization option?

    var arr = [];

    for (var i = 0; i < localStorage.length; i++){
        if (localStorage.key(i).substring(0,23) == 'local/converse.messages') {
            arr.push(localStorage.key(i));
        }
    }

    for (var i = 0; i < arr.length; i++) {
        localStorage.removeItem(arr[i]);
    }

To Reproduce Run https://github.com/conversejs/converse-integration-tests with clear_messages_on_reconnection: true.

:~/converse-tests$ ./test.py 
We are online! Waiting 1 second before commencing
Testing 25 online messages with disconnect delay 1..
Testing 25 offline messages with disconnect delay 1..
Traceback (most recent call last):
  File "./test.py", line 165, in checkMucMessage
    raise Exception("MUC message %s was not received" %(message))
Exception: MUC message b3df5df8b0e04a37b8f0f849b51ecd20 was not received

:~/converse-tests$ ./test.py 
We are online! Waiting 1 second before commencing
Testing 25 online messages with disconnect delay 0..
Testing 25 offline messages with disconnect delay 1..
Traceback (most recent call last):
  File "./test.py", line 165, in checkMucMessage
    raise Exception("MUC message %s was not received" %(message))
Exception: MUC message a299563b2a704ef7907842c90645dd60 was not received

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
jcbrandcommented, Dec 9, 2019

To be clear, this is proper behaviour when entering a new MUC without locally cached history, or when entering a MUC with clear_messages_on_reconnection.

The missing message isn’t permanently inaccessible. You can scroll up to load it. Now, granted… if you can’t scroll because there aren’t enough messages, then you have a problem, but that’s a different issue 😃. To fix that, we need to add a clickable link to load older messages.

But for now, if the page size is large enough, the chat area is scrollable and you can load older messages by scrolling up.

0reactions
PrakashPaulcommented, Sep 3, 2020

To be clear, this is proper behaviour when entering a new MUC without locally cached history, or when entering a MUC with clear_messages_on_reconnection.

The missing message isn’t permanently inaccessible. You can scroll up to load it. Now, granted… if you can’t scroll because there aren’t enough messages, then you have a problem, but that’s a different issue 😃. To fix that, we need to add a clickable link to load older messages.

But for now, if the page size is large enough, the chat area is scrollable and you can load older messages by scrolling up.

Hi, in my case scrollbar is present for both one-on-one chat and group chat, though for one-on-one chat scroll event triggering and calling onScroll () method. but scroll event not triggering for group chat. is there any suggestion for setting or code or fix version ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Email notifications for missed messages for organization ...
Email notifications for missed messages for organization chats and groups · Start chats and form groups with non-Kaizala users within your organization directory....
Read more >
Send and receive messages - Android Auto Help
Missed messages appear as notifications on the notification center Notification bell icon . To listen to missed message, select the notification.
Read more >
The Cost of Caring: The Powerful Impact of 'missed ...
Missed Messages directly confronts burnout from work, aimlessness in life, unrealistic parental expectations, and self-harm, but relationships ...
Read more >
MISSED MESSAGES
MISSED MESSAGES. This activity challenges students to convey data from one side of a room to another. The task starts easy, but gets...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found