Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move uriSuffix extraction into lift_ajaxHandler.

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...
commit c9279a48512dc83c14be655e40928624bbab04fe 1 parent 9714074
@Shadowfiend Shadowfiend authored
View
11 web/webkit/src/main/scala/net/liftweb/http/js/ScriptRenderer.scala
@@ -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++;
@@ -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);
}
}

1 comment on commit c9279a4

@fmpwizard
Owner

+1

Please sign in to comment.
Something went wrong with that request. Please try again.