-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
🔨 Resolve prices.tf 401 issue #1283
Conversation
Reviewing it rn |
await this.setupToken(); | ||
this.setupToken() | ||
.then(() => { | ||
return PricesTfApi.apiRequest<B>(httpMethod, path, params, data, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably because of this... Let me try remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm kinda necessary tbh
I had that situtation today, so I'm watching the log in order to make something more clear. I don't think that happens because of using try-catch instead of promise's .catch() thing. |
It's okay I've found the problem. But now another problem came (but probably off-topic) |
So as I thought, it just doesn't re-request token for some reason. I'm pretty sure all was fine when I was implementing fix for v4.13.1. As I see in my Discord channel history, this strange 401 wasn't appearing on v4.13.1-v5.0.0, but appeared again at v5.0.1. I still don't know what might be reason for it, but that's the pure fact. |
For me, it started appearing on v4.11.0. |
Wait a second. Can |
You've probably cut off |
Ah dang, you're right. That might be the issue. 🤐 |
That's definitely it. There's no |
Let me try once again, and then again before this. |
That's me who was implementing it (check v4.13.1). At that time 401 was handled well, so now I knew the problem is not here. |
Yeah I'd revert. Because the function expects a promise returned but nothing is happening but a void call who knows when it'll resolve. It is likely executing out of order. If you want to keep the new form (but using callbacks blah that's what async is for) you'd need to return the promise instead of executing it as a void |
Yeah, that was before the filterAxios thing. |
Yeah gonna revert it now. Thank you :3 |
Thank you @RobotoLev! |
Might fix the issue where the bot doesn't even bother to get new JWT from prices.tf. Quite ugly tbh.