Skip to content

[FIX] Modernize rate limiting of sendMessage#7325

Merged
rodrigok merged 1 commit intoRocketChat:developfrom
jangmarker:fix-rate-limitting-sendMessage
Jul 14, 2017
Merged

[FIX] Modernize rate limiting of sendMessage#7325
rodrigok merged 1 commit intoRocketChat:developfrom
jangmarker:fix-rate-limitting-sendMessage

Conversation

@jangmarker
Copy link
Copy Markdown
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
Copy Markdown

CLAassistant commented Jun 24, 2017

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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