App sending multiple copies of same message

App sending multiple copies of same message

by Johnny Sørensen -
Number of replies: 9

We are encountering this problem quite frequently - a student sends a message in one of our message-groups using the mobile app, and the message gets repeated after a while. Often more than once:

Screenshot of group conversation


It also happened to me (the admin), and I remember it happening after I clicked a push-notification that took me to the same conversation, but I could remember wrong.

This problem is also described in the following post:  https://moodle.org/mod/forum/discuss.php?d=362959

and here the problem was found to be their messaging server (no further explanation...). But we are using the default Airnotifier messaging server with the default moodle mobile app and pretty much all related settings are left at default, so this answer doesn't really help...

Average of ratings: -
In reply to Johnny Sørensen

Re: App sending multiple copies of same message

by Johnny Sørensen -
Update: I found out that the following error message is recorded (in Site administration > Reports > Logs) each time a message gets repeated:


But I still don't know how to fix it.... Any help? This problem is ruining the Moodle mobile app experience for our students.
In reply to Johnny Sørensen

Re: App sending multiple copies of same message

by Johnny Sørensen -
Anyone?
In reply to Johnny Sørensen

Re: App sending multiple copies of same message

by Isabel Renedo -
Picture of Moodle HQ Picture of Particularly helpful Moodlers
Hi Johnny,

Could you try the steps mentioned by Dani Palou here: https://moodle.org/mod/forum/discuss.php?d=362959#p1530200? Do you know if the messages that were repeated had some emoji or a non-standard character?

Isabel
In reply to Isabel Renedo

Re: App sending multiple copies of same message

by Johnny Sørensen -
All messages were plain text.

I followed the steps outlined by Dani in the thread you linked to and got the following, when I entered the string into my browser:
ie. no problem to be detected here....

HOWEVER, I did some debugging myself as per the guide here: https://docs.moodle.org/dev/Moodle_Mobile_debugging_WS_requests
and I found that the core_message_send_messages_to_conversation failed (i guess, since it turned red!), whenever I sent a message which ended up being repeated in the group! See the picture below:


The Preview and Response tabs were empty. Any suggestions on how to fix this?
In reply to Johnny Sørensen

Re: App sending multiple copies of same message

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Hi Johnny,

that request took more than 30 seconds to finish, and the app has a 30 seconds timeout, so it was aborted. The problem is that it was probably aborted after the message was stored in Moodle DB, that's why the message is repeated.

This could be caused by several reasons, but my guess is that it could be caused by message processors (what handles sending emails, notifications to the app, etc.).

We recently opened a tracker issue to add a timeout to Airnotifier requests (the one that sends push notifications to the app) to make sure they finish fast: https://tracker.moodle.org/browse/MDL-65970. If you're using Moodle 3.6 or 3.7, we'll try to put this fix in the next minor releases (November). You can also apply the fix to your Moodle instance manually.

It could also be caused by the message processor that sends emails. Please check that your SMTP works fine and sends the mails fast.

Hopefully this will help you solve the problem sonrisa

Cheers,
Dani
Average of ratings: Useful (1)
In reply to Dani Palou

Re: App sending multiple copies of same message

by Johnny Sørensen -
It seemed like the problem had disappeared after latest mobile app update (3.7.1), but it just happened again. @Dani do you have any suggestions on how to debug the exact cause of the problem?

Emails are sent without any problems btw.
In reply to Johnny Sørensen

Re: App sending multiple copies of same message

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Hi Johnny,

it's a tricky issue to debug, specially because it only happens sometimes.

You can try to apply this patch to your Moodle site and see if it fixes the problem. If the problem is caused by airnotifier, this patch should fix it. If it's caused by something else (e.g. the SMTP server) then it can still happen.

Cheers,
Dani
In reply to Dani Palou

Re: App sending multiple copies of same message

by Johnny Sørensen -
I updated the website to Moodle 3.7.2 ten days ago, and up until today, the error was nowhere to be seen.

However, I just noticed that a message I sent two day ago got repeated yesterday at 22:30...

My website is hosted at one.com and I am using their standard provided SMTP server details... Could you explain how the SMTP server (which deals with emails) could be related to this problem?

And should I try switching SMTP Server in Site administration > Server > Email > Outgoing mail configuration to eg. an external SMTP provider?
In reply to Johnny Sørensen

Re: App sending multiple copies of same message

by luc bijnens -

Have you made any progress, Johnny?

I am experiencing exactly the same problem.