#GUILD_CREATE deserialization errors
1 messages ยท Page 1 of 1 (latest)
gonna get a formmated version in a sec
on second thought I probably shouldn't post all that, but what's the best approach to figuring out exactly what isn't deserializing right?
the guild create events are massive
What is the full error?
ReceiveMessageError: gateway event could not be deserialized: event={"t":"GUILD_CREATE","s":259,"op":0,"d":{"lazy":true,"stage_instances":[],"afk_channel_id":null,"max_stage_video_channel_users":150,"guild_hashes":{"version":1,"roles":{"omitted":false,"hash":"Is6iKA"},"metadata":{"omitted":false,"hash":"qxYe6A"},"channels":{"omitted":false,"hash":"MI7C1Q"}},"premium_progress_bar_enabled":true,"presences":[],"rules_channel_id":null,"default_message_notifications":1,"hub_type":null,"system_channel_flags":0,"preferred_locale":"en-US","roles": ...
it's 10k lines long
formatted, anyways
there's also a panic traceback I can get, though I'm not sure how much help that would be
What's the error source? serde-json usually says exactly what's wrong
Error is a trait representing the basic expectations for error values, i.e., values of type E in Result.
anyhow includes errors' sources in the Debug implementation FYI
Or you could run that 10k event through serde-json after the fact and see what it spits out
It'll be reproducible
okay I'll try to do that
I've been using snafu, ig that doesn't include the sources by default. But there are methods for it, so I'm gonna try to edit my error handler to include the sources
ofc I wasn't using the debug format for the error printing ๐คฆ
source: Error("missing field `afk_timeout`", line: 1, column: 147999),
nice, now which struct is at 147999?
let me see if I can figure that out lol
this might be easier to figure out ๐
source: Error("missing field `afk_timeout`", line: 10662, column: 1)
one sec
or not
I guess that means it's the guild that's missing it?
this is the only instance of "afk_timeout" in the entire event
and that's under this
oh btw it's no longer a worry for me, either the problem disappeared or the guild kicked my bot, but I'm assuming this is still worth fixing
lmk if there's anything else I can do to debug this
okay I think I was parsing the entire thing wrong here
afk_timeout is probably just the first field
I tried setting the json to the "d" instead, and got a new error
๐ง
Error("invalid type: null, expected iso 8601 datetime format", line: 10416, column: 33),
so ig it's a user with a null join date that's the problem?
it's also the only user with no roles
is this maybe a "guest" user
only some servers have this
so yeah they made the join date nullable
smh
wait it's a draft?
well can confirm this is the cause, I used an alt to join as a guest and got the same deserialization error
it only happens for GUILD_CREATE events for me, ig because I don't have voice join events enabled
should I open an issue for this?
yes that would be appreciated ๐
Any updates on if this issue will be resolved? >.<
Im getting the same error but i'm not 100% sure its related to this. 
Sorry for brining this back from the dead if thats not the case >.<
verified it and its because of the same thing. 