Notifications rate limiter #1671
Closes #1671 (closed)
Summary
Abstracted out the old-style cache checks for tag notifications and added a few new notification types that have been abused recently.
Testing
First, open two browsers and login to this sandbox with (users) A and B
Downvote Spam
- Make a post with A
- Downvote the post with B
- Notification should trigger for A - if sockets are down on sandbox try refreshing to see.
- With B, spam downvote, un-downvote, downvote... etc
- No more notifications should arrive for A than the first.
Tag spam
- With B, tag A in a comment.
- A should receive a notification.
- With B, spam tags to A.
- A should only have one notification.
Subscribe spam
- With B, go to A's channel and subscribe.
- With A, check the notification came through.
- With B, spam subscribe, unsubscribe, subscribe, unsubscribe ...etc
- A should only receive the initial notification.
Repeat and ensure that users that you subscribe to can still tag you multiple times.
Regression Scope
Affects the event loop that dispatches notifications, specifically notifications of types:
tag
downvote
friends
Edited by Ben