Skip to content

Commit

Permalink
Move uriSuffix extraction into lift_ajaxHandler.
Browse files Browse the repository at this point in the history
By having it in doAjaxCycle, there were situations where the uri suffix
could get lost. The most obvious one was when a long-running ajax
request was occurring, and two AJAX requests were queued during that
time frame. This would result in the first request getting the second
request's uriSuffix, and the second request getting no suffix at all.

We now immediately put the uriSuffix into the sending data when
lift_ajaxHandler is called.
  • Loading branch information
Shadowfiend committed Sep 24, 2012
1 parent 9714074 commit c9279a4
Showing 1 changed file with 6 additions and 5 deletions.
Expand Up @@ -47,6 +47,12 @@ object ScriptRenderer {
toSend.onFailure = theFailure;
toSend.responseType = responseType;
if (liftAjax.lift_uriSuffix) {
theData += '&' + liftAjax.lift_uriSuffix;
toSend.theData = theData;
liftAjax.lift_uriSuffix = undefined;
}
liftAjax.lift_ajaxQueue.push(toSend);
liftAjax.lift_ajaxQueueSort();
liftAjax.lift_doCycleQueueCnt++;
Expand Down Expand Up @@ -161,11 +167,6 @@ object ScriptRenderer {
liftAjax.lift_actualJSONCall(aboutToSend.theData, successFunc, failureFunc);
} else {
var theData = aboutToSend.theData;
if (liftAjax.lift_uriSuffix) {
theData += '&' + liftAjax.lift_uriSuffix;
aboutToSend.theData = theData;
liftAjax.lift_uriSuffix = undefined;
}
liftAjax.lift_actualAjaxCall(theData, successFunc, failureFunc);
}
}
Expand Down

1 comment on commit c9279a4

@fmpwizard
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Please sign in to comment.