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/models
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
..
action-summary.js FEATURE: Admins can flag posts so they can review them later. (#12311) 2021-03-11 08:21:24 -03:00
archetype.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
badge-grouping.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
badge.js UX: Add image uploader widget for uploading badge images (#12377) 2021-03-17 08:55:23 +03:00
bookmark.js DEV: Bump eslint-config-discourse (#14868) 2021-11-10 09:31:41 +10:00
category-list.js FIX: New Topic button regression in tag page (#12613) 2021-04-06 09:31:49 -04:00
category.js FIX: ensure required_tag_group_name is null if no value present (#14796) 2021-11-04 17:26:21 -04:00
composer.js DEV: Plugin API for customizing text in the composer conditionally 2021-10-08 13:58:18 -04:00
draft.js FEATURE: Cook drafts excerpt in user activity (#14315) 2021-09-14 15:18:01 +03:00
group-history.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
group.js DEV: don't swallow a promise from group.findMembers method and switch to using async/await (#13888) 2021-07-30 21:00:34 +04:00
invite.js UX: Show first unique letters in invite link (#12434) 2021-03-18 19:05:38 +02:00
live-post-counts.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
login-method.js DEV: Don't leak auth methods between tests (#14708) 2021-10-25 15:25:39 +02:00
nav-item.js DEV: Bump eslint-config-discourse (#14868) 2021-11-10 09:31:41 +10:00
permission-type.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
post-action-type.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
post-stream.js PERF: Update like count in visible posts without an extra GET per like (#14869) 2021-11-10 13:22:26 -03:00
post.js PERF: Update like count in visible posts without an extra GET per like (#14869) 2021-11-10 13:22:26 -03:00
private-message-topic-tracking-state.js FIX: Stop tracking incoming message after navigating away take 2. (#14508) 2021-10-05 15:00:44 +08:00
published-page.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
rest.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
result-set.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
reviewable-history.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
reviewable.js FIX: Load the category when the category_id attr is present. (#13621) 2021-07-02 18:25:51 -03:00
session.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
site.js FIX: Don't store translated trust level names in anonymous cache (#13224) 2021-06-01 22:11:48 +02:00
static-page.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
store.js REFACTOR: removes unused code (#13412) 2021-06-18 11:55:49 +02:00
tag-group.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
tag.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
topic-details.js DEV: Bump eslint-config-discourse (#14868) 2021-11-10 09:31:41 +10:00
topic-list.js DEV: Use Set instead of array-as-an-object (#14511) 2021-10-05 14:35:32 +02:00
topic-timer.js FEATURE: Allow durations < 1 hour and < 1 day for topic timers where duration is specified (auto delete replies, close based on last post) (#11961) 2021-02-05 10:12:56 +10:00
topic-tracking-state.js FIX: Correct tracking context for some category routes (#14685) 2021-10-25 15:05:00 -04:00
topic.js FIX: Show perma-delete in menu without refresh (#14740) 2021-11-09 11:50:45 +02:00
trust-level.js FIX: Don't store translated trust level names in anonymous cache (#13224) 2021-06-01 22:11:48 +02:00
user-action-group.js DEV: apply new coding standards (#10592) 2020-09-04 13:42:47 +02:00
user-action-stat.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
user-action.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
user-badge.js DEV: Bump eslint-config-discourse (#14868) 2021-11-10 09:31:41 +10:00
user-draft.js DEV: Sort imports alphabetically (#11382) 2020-12-01 15:31:26 -03:00
user-drafts-stream.js FEATURE: improve blank page syndrome on the user activity pages (#14311) 2021-09-16 21:35:34 +04:00
user-posts-stream.js DEV: Remove cache option from ajax() (#13142) 2021-05-31 14:41:35 +02:00
user-stream.js FEATURE: improve blank page syndrome on the user activity pages (#14311) 2021-09-16 21:35:34 +04:00
user.js DEV: Bump eslint-config-discourse (#14868) 2021-11-10 09:31:41 +10:00