What is checkrequestsuspended calls running all the time on native app?

What is checkrequestsuspended calls running all the time on native app?

  

Hi,

While trying to find a reason for battery drain when using native app we discovered that there are calls to moduleservices/checkrequestsuspended?requestToken=********* all the time and request to empty.png file by offline module. Is there a way to reduce this call or limit them?

Thank you


Hi,


The requests to checkrequestsuspended should only happen in development, with the application compiled with debug mode enabled, after another request has timeout or taking more than what it would take for it to timeout in a production mode (it doesn't happen by itself). Also it is not triggered by resource requests, you sure there aren't any other requests beside those two?


Not sure what is that empty.png is, so I'll leave that part for another one to answer :)


Regards,
João Rosado

Hi João,

Thank you for reply.

It turns out all this calls are from offline.js library to check offline state. The weird thing is that instead of running each 5 sec for example it runs more often when application page is changed. 

I've updated the script so it doesn't check state all the time now.

But checkrequestsuspended is still there. I'm on development environment. If I understand correctly if I see it on my console it means that another request (probably run within interval) was slower than expected and I should check it, right?



Yes, the objective of that request is to determine if a request that would timeout is being debugged on the server side. 

It can also trigger if there are requests being done and you are stopped at javascript breakpoints (as the request timeout does not stop counting).


Regards,

João Rosado