Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Some script tags seems to loading twice #773

Closed
georgeu2000 opened this issue May 3, 2015 · 7 comments
Closed

Some script tags seems to loading twice #773

georgeu2000 opened this issue May 3, 2015 · 7 comments
Labels

Comments

@georgeu2000
Copy link

It seems that all but the first script tag is requested twice:

<html><head><script src="/foo.js"></script>
<script src="/bar.js"></script>
<script src="/baz.js"></script></head><body>Welcome to your life.</body></html>
@jferris
Copy link
Contributor

jferris commented May 4, 2015

@georgeu2000 can you paste a :webkit_debug log for that example?

@georgeu2000
Copy link
Author

Here is an updated HTML page:

<!DOCTYPE html>
<html>
  <head>
    <title>Home Page</title>
    <script src='/js/foo.js'></script>
    <script src='/js/bar.js'></script>
    <script src='/js/baz.js'></script>
  </head>

  <body>
    Welcome to the app.
  </body>
</html>
Run options: include {:focus=>true}
Finished "EnableLogging()" with response "Success()"
Wrote response true ""
Received "SetUnknownUrlMode(block)"
Started "SetUnknownUrlMode(block)"
Finished "SetUnknownUrlMode(block)" with response "Success()"
Wrote response true ""
Received "Visit(http://127.0.0.1:63047/)"
Started "Visit(http://127.0.0.1:63047/)"
Load started
"Visit(http://127.0.0.1:63047/)" started page load
Started request to "http://127.0.0.1:63047/"
Finished "Visit(http://127.0.0.1:63047/)" with response "Success()"
Received 200 from "http://127.0.0.1:63047/"
Started request to "http://127.0.0.1:63047/js/foo.js"
Started request to "http://127.0.0.1:63047/js/bar.js"
Started request to "http://127.0.0.1:63047/js/baz.js"
Received 200 from "http://127.0.0.1:63047/js/foo.js"
Started request to "http://127.0.0.1:63047/js/bar.js"
Received 200 from "http://127.0.0.1:63047/js/baz.js"
Received 200 from "http://127.0.0.1:63047/js/bar.js"
Received 200 from "http://127.0.0.1:63047/js/bar.js"
Started request to "http://127.0.0.1:63047/js/baz.js"
Received 200 from "http://127.0.0.1:63047/js/baz.js"
Page finished with true
Load finished
Page load from command finished
Wrote response true ""

All JS files are empty.

The debug seems to show the same as my Rack logging. All but the first script is requested twice.

Each time I run it, I see these logs in the same order:

Received 200 from "http://127.0.0.1:63125/js/foo.js"
Started request to "http://127.0.0.1:63125/js/bar.js"

So, is it possible that it is re-requesting remaining JS files when the first JS file is received?

BTW and FWIW, I integrated Capybara Webkit into Capybara Jasmine.

@jferris jferris added the bug label May 6, 2015
@jferris
Copy link
Contributor

jferris commented May 6, 2015

I've confirmed this locally. It appears to be an aggression introduced between 1.4.1 and 1.5.0.

@jferris
Copy link
Contributor

jferris commented May 6, 2015

@mhoran I've confirmed that the call to QWebSettings::setObjectCacheCapacities causes this. I don't know why it works this way, but it seems like disabling the cache means it needs to request assets more than once.

Given this issue and #764, I think we may need to rethink how we deal with caching. It looks like #713 and #724 were the original issues that to disabling the cache; does that sound right?

@mhoran
Copy link
Collaborator

mhoran commented May 7, 2015

Fascinating. We should probably back this change out, then.

I never experienced the behavior described in #713, but we did experience #724 at Kitchensurfing. This change resolved the issue for us, and we didn't see any of these unintended side effects. However, it seems the consequences may be worse than the original bug.

I don't think I was ever able to resolve the issue by changing any configuration in Rails itself. We tried removing the ActionController::ConditionalGet to no avail. Also, most caching configuration is set to disabled in the test environment, yet something was still causing content to be cached.

@jferris
Copy link
Contributor

jferris commented May 7, 2015

I'm thinking the best thing we can do is try to make it as similar as possible to what a recent Selenium/Firefox setup would do. I'll try adding some more Selenium parity specs and see what I can do to make things line up.

@jferris
Copy link
Contributor

jferris commented May 7, 2015

I opened #775 to address this.

@jferris jferris closed this as completed May 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants