-
Notifications
You must be signed in to change notification settings - Fork 662
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
users.profile.set can throw ratelimited errors with rejectRateLimitedCalls=false #669
Comments
@jayjanssen thanks for reporting the issue and having thorough reproduction steps. i haven't gotten a chance to reproduce it on my own just yet, but i wanted you to know that we would look into this soon. |
@jayjanssen i was able to reproduce this issue locally. i did it with a very similar program written in javascript rather than coffeescript: const { WebClient } = require('@slack/client');
const token = 'my-token';
(async () => {
const slack = new WebClient(token);
for (let _ of Array(100)) {
try {
const result = await slack.users.profile.set({
user: 'my user id',
profile: {
status_text: 'node sdk test',
status_emoji: ':robot_face:',
status_expiration: 0,
},
});
console.log(`got profile`);
console.log(result);
} catch (error) {
console.error(`got error: ${error.message}`);
}
}
})(); |
The output suggests that the SDK is receiving a response from the API that looks a little like:
Whereas the Web API client is expecting that rate limited responses look more like what the docs describe, e.g.:
I went and actually tested this, and I did notice that the I'm not really sure if this SDK should be supporting this behavior because it's completely undocumented (as far as I could research), making it feel more like a bug with the platform API. |
Sorry for the coffeescript, just what I’m most comfortable with.
I kind of suspected it was just a non-standard implementation of rate limiting. @aoberoi — I’m presuming you work for Slack? Is this just something that can be filed internally with your platform api team?
|
Yup, I work for Slack and we’ve logged this one as a bug on the platform level. I’m leaving this issue as a bug to more or less track the progress on that internal issue. Just some info for those curious, this is an internal rate limit mechanism meant for a different purpose that is “leaking” through the public API because it happens to be more aggressive of a limit than the public one. We have discussed our options and selected one. It’s just a matter of implementing it, testing it, and releasing it. I suspect that will all happen early next week. Until then, rate limiting for this one method is broken, and the work around would be to manually retry failures that result in a Also, I don’t mind the coffeescript! I’m just glad you took the time out to report your findings. |
@aoberoi absolutely no complaints about having a projected fix so quickly! I like the auto-rate limiting handling feature, I have to write it into my library wrappers for most of my other services. |
It is now "next week", for some definition of "next" 😉 @aoberoi Any update on this issue? |
@nylen the issue hasn't been fixed yet. its a medium priority right now, which means it may be several weeks before its fixed. i'll update here when i hear more. for now, i think the workaround i mentioned above should be your strategy to deal with this error. are you coming across any difficulties with this? if you're hitting the rate limit very often, we should probably discuss how you can reduce the need for your app to call that method so many times. |
This is fine for now, just unexpected and less than ideal. Thanks for the update! |
Good news friends(@nylen and others interested)! We shipped a change on Friday that fixed this issue. 🎉 I’ll close the issue now, but it would be helpful for someone who experienced it to confirm that it’s back to working as expected. |
FWIW, if you do too many |
Followup since I just hit this -- |
* Rate limiting is still weird. Look at this for more information: slackapi/node-slack-sdk#599 slackapi/node-slack-sdk#669
So far it seems we don't have an answer for the |
Nope, I'm not using the node sdk but I get the same behavior for users.profile.get endpoint. Any other issue filed that could be referenced here ? |
Description
This client claims to handle rate limiting automatically such that promises returned from API calls will block until rate limiting is bypassed with the default settings.
However, I can cause API error exceptions for 'ratelimited' by calling users.profile.set. I suspect this might be something where the API returns an (undocumented?) error that isn't coming back as a 429. Code to reproduce the problem below.
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
@slack/client
version: 4.8.0node version: 11.3.0, 10.13.0, etc.
OS version(s): any -- tested MacOS - latest and in docker: Linux f883fafeedcf 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018 x86_64 Linux
Steps to reproduce:
Expected result:
I expect the calls to get slower as rate limiting throttles me assuming I'm using rejectRateLimitedCalls = false (which is the default). This behavior would be fine with rejectRateLimitedCalls = true.
Actual result:
I get exceptions: Error: An API error occurred: ratelimited
Attachments:
Sample output:
The text was updated successfully, but these errors were encountered: