fix READY being discarded when application_id is null - #427
Merged
Merged
Conversation
discord sends "application_id": null on voice channels, but JS_O only checks contains(). Snowflake::from_json then falls through to get_to(uint64_t) on a null and throws type_error.302.
same JS_O issue as the channel's one, same optional<Snowflake> target.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Abaddon starts, connects, and then sits there with an empty window. No servers or channels.
The process stays alive and the gateway connection holds, so it looks like it is still loading. the console shows this tho:
whats happening is that the whole READY gets thrown away, so no guilds or channels load.
everything after READY parses fine, which is why the error only shows up once.
I put a websocket proxy between Abaddon and the gateway to capture the payload. Discord now sends
"application_id": nullon voice channels instead of leaving the key out. In my READY, 59 of 4461 channels had it, all of them type 2.ChannelData reads that key with JS_O:
JS_O checks contains() and nothing else. The key is there, so it calls get(), and Snowflake::from_json takes the non string branch:
this switches both sites to JS_ON: channel.cpp:38 and activity.cpp:69.
the activity one is not what breaks for me, but it reads the same optional the same way, and it will hit this the first time someone's rich presence comes through with a null application_id.