discourse/app/assets/javascripts
Sam 32393f72b1
PERF: backoff background requests when overloaded (#10888)
When the server gets overloaded and lots of requests start queuing server
will attempt to shed load by returning 429 errors on background requests.

The client can flag a request as background by setting the header:
`Discourse-Background` to `true`

Out-of-the-box we shed load when the queue time goes above 0.5 seconds.

The only request we shed at the moment is the request to load up a new post
when someone posts to a topic.

We can extend this as we go with a more general pattern on the client.

Previous to this change, rate limiting would "break" the post stream which
would make suggested topics vanish and users would have to scroll the page
to see more posts in the topic.

Server needs this protection for cases where tons of clients are navigated
to a topic and a new post is made. This can lead to a self inflicted denial
of service if enough clients are viewing the topic.

Due to the internal security design of Discourse it is hard for a large
number of clients to share a channel where we would pass the full post body
via the message bus.

It also renames (and deprecates) triggerNewPostInStream to triggerNewPostsInStream

This allows us to load a batch of new posts cleanly, so the controller can
keep track of a backlog

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2020-10-13 16:56:03 +11:00
..
admin FIX: Observers weren't working on admin email logs 2020-10-09 16:27:22 -04:00
confirm-new-email DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
discourse PERF: backoff background requests when overloaded (#10888) 2020-10-13 16:56:03 +11:00
discourse-common REFACTOR: Support bundling our admin section as an ember addon 2020-09-22 15:14:29 -04:00
docs DEV: enforces eslint’s curly rule to the codebase (#10720) 2020-09-22 16:28:28 +02:00
ember-addons DEV: Remove ember-addons (#9559) 2020-04-28 10:14:49 -04:00
locales DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
pretty-text FIX: empty highlighted_languages resulted in ["", "auto", "nohighlight"] (#10772) 2020-09-29 14:34:46 +02:00
select-kit FIX: ensures category chooser is working with non english char (#10866) 2020-10-08 13:10:09 +02:00
wizard REFACTOR: Use imports for sinon and setResolver 2020-10-09 13:54:54 -04:00
activate-account.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
admin.js.erb
app-boot.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
application.js REFACTOR: Remove Discourse.__widget_helpers 2020-08-06 14:35:46 -04:00
auto-redirect.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
browser-detect.js Improve support for old browsers (#9515) 2020-04-29 21:40:21 +03:00
discourse-loader.js REFACTOR: Use imports for sinon and setResolver 2020-10-09 13:54:54 -04:00
discourse-shims.js Create proper shim for xss library - second attempt 2020-09-15 10:42:51 -04:00
embed-application.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
ember_include.js.erb
ember_jquery.js Revert "Revert "DEV: Import MessageBus from message-bus-client instead of globals"" 2020-05-28 08:42:36 -04:00
env.js
google-tag-manager.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
google-universal-analytics.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
handlebars-shim.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
main_include_admin.js REFACTOR: Support bundling our admin section as an ember addon 2020-09-22 15:14:29 -04:00
markdown-it-bundle.js REFACTOR: Do not rely on module order for discourse-markdown loading 2020-09-18 13:31:55 -04:00
onpopstate-handler.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
polyfills.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
pretty-text-bundle.js Create proper shim for xss library - second attempt 2020-09-15 10:42:51 -04:00
print-page.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
service-worker.js.erb FIX: Bypass serviceworker cache for auth routes 2020-03-31 14:24:02 -03:00
set-prototype-polyfill.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
start-discourse.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
template_include.js DEV: Support for import Handlebars from 'handlebars'; (#9600) 2020-04-30 16:41:02 -04:00
test-shims.js REFACTOR: Use imports for sinon and setResolver 2020-10-09 13:54:54 -04:00
vendor.js REFACTOR: Remove $.cookie in favor of a local library based on it (#10548) 2020-08-27 14:07:51 -04:00
widget-runtime.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
wizard-application.js Revert "Revert "Merge branch 'master' of https://github.com/discourse/discourse"" 2020-05-23 00:56:13 -04:00
wizard-shims.js FIX: adds shims for popper in wizard (#10658) 2020-09-14 12:33:14 -04:00
wizard-start.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
wizard-vendor.js FIX: adds shims for popper in wizard (#10658) 2020-09-14 12:33:14 -04:00