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

fix(rest)!: Fix Basic OAuth2 queues and add method for updating the queues and ratelimit paths after a refresh #3185

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

Fleny113
Copy link
Contributor

@Fleny113 Fleny113 commented Nov 13, 2023

This pull request addresses 3 issues:

@github-actions github-actions bot added pkg-rest Affects the rest package t-fix A bug fix labels Nov 13, 2023
@Fleny113 Fleny113 changed the title fix(rest): Fix Basic OAuth2 queues and add method for updating the queues and ratelimit paths after a refresh fix!(rest): Fix Basic OAuth2 queues and add method for updating the queues and ratelimit paths after a refresh Nov 13, 2023
Copy link

Benchmark

Detail results of benchmarks
Benchmark suite Base (1545f01) Latest Head (30c2163)
[transformer] message cache check RSS 116.1 MB ±1% 119.33 MB ±1%
[transformer] message cache check Heap Used 117.16 MB ±1% 118.51 MB ±1%
[transformer] message cache check Heap Total 107.14 MB ±1% 106.09 MB ±1%
[transformer] old message cache check RSS 83.53 MB ±1% 80.58 MB ±1%
[transformer] old message cache check Heap Used 102.54 MB ±1% 101.45 MB ±1%
[transformer] old message cache check Heap Total 81.19 MB ±1% 79.62 MB ±1%
[Cache Plugin] RSS 0.57 MB ±2.98% 0.66 MB ±2.98%
[Cache Plugin] Heap Used 10.69 MB ±1.43% 10.65 MB ±1.44%
[Cache Plugin] Heap Total 0 MB ±0% 0 MB ±0%
rest.simplifyUrl 200752 ops/sec ±0.37% 197855 ops/sec ±1.45%
Camelize 1 event 6007 ops/sec ±0.33% 5841 ops/sec ±0.29%
Snakelize 1 event 5980 ops/sec ±0.26% 5843 ops/sec ±0.30%

Copy link

codecov bot commented Nov 13, 2023

Codecov Report

Attention: Patch coverage is 17.69231% with 107 lines in your changes are missing coverage. Please review.

Project coverage is 76.30%. Comparing base (1e6f22e) to head (3822262).
Report is 55 commits behind head on main.

Files Patch % Lines
packages/rest/src/manager.ts 6.32% 74 Missing ⚠️
packages/rest/src/queue.ts 5.71% 33 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3185      +/-   ##
==========================================
- Coverage   76.72%   76.30%   -0.43%     
==========================================
  Files         193      193              
  Lines       23384    23627     +243     
  Branches      763      747      -16     
==========================================
+ Hits        17941    18028      +87     
- Misses       5434     5588     +154     
- Partials        9       11       +2     
Flag Coverage Δ *Carryforward flag
bot 54.73% <ø> (+0.20%) ⬆️
bot-e2e 55.34% <ø> (+0.89%) ⬆️ Carriedforward from 7d04d94
bot-unit 49.50% <ø> (+0.29%) ⬆️
discordeno 8.33% <ø> (ø)
discordeno-unit 8.33% <ø> (ø)
gateway 74.78% <ø> (+0.24%) ⬆️
gateway-integration 74.78% <ø> (+0.24%) ⬆️
gateway-unit 33.06% <ø> (+0.80%) ⬆️
rest 81.92% <17.69%> (-1.73%) ⬇️
rest-e2e 27.24% <ø> (-0.10%) ⬇️ Carriedforward from 7d04d94
rest-unit 70.24% <17.69%> (-0.84%) ⬇️
types 100.00% <ø> (ø)
types-unit 100.00% <ø> (ø)
utils 83.27% <ø> (+0.06%) ⬆️
utils-unit 83.27% <ø> (+0.06%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Fleny113 Fleny113 changed the title fix!(rest): Fix Basic OAuth2 queues and add method for updating the queues and ratelimit paths after a refresh fix(rest)!: Fix Basic OAuth2 queues and add method for updating the queues and ratelimit paths after a refresh Nov 17, 2023
@github-actions github-actions bot added the t-breaking A breaking change. label Nov 17, 2023
Skillz4Killz
Skillz4Killz previously approved these changes Nov 19, 2023
@Fleny113 Fleny113 marked this pull request as ready for review November 30, 2023 21:56
@Fleny113

This comment was marked as outdated.

@Fleny113 Fleny113 self-assigned this Dec 9, 2023
@Fleny113 Fleny113 requested a review from a team as a code owner December 22, 2023 05:03
Skillz4Killz
Skillz4Killz previously approved these changes Mar 17, 2024
Copy link
Contributor

@Skillz4Killz Skillz4Killz left a comment

Choose a reason for hiding this comment

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

The PR looks good, please have this tested properly before merging but the general idea looks good to me

@Fleny113
Copy link
Contributor Author

Fleny113 commented Mar 17, 2024

The PR looks good, please have this tested properly before merging but the general idea looks good to me

I'm currently running this pr in production, atm i do not have something that uses OAuth ready to test this on (but the test scripts i made while making the code changes are working fine).
If someone wants to test the pr for themself (with or without OAuth2 related code/requests) that would be appreciated

I'm going to disable the auto-merge so this can be tested a bit more before merge

@Fleny113 Fleny113 disabled auto-merge March 17, 2024 11:26
Copy link
Member

@lts20050703 lts20050703 left a comment

Choose a reason for hiding this comment

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

LGTM! You mentioned that you disabled auto-merge so this can be tested a bit more before merge, it's been a month so what do you think?

@Fleny113
Copy link
Contributor Author

LGTM! You mentioned that you disabled auto-merge so this can be tested a bit more before merge, it's been a month so what do you think?

Didn't had the time to setup the stuff i need for the OAuth2 testing, but the bot auth is working on my prod bot. If i can today i will test it and enable auto merge accordingly

@Fleny113 Fleny113 enabled auto-merge April 20, 2024 19:16
@Fleny113
Copy link
Contributor Author

Re enabling the auto-merge as from my testing I did today it seems to be fine. It does carry over the ratelimit from the previous queue and it does change the auth header preventing the 401

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg-rest Affects the rest package t-breaking A breaking change. t-fix A bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Rest] OAuth2 bearer tokens and refresh of tokens [Rest] Full support for using multiple bot tokens
3 participants