discourse/app/assets/javascripts
Rafael dos Santos Silva d4e35f50c2
PERF: Update like count in visible posts without an extra GET per like (#14869)
PERF: Update like count in visible posts without an extra GET per like

Currently when a user is reading a topic and some post in it receive a
like from another user, the Ember app will be notified via MessageBus
and issue a GET to `/posts/{id}` to get the new like count. This worked
fine for us until today, but it can easily create a self-inflicted DDoS
when a topic with a large number of visitors gets a large number of
likes, since we will issue `visitors * likes` GET requests requests.

This patch optimizes this flow, by sending the new like count down in
the MessageBus notification, removing any need for the extra request.

It shouldn't cause any drift on the count because we send down the full
count instead of the difference too.

Possible follow-ups could include handling like removal.
2021-11-10 13:22:26 -03:00
..
admin FEATURE: Add read-only scope to API keys (#14856) 2021-11-10 17:48:00 +02:00
confirm-new-email
discourse PERF: Update like count in visible posts without an extra GET per like (#14869) 2021-11-10 13:22:26 -03:00
discourse-common DEV: Allow replacing share icons separately (#14774) 2021-10-29 13:35:27 -04:00
discourse-hbr DEV: Prevent npm usage (#13945) 2021-08-04 22:04:58 +02:00
discourse-widget-hbs DEV: Prevent npm usage (#13945) 2021-08-04 22:04:58 +02:00
docs
ember-addons
locales
pretty-text FIX: Remove xlink:href to favour href due to deprecation (#14854) 2021-11-09 17:49:37 +08:00
select-kit FIX: none row doesn’t have a value, use class to target it (#14659) 2021-10-20 13:07:58 +02:00
truth-helpers DEV: Prevent npm usage (#13945) 2021-08-04 22:04:58 +02:00
wizard DEV: Replace equal() with strictEqual() (#14827) 2021-11-08 10:26:28 +01:00
.npmrc DEV: Prevent npm usage (#13945) 2021-08-04 22:04:58 +02:00
activate-account.js
admin.js.erb
app-boot.js
application.js FEATURE: save local date to calendar (#14486) 2021-10-06 14:11:52 +11:00
auto-redirect.js
browser-detect.js FIX: Feature detect globalThis (#14410) 2021-09-22 11:39:41 -03:00
browser-update.js
discourse-loader.js Revert "A11Y: Improve create account modal for screen readers (#14204)" (#14233) 2021-09-03 09:42:56 +10:00
discourse-shims.js DEV: uses forked Mousetrap to avoid leaking listeners (#14198) 2021-09-08 14:48:13 +02:00
embed-application.js
ember_include.js.erb
ember_jquery.js
env.js
google-tag-manager.js
google-universal-analytics-v3.js
google-universal-analytics-v4.js
handlebars-shim.js
main_include_admin.js
markdown-it-bundle.js
onpopstate-handler.js
package.json
polyfills.js
pretty-text-bundle.js
print-page.js
service-worker.js.erb
set-prototype-polyfill.js
start-discourse.js
template_include.js
test-shims.js
vendor.js DEV: uses forked Mousetrap to avoid leaking listeners (#14198) 2021-09-08 14:48:13 +02:00
widget-runtime.js
wizard-application.js
wizard-shims.js
wizard-start.js
wizard-vendor.js
yarn.lock DEV: Bump uppy module versions for retryable prepareUploadParts (#14629) 2021-10-18 15:28:27 +10:00