[REL] possible fix for not responsive join button, ajax ubernet calls

Discussion in 'Released Mods' started by cola_colin, March 10, 2015.

  1. cola_colin

    cola_colin Planetary Moderator

    Messages:
    11,887
    Likes Received:
    15,984
    This is actually an extension that is part of PA Stats, though it is disabled by default.
    Also actually it is a workaround, the real bug hides too well.

    Since I put the chat into PA Stats I've seen numerous reports of people who could for still not fully understood reasons not join games. Debugging shows that there seems to be a bug somewhere in the code that handles the talking to the ubernet webservices and for a some people being in the global PA Stats stats causes all those requests to stall for minutes. To fix this PA Stats now offers the ability to switch to ajax for most ubernet communication. This is a setting in the PA Stats settings tab you need to enable by yourself, the default is off.

    Basically whenever you seem to have an issue where you cant join any game because the join button does not do anything you can try this setting. It may or may not help, but I hope in some cases, especially the ones caused by PA Chat, it will help.

    So @mabn @blackangellol @edwood @buckfast9 if I remember correctly you are all candidates for this. Try to enable it and report back.

    This touches not only the join call but a quite a few other calls as well, as the issue I was looking it actually blocked all ubernet communication. That means affected people could not update their friendlist correctly, could not list replays, could not start a game, could not get the current version of their client for patch warning.

    Not touched are account creation calls and everything from the armory (buy commander...), as I cannot test them (or not without buying commanders a few dozen times for tests xD). So if you want to buy commanders try to do it with all mods disabled if it doesn't work.
    I also do not change the handling of authenticate calls, as I have never seen them make issues, probably because they are called first before anything else.

    Notice I have not done 100% testing on this. I am now running it in my PA and so far everything seems to work fine, but we'll see.

    This may also help people to understand some of the ubernet webservices, see this file:
    https://github.com/pamods/uimod-pa_stats/blob/master/pa_stats/lib/ajax_ubernet.js

    @masterdigital @jorgenpt @jables
    I am seeing a weird behavior that may or may not be my fault with https://4.uberent.com/GameClient/UpdateUserCustomData
    This call seems to run through fine, however it sets the Response Header "Content-Type" to "application/json" and then proceeds to return an empty string. An empty string is not valid json. Is this intended? My fault? A source for bugs? jQuery explicitly says it doesn't like empty strings in that situation: "As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)"
    In my debugging proxy the original requests to UpdateUserCustomData tended to stay open for a very long time, it looked buggy. Maybe that is related. Or maybe I am seeing ghosts. Dunno how your code handles an empty string where a piece of json is expected. Mine threw weird exceptions ;)
    Last edited: March 10, 2015
    EdWood likes this.
  2. cola_colin

    cola_colin Planetary Moderator

    Messages:
    11,887
    Likes Received:
    15,984
  3. cola_colin

    cola_colin Planetary Moderator

    Messages:
    11,887
    Likes Received:
    15,984
  4. mabn

    mabn Member

    Messages:
    45
    Likes Received:
    41
    I'm not aware of any proxy, but who knows, maybe there's a transparent one.
    I used the new option and it seems to be fixing the problem - I'll test some more tomorrow.
    cola_colin likes this.
  5. cola_colin

    cola_colin Planetary Moderator

    Messages:
    11,887
    Likes Received:
    15,984
  6. mabn

    mabn Member

    Messages:
    45
    Likes Received:
    41
  7. cola_colin

    cola_colin Planetary Moderator

    Messages:
    11,887
    Likes Received:
    15,984
    Well dunno then. I guess if using the ajax option helps then that is a good start. Uber will have to look at either using ajax for simplicity or improve their curl system to not stall on certain requests somehow.
  8. EdWood

    EdWood Active Member

    Messages:
    532
    Likes Received:
    147
    No, definitely not. I had not time last week and so far this week to check everything out, but I will as soon as possible and also contact you.
  9. tatsujb

    tatsujb Post Master General

    Messages:
    12,093
    Likes Received:
    5,237
  10. cola_colin

    cola_colin Planetary Moderator

    Messages:
    11,887
    Likes Received:
    15,984
    absolutely, if you have issues that is. If it works anyway don't try to fix it.
    tatsujb likes this.

Share This Page