top-gg / issues

Report bugs related to Top.gg. For feature requests: https://feedback.top.gg
35 stars 13 forks source link

Add user tag along user id in webhooks #838

Closed antoine-pous closed 2 years ago

antoine-pous commented 2 years ago

Suggestion

Currently you're not sending the tag along user id while receiving upvote through webhooks. It would be cool to have this info without having to fetch your API.

It would reduce your API load and reduce our system load too.

dev-bun commented 2 years ago

IMO it isn't really worth getting the username on vote, bearing in mind a user can change a username at any time, whilst an ID can't change.

Xetera commented 2 years ago

Voting in the future will probably send a little bit more information about the user's top.gg profile, but we won't be using or saving Discord user information aside from ID as we slowly start to move away from being a Discord-only site. I recommend looking into different caching strategies to reduce your API load instead.

antoine-pous commented 2 years ago

In fact when a user vote he have to be authenticated using Discord. When you're checking for authentication you get back the tag.

You can simply forward it through the webhook without storing it from your side. Any developer known perfectly that id's are the only trusted value.

Xetera commented 2 years ago

We don't check in with discord for every vote, authentication is done on the Top.gg side through sessions. The only platform-specific thing we store are Discord IDs. Usernames and discriminators are fetched with eventual consistency, so if we sent those values to devs there's a chance it would be inaccurate. Not to mention we will eventually stop storing them so it wouldn't make sense to do that regardless.

Luke-6723 commented 2 years ago

Also you shouldn't really rely on a non-discord service to handle your username/discriminator data. You can fetch that from your bot's cache and/or discord and cache that yourself as per discords docs