This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/app
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
..
adapters DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
components FIX: Deprecated overwriting of computed property 2020-10-05 12:09:01 -04:00
controllers PERF: backoff background requests when overloaded (#10888) 2020-10-13 16:56:03 +11:00
helpers FIX: makes dashboard periods use current day and weekly 7 days (#10817) 2020-10-05 10:32:12 +02:00
initializers DEV: enforces eslint’s curly rule to the codebase (#10720) 2020-09-22 16:28:28 +02:00
lib FIX: ensures insert hyperlink works with mailto (#10867) 2020-10-08 13:16:07 +02:00
mixins FIX: Dismiss unread respects tracked query param (#10714) 2020-09-25 12:39:37 -07:00
models PERF: backoff background requests when overloaded (#10888) 2020-10-13 16:56:03 +11:00
pre-initializers DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
raw-views DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
routes DEV: enforces eslint’s curly rule to the codebase (#10720) 2020-09-22 16:28:28 +02:00
services FIX: Favicon count was not updated when window focus returned (#10875) 2020-10-09 10:51:39 +11:00
templates FEATURE - SiteSetting to disable user option to hide their profiles and presences (#10885) 2020-10-09 17:18:44 -04:00
widgets Revert "FIX: Use topic title headline in search menu result." 2020-10-02 13:12:31 +08:00
app.js DEV: Add support for api-initializers to reduce boilerplate. 2020-09-30 16:05:44 -04:00
mapping-router.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00