Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

Plerx2493
Copy link
Member

@Plerx2493 Plerx2493 commented Sep 20, 2023

Summary

Rewoks the whole rest client to be faster and slightly more accurate

Details

  • switches from internally using Task to ValueTask
  • completely reworks the entire request handling model
  • respects which endpoints are exempt from the global rate limit
  • annotates the entire API client for nullability

Future Notes

this PR does NOT update the rest client to match the current API specification yet, that work will have to be done in a later PR

@akiraveliara akiraveliara changed the title Fix/consolidate rest consolidate and improve internal rest infrastructure Sep 20, 2023
@akiraveliara akiraveliara mentioned this pull request Sep 20, 2023
36 tasks
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0"/>
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="7.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1"/>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all"/>
Copy link
Member

Choose a reason for hiding this comment

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

re-add SourceLink, required for our docs bot to function iirc

Copy link
Member

@themonarchoftime themonarchoftime left a comment

Choose a reason for hiding this comment

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

LGTM, besides one small nitpick

@akiraveliara akiraveliara merged commit 851632e into master Sep 29, 2023
@akiraveliara akiraveliara deleted the fix/consolidate-rest branch September 29, 2023 11:18
@Plerx2493 Plerx2493 added this to the v5.0 milestone Oct 11, 2023
OoLunar pushed a commit that referenced this pull request Oct 3, 2024
* rearrange rest request objects

* the ratelimit buckets are no longer bloatware

* the arrival of the -gods- new ratelimiter

* de-bloat the bucket even further and get rid of S.R.IS inclusion

* kill dead code and reformat SessionBucket

* clean up the rest client

* update BadRequestException throwing

* throw UnauthorizedExceptions correctly

* use the regex generator

* finish up the exceptions

* administer file scoped namespaces upon DiscordApiClient.cs

* sort endpoints alphabetically

* format and update the DiscordApiClient prelude

* make QueryUriBuilder fit for the purpose

* fix another merge conflict

* dotnet format

* target-typed new
and use pre-computed count properties instead of Enumerable.Count()

* missed another merge conflict

* update DiscordApiClient.cs, guild region, to the new system

* fix this url

* clean up stickers

* Update first method

* i knew i missed smth

* nullability on a payload

* Region Channel reworked

* Region Threads reworked

* Region Member reworked

* Region Roles reworked

* Region Prune, GuildVarious, Invite, Connections, Voice, Webhooks reworked

* Region Reactions, Emoji, Application Commands, Misc and the rest (pun intended) reworked

* nullability annotate the API client

* fix build errors in corelib

* fix a build error in the channel description tool

* fix build errors for DSP.Rest

* dispose of JsonDocuments as required

* re-add Microsoft.SourceLink.GitHub back into project

* re-added sourcelink reference

* use strings instead of uri in infra

* Uris to strings and fix one outlier

* fix routes

* actually set the base uri

* Use global Base_Uri

* engineer the url manually

* log uris correctly

* erm

* correct the query uri builder

* fix another conflict

---------

Co-authored-by: akiraveliara <akiraveliara@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.