(bug): Every time a new message is received in messenger in real-time it copies the previous 11 or so.
Summary
This bug is driving me nuts. Please fix it asap. Every time a new message is received in messenger in real-time it copies the previous 11 or so. It is copying both sent and received messages. I think it's treating it as if it's the first time the chat window has been opened, simply loading the previous 11 sent/received messages but not realizing that those previous messages have already loaded. It should only load the new message(s).
Steps to reproduce
- Log in to your primary account in Chrome.
- Log in to your secondary account in Firefox.
- Send 13 numbered messages (test1, test2, test3, etc.) from your secondary account to your primary account.
- Send a message from your primary account to your secondary account without closing the chat window.
- Send another message from your secondary account to your primary account without closing the chat window.
Platform information
Chrome/Win10 and Firefox/Win10
What is the current bug behavior?
Every time a new message is received in messenger in real-time it copies the previous 11 or so.
What is the expected correct behavior?
It should only load the new message(s).
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
added 0 - Urgent P - Messenger T - Bug labels
added 1 - High label and removed 0 - Urgent label
changed milestone to %sprint: Remind
assigned to @benhayward.ben
added S - Backlog label
changed milestone to %sprint: Subscribers
changed weight to 5
changed milestone to %sprint: Tags
added S - InProgress label and removed S - Backlog label
added S - Follow Up label and removed S - Backlog label
added S - Backlog label and removed S - Follow Up label
added S - InProgress label and removed S - Backlog label
added S - Backlog label and removed S - InProgress label
added S - Follow Up label and removed S - Backlog label
changed milestone to %sprint: X
added S - Backlog label and removed S - Follow Up label
added S - Review label and removed S - Backlog label
added S - InProgress label and removed S - Review label
added S - Backlog label and removed S - InProgress label
- Developer
Identified an issue with Sockets that is stopping live messaging when running the site locally, which has halted progress on this bug until it can be replicated locally. @edgebal has confirmed that he also has the same issue, and found the cause to be Redis not keeping a record of the session id.
Edited by Ben Hayward added S - Follow Up label and removed S - Backlog label
changed milestone to %sprint: Zero
added S - InProgress label and removed S - Follow Up label
- Developer
The above was kindly fixed.
Investigating this shows me that the issue seems to be likely caused by sending messages too quickly.
I need to double check this on a fresh head but it appears:
- Bob sends Alice messages reading "1" and "2" in rapid succession.
- Alice's chat receives "1" first and begins to load it into the chat.
- Alice's chat receives a messages object containing the text "1" and "2" and begins to load it.
- Alice's chat adds the first 'messages' object (containing the singular "1").
- Alice's chat adds the second set of messages (containing "1" and "2").
Thus alices chat will read
1 | < first time messages come in
1 | < second time messages come in
2 | < second time messages come in
Edited by Ben Hayward added S - Review label and removed S - InProgress label
mentioned in merge request !243
mentioned in issue #385 (closed)
changed milestone to %sprint: Dapper Dingo
added S - Backlog label and removed S - Review label
- Developer
Have tried a couple of times to get to the bottom of this and propose an actual fix. I suspect the issue may be in the sockets code which I'm not well acquainted with. Going to un-assign myself, if nobody else wants to pick it up, I'll re-assign but don't feel it'd be very time effective for me.
unassigned @benhayward.ben
changed milestone to %sprint: Elevated Eagle
removed S - Backlog label
added Bug Hunter label
assigned to @eiennohi
added S - Backlog label
changed milestone to %sprint: Giddy Giraffe
added S - InProgress label
added S - Follow Up label and removed S - InProgress label
added S - Review label and removed S - Follow Up label
mentioned in merge request engine!211 (closed)
mentioned in merge request !358 (merged)
changed weight to 7
closed via merge request !358 (merged)
mentioned in commit 291c4e63