Moodle for mobile

repeated email are going when sending a msg through mobile app

 
Picture of brami petluri
repeated email are going when sending a msg through mobile app
 

Hi,

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

Moodle Build version : 20170824.


Please help.



 
Average of ratings: -
Picture of Juan Leyva
Re: repeated email are going when sending a msg through mobile app
Core developersMoodle HQParticularly helpful MoodlersPlugin developersTesters

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?

 
Average of ratings: -
Picture of Mei Ling
Re: repeated email are going when sending a msg through mobile app
 

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




 
Average of ratings: -
Picture of Dani Palou
Re: repeated email are going when sending a msg through mobile app
Core developersMoodle HQParticularly helpful MoodlersPlugin 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

 
Average of ratings: -
Picture of Gary Prosser
Re: repeated email are going when sending a msg through mobile app
 

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


 
Average of ratings: -
Picture of Dani Palou
Re: repeated email are going when sending a msg through mobile app
Core developersMoodle HQParticularly helpful MoodlersPlugin 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

 
Average of ratings: -
Picture of Donny Yeo
Re: repeated email are going when sending a msg through mobile app
 

@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


 
Average of ratings: -