-
Notifications
You must be signed in to change notification settings - Fork 404
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
botId required for authorization, but users.info not immediately consistent after oauth.access returns #315
Comments
botId
required for authorization, but users.info
not immediately consistent from oauth.access
I've never experienced this but, as you guessed, it looks like a consistency issue on the server-side. I hate to say this, but Slack apps have to have a workaround like the one you did to deal with the problem.
Indeed, it's better to have
I believe |
Update: Slack apps need to run an additional API call (= |
@seratch thanks for the update - so to clarify does replacing |
@pertschuk I believe so. As I haven't reproduced your situation yet, I'm not 100% sure though. |
@seratch so I had this issue some days back and the comment here helped me, |
Bolt v2.1 came out with its built-in OAuth support almost three weeks ago.
The module provides a much smoother way to implement OAuth flows so that developers no longer deal with the details mentioned in this issue. If you have feedback on the OAuth module, let us know in a new GitHub issue! Allow me to close this issue now. |
@seratch Can you please expose |
@realappie that is a good suggestion. Can you create a new issue for exporting |
@realappie I have a PR open where I am exporting |
Description
Describe your issue here.
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:
package version: 1.4.1
node version: 13.1.0
OS version(s): 10.15.1
Steps to reproduce:
users.info
using the newly acquiredbot.bot_access_token
andbot.bot_user_id
.Expected result:
I expect to get back the bot user's info to get the bot_id from user.profile.bot_id.
Actual result:
I get a
user_not_found
response. Trying again a second later, it works.Not knowing how it works under the hood, my suspicion is that this is an issue of eventual consistency. I may be hitting one server that is doing reads on an out of date database after the oauth server did the write.
My workaround is to lazily fetch the
bot_id
in theauthorize
function if it's missing, and then update the database. This could lead to database contention and is non-ideal.Other thoughts:
I would prefer to get the
bot_id
in the oauth success handler alongsidebot_user_id
, and not need to do another call.I would also like it made clear that
botId
doesn't need to be returned fromauthorize
if you passignoreSelf: false
in initialization (I think this is true but haven't tested it). I don't needignoreSelf
for my use case, so I could have saved myself a lot of trouble if I could have skipped this debugging session.#196 is related to this, but they didn't mention the problem of not being able to immediately access this info.
The text was updated successfully, but these errors were encountered: