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

Adds rejectRateLimitedCalls option for WebClient #599

Merged
merged 6 commits into from
Aug 7, 2018

Conversation

aoberoi
Copy link
Contributor

@aoberoi aoberoi commented Aug 4, 2018

Summary

This adds a feature for users who choose to handle rate-limited requests on their own.

By setting rejectRateLimitedCalls to true, any time the Slack Web API response with a status code 429, the WebClient#apiCall() method's returned Promise will reject (or callback will invoke) with an error. That error is a new error type, denoted by the code property, which is equal to the ErrorCode.RateLimitedError value (another top-level export).

Builds upon #596

Fixes #451

TODO

  • Tests
  • Documentation

Requirements (place an x in each [ ])

@codecov
Copy link

codecov bot commented Aug 4, 2018

Codecov Report

Merging #599 into master will increase coverage by 0.3%.
The diff coverage is 90.24%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #599     +/-   ##
=========================================
+ Coverage   88.23%   88.54%   +0.3%     
=========================================
  Files           7        7             
  Lines         408      419     +11     
  Branches       70       72      +2     
=========================================
+ Hits          360      371     +11     
  Misses         31       31             
  Partials       17       17
Impacted Files Coverage Δ
src/errors.ts 100% <100%> (ø) ⬆️
src/WebClient.ts 91.63% <90%> (+0.36%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5fafe7...5138a8b. Read the comment docs.

Copy link
Contributor

@ggruiz ggruiz left a comment

Choose a reason for hiding this comment

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

no problems i see here 👍

@aoberoi aoberoi merged commit ba5d1b4 into slackapi:master Aug 7, 2018
@aoberoi aoberoi deleted the reject-retries branch August 7, 2018 01:17
medoror added a commit to medoror/slackstats that referenced this pull request Jul 27, 2020
* Rate limiting is still weird.
  Look at this for more information: slackapi/node-slack-sdk#599
  slackapi/node-slack-sdk#669
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.

2 participants