Skip to content

Conversation

@Plerx2493
Copy link
Member

@Plerx2493 Plerx2493 commented Jul 11, 2024

Summary

This pr aim to provide users with a way to inject interactions into the client which are invoked through webhooks

Notes

Everything tested, missing docs article

@Plerx2493 Plerx2493 mentioned this pull request Jul 11, 2024
36 tasks
@Plerx2493 Plerx2493 requested a review from akiraveliara July 12, 2024 11:26
@Plerx2493 Plerx2493 self-assigned this Jul 12, 2024
@Plerx2493 Plerx2493 marked this pull request as ready for review July 12, 2024 11:27
@Plerx2493
Copy link
Member Author

Should be ready to merge, not sure about the packaging of the new project and maybe its possible to reduce allocs

Copy link
Member

@akiraveliara akiraveliara left a comment

Choose a reason for hiding this comment

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

in addition to my comments, is there a reason the extension is called DSharpPlus.HttpInteraction... in the singular, but the handling code in DSharpPlus.Net.HttpInteractions is in the plural

Copy link
Member

@VelvetToroyashi VelvetToroyashi left a comment

Choose a reason for hiding this comment

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

On the surface, looks fine. I do have some other concerns, which I voiced in the libdev channel, but I've commented on immediate issues above.

# Conflicts:
#	DSharpPlus/Clients/BaseDiscordClient.cs
#	DSharpPlus/Net/Abstractions/Transport/TransportApplication.cs
{
if (this.taskCompletionSource.Task.IsCanceled)
{
throw new InvalidOperationException(
Copy link
Member

Choose a reason for hiding this comment

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

This isn't necessarily indicative of Discord closing the connection though?

Copy link
Member Author

Choose a reason for hiding this comment

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

The cancelation token should be tied to the http connection. Maybe i should add additional docs, in aspnet you get a ct which is cancled when the request is cancled

Copy link
Member Author

Choose a reason for hiding this comment

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

but in general it can be that the dev cancels the interaction with other intentions

Copy link
Member

Choose a reason for hiding this comment

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

I think velvet means that the http connection could also be closed due to other reasons, such as a random network drop?

Copy link
Member Author

@Plerx2493 Plerx2493 Jul 20, 2024

Choose a reason for hiding this comment

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

This is likely...

I think its the common case.

Copy link
Member

@Naamloos Naamloos left a comment

Choose a reason for hiding this comment

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

Generally looks good to me. Seems safe to merge when it has been tested

@akiraveliara akiraveliara merged commit 1979a57 into master Jul 25, 2024
@akiraveliara akiraveliara deleted the plerx/dev/HttpInteractions branch July 25, 2024 14:13
OoLunar pushed a commit that referenced this pull request Oct 3, 2024
* basic structure

* Improve Bindings, implement VerifySignature and implement DiscordHttpInteraction

* Add http interaction injection

* Respond to pings

* Correctly parse the interaction

* remove nested sln

* Make interaction cancelble to cancel on http request cancelation

* Add AspNetCore extension and add verifykey to DiscordApplication

* Add missing xml docs

* fix formatting, project name and csproj config

* Add PackageId

* Remove RootNamespace from csproj

* Maybe write the bytes directly, untested

* Apply namespace rename and remove unused usings

* Package description and tags and also reword method description

* explicitly add outputtype and add another package tag

* Better exception if discord closed the connection

* fix merge mistake

* remove NL

* Add CancellationToken in HandleDiscordInteractionAsync in aspnet package

* another missing ct

* and another ct

* Take ArraySegments to allow more optimizations

* XMLDocs and formatting

* add mising xmldoc

* Parse the interaction like we do it in D*spatch
Instellate pushed a commit that referenced this pull request Nov 4, 2024
* basic structure

* Improve Bindings, implement VerifySignature and implement DiscordHttpInteraction

* Add http interaction injection

* Respond to pings

* Correctly parse the interaction

* remove nested sln

* Make interaction cancelble to cancel on http request cancelation

* Add AspNetCore extension and add verifykey to DiscordApplication

* Add missing xml docs

* fix formatting, project name and csproj config

* Add PackageId

* Remove RootNamespace from csproj

* Maybe write the bytes directly, untested

* Apply namespace rename and remove unused usings

* Package description and tags and also reword method description

* explicitly add outputtype and add another package tag

* Better exception if discord closed the connection

* fix merge mistake

* remove NL

* Add CancellationToken in HandleDiscordInteractionAsync in aspnet package

* another missing ct

* and another ct

* Take ArraySegments to allow more optimizations

* XMLDocs and formatting

* add mising xmldoc

* Parse the interaction like we do it in D*spatch
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