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

fix: remove _trace from helloOp #654

Merged
merged 1 commit into from May 31, 2019

Conversation

foxbot
Copy link
Contributor

@foxbot foxbot commented May 29, 2019

As per discord/discord-api-docs#967, _trace in OP10 HELLO is no
longer an array of strings, but rather an undefined glob of data that
presently contains a mixed bag of strings and objects.

type helloOp does not seem to be exposed outside of the library, so this
is not a breaking change; furthermore, the Trace field of helloOp was
not used anywhere within the library. It seems like it would be safer to
just remove the field outright, rather than accept it as an interface{}
and waste cycles unmarshaling data that is never used.

This is a critically breaking bug, as if the upstream change is merged,
bots using DiscordGo prior to this patch will be unable to connect; an
error would occur when trying to unmarshal the new data glob into a
[]string, causing (*Session).Open() to prematurely return.

As per discord/discord-api-docs#967, _trace in OP10 HELLO is no
longer an array of strings, but rather an undefined glob of data that
presently contains a mixed bag of strings and objects.

type helloOp does not seem to be exposed outside of the library, so this
is not a breaking change; furthermore, the Trace field of helloOp was
not used anywhere within the library. It seems like it would be safer to
just remove the field outright, rather than accept it as an interface{}
and waste cycles unmarshaling data that is never used.

This is a critically breaking bug, as if the upstream change is merged,
bots using DiscordGo prior to this patch will be unable to connect; an
error would occur when trying to unmarshal the new data glob into a
[]string, causing (*Session).Open() to prematurely return.
@foxbot
Copy link
Contributor Author

foxbot commented May 29, 2019

Due to the potentially breaking nature of the upstream issue, I would recommend deploying this change to master as soon as possible.

If the upstream change is not merged, there will be no repercussions to DiscordGo and its dependents, as the Trace field of helloOp is not used.

If the upstream change is merged, DiscordGo and its dependents will be broken entirely.

@bwmarrin
Copy link
Owner

Thanks for catching this and providing the PR. I agree, since we're not using or exposing it, it's perfectly fine to just remove it.

@bwmarrin bwmarrin merged commit c52d70f into bwmarrin:develop May 31, 2019
@foxbot foxbot deleted the issues/discordapp-967 branch June 2, 2019 18:31
@bwmarrin bwmarrin added this to the v0.20.0 milestone Aug 27, 2019
ErikMcClure pushed a commit to ErikMcClure/discordgo that referenced this pull request Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants