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

Activity gateway event may contain invalid snowflakes #6763

Open
TomWright opened this issue Mar 28, 2024 · 5 comments
Open

Activity gateway event may contain invalid snowflakes #6763

TomWright opened this issue Mar 28, 2024 · 5 comments
Labels
bug synced Synced to internal tracker

Comments

@TomWright
Copy link

Description

I've witnessed the GUILD_CREATE event sending through an activity with an application_id of 1. Note that this is a numerical 1, not a string.

The docs show that the data type here should be a snowflake, and the snowflake docs say that this should always be a string.

Out of 1142 activities found on my GUILD_CREATE event, the following is the one and only activity with a non-string application_id.

{
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "type": 1,
  "timestamps": {
    "start": 1711557036583
  },
  "state": "Playing Single Player",
  "session_id": "cedf635683339917672bc194bf59b35d",
  "name": "Grand Theft Auto 6",
  "id": "876e03ca62d9cfc2",
  "flags": 1,
  "details": "Grand Theft Auto VI",
  "created_at": 1711557037898,
  "assets": {
    "small_image": "mp:external/ruoyEd5pgWX_V3GB4FWCzMZyRVJZFedojHrb07B-nJA/https/media.tenor.com/ByYRHA88z_8AAAAj/bottas-crash.gif",
    "large_image": "mp:attachments/812394872392122390/1218155883431858207/gtavi.png?ex=6606a312&is=65f42e12&hm=8a29b83a446c91ea04500d265ee317709a0c3aff971e04807ee48e1b2b3b5da2&"
  },
  "application_id": 1
}

Steps to Reproduce

Sorry but I'm not sure on this one.

I assume it's related the the way the activity was created but I have no visibility of that.

This was happening for a specific guild 517776987419574272.

I am using the standard wsapi in discordgo (links further on under client and system information), listening for GUILD_CREATE events.

Expected Behavior

String values to be sent across for any fields with a snowflake data type.

Current Behavior

A numerical 1 being sent as a value for a snowflake data type, in one out of many cases.

Screenshots/Videos

No response

Client and System Information

I am using https://github.com/bwmarrin/discordgo v0.27.1.

I have adjusted to use a fork (https://github.com/TomWright/discordgo) which gets around this issue with this change:

TomWright/discordgo@2d4dd73

The client is runner under go version go1.22.1

@TomWright TomWright added the bug label Mar 28, 2024
@TomWright
Copy link
Author

Related to #6609.

@SinisterRectus
Copy link
Contributor

SinisterRectus commented Mar 28, 2024

The type difference is explained here (#1078), but does conflict with the "always" language that you quoted.

Edit: This exception applies to user provided input, so maybe it's irrelevant.

@TomWright
Copy link
Author

This will never happen with IDs that come from Discord.

It's possible that discordgo is requesting this data, but as I understand it the data is coming from discord in response to a READY request.

@lsdimagine lsdimagine added the synced Synced to internal tracker label Mar 29, 2024
@lsdimagine
Copy link

"1" is not valid application_id tho, curious how you got it ><

@TomWright
Copy link
Author

@lsdimagine I wish I could give you more information on that. I'm developing a bot for a discord server that I don't own and this activity exists there

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

No branches or pull requests

3 participants