Skip to content

Conversation

@mgol
Copy link
Member

@mgol mgol commented May 5, 2014

Android 2.3 doesn't support async script tags so if the injected script tag
refers to a throwing script, the error is thrown synchronously making the
window.onerror handler to not fire. Catch the error instead.

@mgol
Copy link
Member Author

mgol commented May 5, 2014

We rely in 2.x on setting async: true on injected script tags which is not supported in Android 2.3 (it's not supported in IE9 either but apparently injected scripts are async by default there?). We can patch this test like that; of course that doesn't change that our script transport does sth different in Android 2.3 than in the rest of supported browsers.

I'm not sure if we're doing anything substantially different in 1.x, though. We set async: true there as well (apart from doing more things than on master), it's just that we later test it synchronously by setting async: false.

Android 2.3 doesn't support async script tags so if the injected script tag
refers to a throwing script, the error is thrown synchronously making the
window.onerror handler to not fire. Catch the error instead.
@gibson042
Copy link
Member

👍

@markelog
Copy link
Member

markelog commented May 6, 2014

With #1449 this change would not be required, i propose to wait until we ready to land #1449 instead

@markelog
Copy link
Member

markelog commented May 6, 2014

Hm, actually i don't see this test failure in android 2.3, tested on browserstack samsung galaxy note.

And this is the same domain right? Shouldn't this prevent script injection?

@dmethvin
Copy link
Member

dmethvin commented May 7, 2014

It does look like when we switch to all-script-tag execution this won't be an issue. I think the comment in the PR isn't quite right since if it's a local request and going through XHR. Maybe globalEval isn't getting its errors caught by window.onerror on old Android?

@markelog
Copy link
Member

markelog commented May 7, 2014

@dmethvin did you check this test in android? Do you see a failure?

@mgol
Copy link
Member Author

mgol commented May 7, 2014

@markelog

Hm, actually i don't see this test failure in android 2.3, tested on browserstack samsung galaxy note.

It shows up in TestSwarm & locally for me in the Android emulator.

@dmethvin

Maybe globalEval isn't getting its errors caught by window.onerror on old Android?

@markelog

And this is the same domain right? Shouldn't this prevent script injection?

Right, it might be related to globalEval, I mis-described it, good catch. I'll wait and test it after #1449 is merged then.

@markelog
Copy link
Member

markelog commented May 7, 2014

@mzgol testswarm? you mean on http://swarm.jquery.org/project/jquery?

locally

It doesn't for me, could you check on the browserstack and make a screenshot?

@mgol
Copy link
Member Author

mgol commented May 7, 2014

@markelog

testswarm? you mean on http://swarm.jquery.org/project/jquery?

No; Androids are tested at http://swarm.jquery.org/project/jqueryweekly.

On TestSwarm it just hangs always at this test; see http://swarm.jquery.org/result/1810062 & http://swarm.jquery.org/result/1816812.

I don't have a screenshot at hand, I can shoot one later.

@markelog
Copy link
Member

markelog commented May 7, 2014

How about http://swarm.jquery.org/result/1822771 or http://swarm.jquery.org/result/1816951, could it be server related problem?

@mgol
Copy link
Member Author

mgol commented May 7, 2014

How about http://swarm.jquery.org/result/1822771 or http://swarm.jquery.org/result/1816951

These are runs from 1.x-master, not master; in the former the problem doesn't exist.

@markelog
Copy link
Member

markelog commented May 7, 2014

Now this explains the -

Hm, actually i don't see this test failure in android 2.3

Screenshot is no longer required, thank you @mzgol

@mgol
Copy link
Member Author

mgol commented May 7, 2014

BTW, this might show one of the issues we have with TestSwarm stability. It should just error on this test in the same way as the test locally does and not timeout the whole TestSwarm job instead. Maybe sth similar is causing non-deterministic issues with other tests?

@mgol
Copy link
Member Author

mgol commented Jun 16, 2014

@dmethvin

It does look like when we switch to all-script-tag execution this won't be an issue.

Unfortunately, the failures didn't disappear, see: http://swarm.jquery.org/job/3169 (I force-run the test to check if it helped).

@dmethvin
Copy link
Member

Maybe Android 2.3 doesn't fire window.onerror for dynamically included scripts that fail? You'd certainly think it should.

@mgol
Copy link
Member Author

mgol commented Jun 16, 2014

@dmethvin

Maybe Android 2.3 doesn't fire window.onerror for dynamically included scripts that fail? You'd certainly think it should.

Yeah, this PR will most likely be wrong after rebasing; I'll check what can be done.

@gibson042
Copy link
Member

@mzgol I think this should close, but will leave for your confirmation.

@mgol
Copy link
Member Author

mgol commented Sep 4, 2014

The problem still exists and will need a workaround (see http://swarm.jquery.org/result/2048250) but it'll now have to be different anyway so I'm closing this PR.

@mgol mgol closed this Sep 4, 2014
mgol added a commit to mgol/jquery that referenced this pull request Jul 8, 2015
Android 2.3 doesn't fire the window.onerror handler, just accept the reality
there and skip the test.

Refs jquerygh-1573
mgol added a commit to mgol/jquery that referenced this pull request Jul 8, 2015
Android 2.3 doesn't fire the window.onerror handler, just accept the reality
there and skip the test.

Refs jquerygh-1573
Fixes jquerygh-2457
mgol added a commit to mgol/jquery that referenced this pull request Jul 8, 2015
Android 2.3 doesn't fire the window.onerror handler, just accept the reality
there and skip the test.

Refs jquerygh-1573
Fixes jquerygh-2457
@mgol
Copy link
Member Author

mgol commented Jul 8, 2015

A new issue: #2457 and PR: #2458.

mgol added a commit to mgol/jquery that referenced this pull request Jul 8, 2015
Android 2.3 doesn't fire the window.onerror handler, just accept the reality
there and skip the test.

Refs jquerygh-1573
Fixes jquerygh-1786
mgol added a commit to mgol/jquery that referenced this pull request Jul 28, 2015
Android 2.3 doesn't fire the window.onerror handler, just accept the reality
there and skip the test.

Refs jquerygh-1573
Refs jquerygh-1786
Refs jquery/jquery.com#108
mgol added a commit that referenced this pull request Jul 28, 2015
Android 2.3 doesn't fire the window.onerror handler, just accept the reality
there and skip the test.

Refs gh-1573
Refs gh-1786
Refs jquery/jquery.com#108
Closes gh-2458
mgol added a commit that referenced this pull request Jul 28, 2015
Android 2.3 doesn't fire the window.onerror handler, just accept the reality
there and skip the test.

(cherry-picked from 6044fb6)

Refs gh-1573
Refs gh-1786
Refs jquery/jquery.com#108
Closes gh-2458
riichard pushed a commit to riichard/jquery that referenced this pull request Sep 20, 2015
Android 2.3 doesn't fire the window.onerror handler, just accept the reality
there and skip the test.

Refs jquerygh-1573
Refs jquerygh-1786
Refs jquery/jquery.com#108
Closes jquerygh-2458
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants