Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

JS client with $.ajaxSetup userDefined setting e.g. { processData: false } which can cause SignalR ajaxSend work unexpectedly #1773

Closed
Xiaohongt opened this Issue Mar 28, 2013 · 6 comments

Comments

Projects
None yet
5 participants
Contributor

Xiaohongt commented Mar 28, 2013

Functional impact:
JS client with $.ajaxSetup userDefined setting e.g. { processData: false } which can cause SignalR ajaxSend work unexpectedly.

Here is the list of common options which can cause SignalR to break:

$.ajaxSetup({ timeout: 1 });

$.ajaxSetup({ processData: false });

$.ajaxSetup({ async: false });

We should specify these setting e.g. { processData: true} in SignalR ajaxSend function

doc for http://api.jquery.com/jQuery.ajax/

Repro:
1).you can use AspNet.Samples,
2). in Raw/Default.aspx, add in script

$.ajaxSetup({ processData: false }); 
  1. request the page using longPolling or foreverFrame or serverSentEvents transport
  2. click Broadcast button

Expected result:
SignalR still work

Actual result:
you can see that send request body become [object Object], and then its response return error

Owner

davidfowl commented Mar 29, 2013

Is this a regression?

Contributor

Xiaohongt commented Mar 29, 2013

This is not a regression

Owner

davidfowl commented Mar 29, 2013

Good, then we don't have to do it for 1.1. @Xiaohongt can you figure out what other options cause signalr to break so we can go through and fix all of them?

Contributor

Xiaohongt commented Mar 29, 2013

ok, I will add in this bug

@ghost ghost assigned NTaylorMullen May 22, 2013

Owner

DamianEdwards commented May 22, 2013

Let's go ahead and specify these values explicitly so that we can't be broken by them. Be sure to add test coverage!

NTaylorMullen added a commit that referenced this issue Jun 25, 2013

Added ajax defaults that are used to override any default ajax setups…
… to prevent our ajax communications from failing.

#1773

NTaylorMullen added a commit that referenced this issue Jun 26, 2013

Added ajax defaults that are used to override any default ajax setups…
… to prevent our ajax communications from failing.

#1773

@ghost ghost assigned muratg and Xiaohongt Jun 26, 2013

@Xiaohongt Xiaohongt closed this Jun 28, 2013

Contributor

Xiaohongt commented Jun 28, 2013

verified that JS client with $.ajaxSetup userDefined setting { processData: false }, { timeout: 1 }, { async: false }.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment