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

Documentation improvement: Message nonce #539

Open
jchristgit opened this issue Apr 19, 2024 · 1 comment
Open

Documentation improvement: Message nonce #539

jchristgit opened this issue Apr 19, 2024 · 1 comment

Comments

@jchristgit
Copy link
Collaborator

Our message struct has a lot of fields, and most of them are just a waste of
memory, processing power, and my energy.

One field whose purpose, besides wasting memory, processing power and my
energy, is unclear to me, is the nonce field of the message struct. The
documentation helpfully states:

Validates if a message was sent

As a user, this explains nothing. It can be a string or it can be nil. If it
is a string, does it contain a written, GPG-signed confirmation from Jason
Citron that the message was successfully sent? Does he manually sign these by
hand, or does he have a bot in the Gateway that does it for him? Is it instead
a notice of delivery stamped off by Craig's favourite cat "I don't think
favourites"? What can users expect from this? Is this even something that we
should surface to the user?

@jb3
Copy link
Collaborator

jb3 commented Apr 19, 2024

In an upcoming Discord API change, the enforcement of this parameter will become mandatory:

image

I think all we really need to do is on an outbound message attach a random string, up to 25 characters, or a snowflake that we generate. We don't need to store this, we just need to attach it to outbound messages. Of course, we should also let users override this if they desire.

We should set enforce_nonce to true to adopt the enforcement behavior before it becomes the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 1.0
Development

No branches or pull requests

2 participants