Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8735339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:01:54+00:00 2026-06-13T10:01:54+00:00

We have about 3-5 XHR requests on mobile page – and sometimes part of

  • 0

We have about 3-5 XHR requests on mobile page – and sometimes part of them not working, only on real devices, only on slow connection. I want to improve sustainability of our mobile web application.

So my question is.. How to emulate edge connection, that randomly brokes?

In emulators like MobiOne – connection speed limit work, but connection has desktop stability – so everything just work slowly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:01:55+00:00Added an answer on June 13, 2026 at 10:01 am

    Why not write a unit test? You could create a mock/spy for your xhr function. In doing so you could forcefully break various ajax based components predictably. This forces you to always account for dropped connections by doing things like just trying again, and making sure load screens and messages appear when things fail.

    I think by taking those steps you are creating a more fool proof application. A bad connection emulator will just prove to you that things are unpredictable. If you were to fix one thing then then next time you run the emulator it would simply find something else wrong infinitely.

    Here is an example using jasmine/jquery:

    it("Will allow failed ajax events", function() {
        var dfd = $.Deferred();
        spyOn($, "ajax").andReturn(dfd);
        dfd.reject(); // calls all failed events
    });
    
    it("Will allow done ajax events", function() {
        var dfd = $.Deferred();
        spyOn($, "ajax").andReturn(dfd);
        dfd.resolve(); // calls all done events
    });
    

    Your source could look something like this:

    $.get("url").then(function() { 
        //done
    }, function () {
        //fail
    });
    

    or

    $.ajax("url")
        .done(function() {})
        .fail(function() {});
    

    or

    var dfd = $.post("url");
    $.when(dfd).done(fn).fail(fn);
    

    That could test individual ajax events. You could also try to generalize some default behavior potentially.

    If you aren’t using jquery you can still use deferreds. There are other deferred libraries out there or you can just grab dfd from jquery source, which should help with all this. If you are using some other XHR or something home brewed you should be able to integrate the 2 by always returning dfds and resolving or failing them at their normal callbacks.

    Lastly, to actually test the functionality of your app, just replace the normal urls temporarily with something that won’t work. And observe how your app reacts. If all your URLs are incorrect that should basically simulate no internet connection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have about 20 grid views that I have to create. All of them
I have the following script which does not work 100%, it returns about 20
I have a couple of XHR requests, which are handled by the Mootools Request
I read about JSON from internet but still i have not got the grasp
I have found this information on the web about jquery ajax requests. load() :
I have created a page which is autorefreshing via ajax requests. On this page
I have about 50 arrays filled with numbers and I have to report out
i have about 60 fragments ListFragment , now i use each Listfragment with another
I have about 8 entities that all have a one to one relationship with
i have about 20 possible exception messages that i want thrown when an error

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.