Moodle for mobile

repeated email are going when sending a msg through mobile app

 
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: -