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

ChannelChatMessageV1Payload missing fields causes crash #465

Open
EthanZeigler opened this issue Dec 26, 2024 · 1 comment · May be fixed by #466
Open

ChannelChatMessageV1Payload missing fields causes crash #465

EthanZeigler opened this issue Dec 26, 2024 · 1 comment · May be fixed by #466

Comments

@EthanZeigler
Copy link

EthanZeigler commented Dec 26, 2024

Description

The channel chat message v1 payload is missing fields that causes a crash when parsing eventsub websocket messages.

pub struct ChannelChatMessageV1Payload {
/// The broadcaster user ID.
pub broadcaster_user_id: types::UserId,
/// The broadcaster display name.
pub broadcaster_user_name: types::DisplayName,
/// The broadcaster login.
pub broadcaster_user_login: types::UserName,
/// The user ID of the user that sent the message.
pub chatter_user_id: types::UserId,
/// The user name of the user that sent the message.
pub chatter_user_name: types::DisplayName,
/// The user login of the user that sent the message.
pub chatter_user_login: types::UserName,
/// A UUID that identifies the message.
pub message_id: types::MsgId,
/// The structured chat message.
pub message: Message,
/// The type of message.
pub message_type: MessageType,
/// List of chat badges.
pub badges: Vec<Badge>,
/// Metadata if this message is a cheer.
pub cheer: Option<Cheer>,
/// The color of the user's name in the chat room.
/// This is a hexadecimal RGB color code in the form, `#<RGB>`.
/// This may be empty if it is never set.
pub color: types::HexColor,
/// Metadata if this message is a reply.
pub reply: Option<Reply>,
/// The ID of a channel points custom reward that was redeemed.
pub channel_points_custom_reward_id: Option<types::RewardId>,
/// An ID for the type of animation selected as part of an “animate my message” redemption.
pub channel_points_animation_id: Option<String>,
}

https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#channelchatmessage

Fields were added for the new shared chat functionality when costreaming that are most likely causing it. I'd imagine this isnt the only message with this problem.

"source_broadcaster_user_id": null,
"source_broadcaster_user_login": null,
"source_broadcaster_user_name": null,
"source_message_id": null,
"source_badges": null
@Emilgardis
Copy link
Member

its great that they chose to use versioning for eventsub and then end up not using it :D

Thank you for the report. To not fail on this you can choose to not enable the deny_unknown_fields feature of the crate or use trace_unknown_fields

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 a pull request may close this issue.

2 participants