Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Modernize rate limiting of sendMessage #7325

Merged

Conversation

jangmarker
Copy link
Contributor

@jangmarker jangmarker commented Jun 24, 2017

@RocketChat/core

In the old coffee script code line 97 was return 'bot' not in user.roles, but it was converted to JavaScript to user.roles.includes('bot').

@CLAassistant
Copy link

CLAassistant commented Jun 24, 2017

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@geekgonecrazy geekgonecrazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First off thanks for contributing! Second, i'd like to suggest doing based on permission instead of on role.

@jangmarker
Copy link
Contributor Author

@geekgonecrazy Thanks for your review, also of #7326. This was already based on role before, I merely fixed the port to CoffeeScript -> ECMAScript and to Rocket.Chat's own RateLimit adapter. However, I can of course port this to a permission model. Do I understand correctly that you would like to introduce a new permission, e.g. "sendMessage-rate-limit-exemption"?

- use permissions instead of roles
  (new permission is introduced)
- port to RateLimiter facade

The latter is necessary to keep tests passing.
@jangmarker jangmarker force-pushed the fix-rate-limitting-sendMessage branch from 0b5ad28 to eafba82 Compare July 6, 2017 07:20
@jangmarker jangmarker changed the title [FIX] Fix rate limiting of sendMessage [FIX] Modernize rate limiting of sendMessage Jul 6, 2017
@rodrigok rodrigok added this to the 0.57.3 milestone Jul 14, 2017
@rodrigok rodrigok merged commit 5b04c2b into RocketChat:develop Jul 14, 2017
@rodrigok
Copy link
Member

Thanks @jangmarker

rodrigok added a commit that referenced this pull request Aug 8, 2017
[FIX] Modernize rate limiting of sendMessage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants