-
Notifications
You must be signed in to change notification settings - Fork 38
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
Ignore unknown events in the client, at deserialization. #9471
base: master
Are you sure you want to change the base?
Conversation
246118a
to
dbf6acb
Compare
libparsec/crates/client_connection/src/authenticated_cmds/sse.rs
Outdated
Show resolved
Hide resolved
dbf6acb
to
2481da7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor comments, LGTM otherwise 👍
match T::api_load_response(raw.as_ref()) { | ||
Ok(cooked) => SSEResponseOrMissedEvents::Response(cooked), | ||
Err(e) => { | ||
log::trace!("Invalid event data: {e}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use a log::warn!()
since it's a useful information to know?
Ok(cooked) => SSEResponseOrMissedEvents::Response(cooked), | ||
Err(e) => { | ||
log::trace!("Invalid event data: {e}"); | ||
// we ignore bad deserialization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain in this comment that ignoring a bad deserialization error is useful to not break compatibility when new event types are added to our protocol?
Also comments should start with a capitalized letter.
Fix #9410
The added test case fails with BadContent without the patch.