Connection error when navigation to a new page in hybrid mobile app

0
When I press a list item to navigate to the next page in a hybrid mobile app, I receive the following message: A connection error occurred, please try again later. The list item triggers a microflow which fetches data from SAP, which has to be shown on the next page. The app displays the error message stated above, but the logging revealed that the microflow is still executing. The logging also contains the following: Request POST http://192.168.0.119:8080/xas/(executemicroflow) timed out after 5000 ms. Error: Request POST http://192.168.0.119:8080/xas/(executemicroflow) timed out after 5000 ms. It seems that if the microflow does not respond within 5 seconds, this error occurs. I simulated this in a web responsive pages, and there I don't have this issue. I can’t find any Mendix runtime setting in which you can extend the timeout.
asked
1 answers
2

Hi Guido,

The Hybrid app timeout setting is defined in the cordova package unfortunately. This is not configurable from the modeller. Hybrid apps by default have a timeout of 5000ms but this can be increased. You can change this in the entry.js file in the hybrid project (assuming you downloaded this already).

The file is located at: src/www/scripts/entry.js

Add config.server.timeout = {Timeout in miliseconds} in the MxApp.onConfigReady function as shown below.
 

MxApp.onConfigReady(function(config) {
    // Perform any custom operations on the dojoConfig object here
    config.server.timeout = 30000
});

After this build your app again with the cordova command line tools and the timeout should be increased.

If you don’t know how to build a hybrid app locally follow this guide: https://docs.mendix.com/developerportal/deploy/mobileapp#1-introduction

answered