-
Notifications
You must be signed in to change notification settings - Fork 422
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
Duplicated messages in mam_message
#4128
Comments
Hi, Do you use groupchats? |
Thanks for the quick response!
I can't say for sure, but I don't see anything about retries in the documentation. I also grepped xmpp.js source code for Then again, I recall this issue happening in a dockerised setup running locally, so I don't know how messages could be getting lost on the network.
When this happened locally, I could never spot anything suspicious in MongooseIM's logs, unfortunately.
Nope. Just PMs. |
OK, now go to the messages and check if the id attribute is different. If
it is different - it is done by the client, nothing server could do wrong.
But if id is the same- we are having issues.
<message id=this_one ...
pt., 22 wrz 2023, 11:17 użytkownik DoxasticFox ***@***.***>
napisał:
… Thanks for the quick response!
Check if your library tries to send messages again on the failure.
I can't say for sure, but I don't see anything about retries in the
documentation. I also grepped xmpp.js source code for retr and saw
nothing about retries/retransmitted messages. But I see stream management
messages coming from the library when I inspect the websocket connection in
my browser, so if xmpp.js was following XEP-0198 properly, it should ack
re-transmitted messages and re-transmit them if necessary. I wonder if it
could be an issue with their stream management implementation.
Then again, I recall this issue happening in a dockerised setup running
locally, so I don't know how messages could be getting lost on the network.
Check mongooseim logs - maybe something interesting would be there.
When this happened locally, I could never spot anything suspicious in
MongooseIM's logs, unfortunately.
Do you use groupchats?
Nope. Just PMs.
—
Reply to this email directly, view it on GitHub
<#4128 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE4GNFF2SZM3DWOBMNXZF3X3VJTNANCNFSM6AAAAAA5CIFI64>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
It's different. I also disabled stream management on the server and the problem seems to be gone. Gonna close this issue. Thanks for the help! |
I have experienced a very similar issue, and likewise when I disable stream management on the server the problem stops. My guess is that when the client goes offline or maybe when the client does not ack the mam history replies, MongooseIM duplicates the mam messages. But I was not able to have a minimal reproducing scenario so far. Like @DoxasticFox I am writing my own client, so it is entirely possible that there is something wrong in the behaviour of my code or the library that I use (StanzaJS). But for sure neither the sending nor receiving client send those messages multiple times, so even if the client is misbehaving, this does not justify make mutliple (this can be thousands of them) copies of mam messages. Can this issue be re-opened or do you prefer that I open a new one? |
I'm using the docker image
mongooseim/mongooseim:6.1.0-5-gabdcd0b48
. I haveJOIN_CLUSTER=false
set in the environment.I'm not sure if this is a server or client issue, or if it's a bug or misconfiguration, but I'm seeing lots of duplicated messages in MAM. The problem is much worse in the
I
direction, but it happens in theO
direction too. It only happens for some messages.Expand
I find it curious that the numbers are typically close to powers of two. Whatever process is causing duplication seems to iteratively double the number of messages.
I realise that
search_body
might contain commonly used messages like "hi". But I've manually inspected the messages from the above query and can confirm that there's many long message bodies which were repeated.If I
group by
message
instead ofsearch_body
, I only see duplicated messages in theI
direction. I think this is because IDs are getting generated and added to themessage
s:Expand
When I query MAM, I see that the repeated messages have been given different Stanza IDs:
Expand
The IDs
cPp52686afMUyN1mC4qT4PRLs2KbdOBNaS9pYwrP
andF9CCtP3kLRnLC7hnzeHrHD2MhLPRwQFfQIh56cjx
are generated by my XMPP client. I'm using xmpp.js to write my own client, so I'm very open to the idea that this is a client-side issue. But I also don't understand how a client-side problem could cause duplication in both theI
andO
directions.mongooseim.toml
:Expand
The text was updated successfully, but these errors were encountered: