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

Clarification about removal of nonce field in Channel->Create Message endpoint #5076

Closed
MazeXP opened this issue Jun 17, 2022 · 13 comments · Fixed by #5078
Closed

Clarification about removal of nonce field in Channel->Create Message endpoint #5076

MazeXP opened this issue Jun 17, 2022 · 13 comments · Fixed by #5078
Labels

Comments

@MazeXP
Copy link
Contributor

MazeXP commented Jun 17, 2022

Description

The nonce field was removed from the Channel -> Create Message endpoint without any notice in following PR: #2859
The PR was not even closely related to thr nonce field at all.

Confusing is that most libraries are still providing access to this field even it is not documented anymore.

As well does the Message object still contain the nonce field.

Thereby I ask for clarification if the nonce field has been deprecated or was removed from the documentation by error.

Steps to Reproduce

Check documentation for Channel -> Create Message endpoint.

Expected Behavior

nonce being documented or stated that has been deprecated or removed from Channels->Create Message endpoint.

Current Behavior

nonce field is not documented for Channel->Create Message endpoint anymore

Screenshots/Videos

No response

Client and System Information

Browser: Google Chrome
OS: Windows 10

@MazeXP MazeXP added the bug label Jun 17, 2022
@MazeXP MazeXP changed the title Clarification about removal of nonce field Clarification about removal of nonce field in Channel->Create Message endpoint Jun 17, 2022
@splatterxl
Copy link
Contributor

The nonce field is used for deduplication of messages by the client and has no effect on bot messages.

@MazeXP
Copy link
Contributor Author

MazeXP commented Jun 17, 2022

I mean there could still be a use casenfor bots.
I am just asking for a proper clarification why the field is not documented any more on the Channels -> Create Message endpoint.

For example discordjs is still listing it in their API types library:
https://github.com/discordjs/discord-api-types/blob/main/rest/v10/channel.ts#L215

@devsnek
Copy link
Contributor

devsnek commented Jun 17, 2022

the field is not part of our bot api. it is ignored for bots.

@MinnDevelopment
Copy link
Contributor

I think it should also be used for deduplicating messages for bots, since the same problem happens with bots. When the request results in a bad gateway error, you have no way to know whether the message went through or not and have to retry or just hope. Why would this not be done for bots?

@Rapptz
Copy link
Contributor

Rapptz commented Jun 17, 2022

the field is not part of our bot api. it is ignored for bots.

No it isn't.

image

This field is relatively useful for pairing a message received with a message sent for things like ping calculations or just other use cases where you'd want to do the pairing.

@devsnek
Copy link
Contributor

devsnek commented Jun 17, 2022

ah i meant ignored for message send deduplication, which is the reason it exists in our api. if you just want it for identifying messages that could maybe be valid (feel free to open a pr) but its worth noting that the send message endpoint returns the created message with its id already.

@advaith1
Copy link
Contributor

if you just want it for identifying messages that could maybe be valid

can nonce support be added to webhooks for this? #3396

@erkinalp
Copy link

ah i meant ignored for message send deduplication,

No way to guarantee deduplication for bots? Weird.

@appellation
Copy link
Contributor

Looks like this field doesn't make sense for bots at the moment. Please file a separate feature request if you have a legitimate use-case for the nonce field.

@MinnDevelopment
Copy link
Contributor

Legitimate use-cases were brought up in the comments of this issue, and allegedly the nonce will be used to dedupe messages of bots on v11+.

@appellation
Copy link
Contributor

I agree that those use-cases merit discussion, but this issue is about the documentation which is currently accurate. While the API won't error if you send a nonce, there's no purpose in doing so.

If bot support gets added for v11+ then we can document it when that happens.

@appellation
Copy link
Contributor

I talked a bit more about this internally and it looks like we are continuing to support this without the deduplication functionality. My apologies for the confusion here, and thanks for calling it out! I'm going to leave this issue closed for now, but #5078 will be merged to fully resolve this.

@advaith1
Copy link
Contributor

advaith1 commented Sep 9, 2022

has nonce support been added to webhooks for pairing? if not, can that happen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants