discourse/app
Kyle Zhao ffc241eb25
FIX: multiple loadScript to the same url may resolve prematurely (#6474)
This is how `loadScript(url)` currently deals with multiple concurrent requests

1. Check existing `<script>` tags, and mark existing scripts (other than the 
   input `url`) as loaded
2. Find "true" `url` of the requested resource (CDN, subfolder path, etc)
3. Check if we have loaded the resource with that "true" `url`, and resolve 
   immediately if we have
4. Otherwise insert a `<script>` tag with the "true" `url` to load it

For example, in a subfolder install:

- Input `url` = `/javascripts/script.js`
- "True" `url` = `/subfolder/javascript/script.js`

And the _very_ subtle bug here is that we should use also use the true `url` 
for step (1), because:

- Since the input and true `url` are different, we mistakenly mark the true 
  `url` as loaded in step one 
- After finding the true `url`, and setting `loaded[trueUrl] = true` in (1), we
  resolve the promise prematurely, when the resource could still be loading
2018-10-11 08:55:36 +08:00
..
assets FIX: multiple loadScript to the same url may resolve prematurely (#6474) 2018-10-11 08:55:36 +08:00
controllers FEATURE: Option to disable user presence and profile 2018-10-10 17:34:33 -04:00
helpers extract client side `Discourse` setup inline JS (#6409) 2018-10-01 21:29:04 -07:00
jobs FIX: Retry sending email in case of temporary issue. (#6375) 2018-10-04 22:56:24 +08:00
mailers FIX: Notifications shouldn't use user locale unless allow_user_locale is enabled 2018-09-05 11:44:28 +02:00
models DEV: Report the backtrace as well. 2018-10-10 17:43:42 +08:00
serializers FEATURE: Option to disable user presence and profile 2018-10-10 17:34:33 -04:00
services FEATURE: Option to disable user presence and profile 2018-10-10 17:34:33 -04:00
views Extract `discourse_javascript.html.erb` to a scrip include 2018-10-09 16:50:45 +11:00