repeated email are going when sending a msg through mobile app

repeated email are going when sending a msg through mobile app

by brami petluri -
Number of replies: 13

Hi,

When I send a message to a student, he is getting number of emails from me.

Moodle Build version : 20170824.


Please help.


Attachment Screenshot_2017-12-14-18-03-38-317.jpeg
Average of ratings: -
In reply to brami petluri

Re: repeated email are going when sending a msg through mobile app

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi,

this seems to be a local issue on your installation (or a Moodle bug that we cannot reproduce).

I suspect that it may be related to the cron task (scheduled task) that seems to be sending the same message multiple times.

Is your Moodle installed in a servers cluster?

In reply to Juan Leyva

Re: repeated email are going when sending a msg through mobile app

by Mei Ling -

Hi Juan Leyva

Our university is having the same issue now.

May i know how to check on the cron task (scheduled task) for messaging? what is the cron task name for messaging? This error only happened when the message sent via Mobile App. 

I tested on 6 users, only 1 users doesn't have this issue. 

We have 6 applications servers and 3 database servers. Each of 2 applications are connected to 1 database.  

Appreciate if you can tell me how to troubleshoot it.


Thanks.

Mei Ling




In reply to Mei Ling

Re: repeated email are going when sending a msg through mobile app

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 everyone,

sorry for the delay in answering. We're still investigating this issue, it's a tricky one. I haven't been able to reproduce it so far, so I can only guess what could be happening.

My guess is that the app sends the message to Moodle, then Moodle stores the message in the database but it doesn't answer back to the app. Maybe it takes too long to answer (so the request timeouts) or maybe something is crashing after storing the message. Taking into account the information supplied by Mei Ling, I'd vote for the second one: something is failing in the server after the message has been stored.

Since I wasn't able to reproduce the problem, I'd like to ask you to perform some tests for me, hopefully we'll be able to find and fix the issue. Please follow these steps:

  1. Follow this guide to inspect ANY WebService request (server.php), it doesn't have to be a messaging WebService request:

    https://docs.moodle.org/dev/Moodle_Mobile_debugging_WS_requests

  2. While viewing the WebService request (step 3 of the section Debugging a web service (WS) error), please select the tab "Headers" instead of "Response".

  3. At the end of this tab you should see a param named "wstoken". Please copy the value of this wstoken, you'll use it later. In the example below, you should copy the text "2f1a99...":

    network screenshot

  4. In Moodle web (not the app), search the ID of the user you were talking to when the repeated messages error happened. E.g. you can open the user profile and check the id in the URL, it should contain: profile.php?id=3.

  5. In a browser, open the following URL but replacing:

    -YOURSITE -> Put your site URL in here.
    -touserid%5D=40 ->Replace 40 by the user ID you obtained in the step 4.
    -wstoken=2f1a99cd1df64413bd3f46a74d04b13d -> Replace the value (2f1...) with the text you copied in the step 3.

    YOURSITE/webservice/rest/server.php?moodlewsrestformat=json&messages%5B0%5D%5Btouserid%5D=40&messages%5B0%5D%5Btext%5D=Test&messages%5B0%5D%5Btextformat%5D=1&moodlewssettingfilter=true&moodlewssettingfileurl=true&wsfunction=core_message_send_instant_messages&wstoken=2f1a99cd1df64413bd3f46a74d04b13d

  6. That URL will simulate the WebService request to send a message. If everything is ok, it should display something like: [{"msgid":2363}]. Please check if this response is displayed and how long does it take to display it (please remember the app's timeout is 30 seconds).

If the last step doesn't display anything, it means something is crashing. It would be great if you could debug the function send_instant_messages in /message/externallib.php.

Cheers,

Dani

In reply to Dani Palou

Re: repeated email are going when sending a msg through mobile app

by Gary Prosser -

Dani

We've had some cases where moodle app users have had messages received multiple times by recipients (those recipients are using moodle web).

I've gone through the debugging steps per your post.

Each time I've tested I get 

[{"msgid":54375}]

or similar.

I'm willing to share the rest of the output if helpful to you.

Something I noticed (no idea if relevant) in the Chrome tool was a 404 for a file check.php

Our moodle is 3.3.5+ its on a standalone server connecting to a mariadb database server on a different machine

Gary

Attachment Screenshot 2018-12-17 at 22.13.15.png
In reply to Gary Prosser

Re: repeated email are going when sending a msg through mobile app

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

Thanks Gary,

the 404 check is normal, we're checking if your site has installed the local_mobile plugin.

The response with "msgid" is the expected response, in that case the app should delete the local message and stop sending it. Do you know if the messages that were repeated had some emoji or a non-standard character?

Kind regards,

Dani

In reply to Dani Palou

Re: repeated email are going when sending a msg through mobile app

by Gary Prosser -

I was able to look at the message from one sender - it was all plain text - no inserted emoji

Is there a way to check whether the 'local message' gets deleted ?

In reply to Gary Prosser

Re: repeated email are going when sending a msg through mobile app

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

When you access a conversation in the app, if it displays a message in the end with the clock icon it means there is a message stored in the app and the app will try to send it again. After it's sent, the clock icon should disappear and be replaced by the time it was sent. If the message is duplicated (one with the time sent and the other still with the clock icon) it means the local message wasn't deleted for some reason, but it was still sent.

I'm performing some tests in different sites trying to find a reliable way to reproduce it sad

In reply to Dani Palou

Re: repeated email are going when sending a msg through mobile app

by Donny Yeo -

Dear all,


Issue solved.


Update from Vidya Mantra (Moodle Certified Partner)

"The issue was on our messaging server, there was no problem with App." - Suman Bogati (Vidya Mantra)


No further details were given by the vendor.


Regards,

Donny Yeo

Taylor's University

Malaysia

In reply to Donny Yeo

Re: repeated email are going when sending a msg through mobile app

by Gary Prosser -

In our case there is no 'messaging server' - the issue remains unresolved for us.

In reply to Dani Palou

Re: repeated email are going when sending a msg through mobile app

by Gary Prosser -

Okay thanks Dani - I'll send this an originator of repeated messages for comment.

In reply to brami petluri

Re: repeated email are going when sending a msg through mobile app

by Donny Yeo -

@brami petluri

Have this problem been fixed?

I am having similar issue.

The last message have an Clock symbol which means this last message have not been sent to the server,

Message


In reply to Donny Yeo

Re: repeated email are going when sending a msg through mobile app

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi,

can you try with the latest version of the app to see if the issue was solved?

In reply to Juan Leyva

Re: repeated email are going when sending a msg through mobile app

by Donny Yeo -

The issue had been solved by our vendor.


Issue was with their messaging server.


Regards,

Donny Yeo