This is a migrated thread and some comments may be shown as answers.

http ajax request fails randomly

3 Answers 81 Views
Report a bug
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Doug
Top achievements
Rank 1
Doug asked on 02 Mar 2016, 11:02 PM

I'm not sure it this is a bug or something on our web server (Apache 2.2.1) but randomly the first ajax request sent to our web server will not have a SSL_SESSION_ID.  I've printed out and compared the environment variables and there are only two that differ from a working and non working request, but I'm not sure what to make of them.

For a working connection they show up as:

HTTP_ORIGIN: https://ourservername.com

HTTP_X_REQUESTED_WITH: XMLHttpRequest

 

For a failed attempt they show up as:

HTTP_ORIGIN: file://

HTTP_X_REQUESTED_WITH: com.ourservername.mmb (mmb is the folder our app resides in)

If you wait 10 seconds and try the request a second time, it works fine, and for that session all further requests also work.  It's just the very first ones (if you wait less than about 10 seconds, it may or may not continue to fail).

It's a pretty standard request using a datasource:

 

    app.appTokenData = new kendo.data.DataSource({
        transport: {
            read: {
                url: "https://ourservername.com/cgi-bin/mmb/login.cgi",
                dataType: "json",
                type: "post",
                data: {
                    username: function () {
                        return $('#username').val();
                    },
                    password: function () {
                        return $('#password').val();
                    },
                    datacentre: function () {
                        return $('#datacentre').val();
                    }
                }
            }
        },
 ...

Has anyone had this problem, and what might correct it?

 

3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 07 Mar 2016, 10:24 AM
Hello Doug,

The issue doesn't seem related to the DataSource itself, rather to the handshake between your server and the client. You can check if the issue is related to Cordova or Kendo UI at all by creating a simple HTML page that makes an identical request to your server via jQuery.ajax.

Also, aren't you getting the SSL_SESSION_ID from the server? If you are, it is expected that it is missing in the first request from the client. In such case, you may need to make such a request on app start up, before the user triggers a login request.

Regards,
Tsvetina
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Doug
Top achievements
Rank 1
answered on 21 Mar 2016, 05:58 PM

I built a test page, and after numerous tries it appears to be working fine. If you send me an email, I will send you the link so that you can use it for your own validation.  I tried the test web page on my desktop as well as on the android phone that I use for testing.  We also use this without problems in other online (not mobile) apps that we use.

So far it appears to be a problem in either Cordova or Kendo.  BTW, it's been doing this for a long time.  I just assumed it was a problem in the testing environment, but now that I'm doing more testing on an actual device, it happens regularly there too.

0
Tsvetina
Telerik team
answered on 24 Mar 2016, 12:24 PM
Hello Doug,

You can open a support ticket if you log into your Telerik account and click the Get Support button. In the ticket you can attach your sample or send us the link to it. 

If you think the issue may be Cordova-related, you can try updating the Cordova version and checking again. 

Regards,
Tsvetina
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Report a bug
Asked by
Doug
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Doug
Top achievements
Rank 1
Share this question
or