This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MM-12630 Adding debounce to prevent client breaking for very high rate channels. #2041
MM-12630 Adding debounce to prevent client breaking for very high rate channels. #2041
Changes from all commits
a4a51b0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other thing here, do we know how much of a difference this will have dispatching once vs dispatching repeatedly? I've changed the
RECEIVED_POSTS
action from the original code into a new action (something likeRECEIVED_NEW_POST
although that name is already taken) that only takes a single post with some of my scrolling-related changes, and I'm wondering if I'll need to add a newRECEIVED_NEW_POSTS
action as wellThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Batching was required to get the performance increases when this code actually fires. Otherwise you get lots of redux updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we do this without dumping the entire queue of posts when it becomes overloaded? It might be nice to only ignore any ones over the limit in that case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only happens when there are over 200 posts within 100ms of the previous post. Not really worried about not breaking the channel in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah breaking the channel in this case is fine. The goal of this is to not break the entire app when one channel goes nuts.