-
Notifications
You must be signed in to change notification settings - Fork 48
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(connector): better errors for MCS channel confirm #329
Conversation
Coverage Report 🤖 ⚙️Past: New: Diff: -0.03% [this comment will be updated automatically] |
57782eb
to
b4f5f39
Compare
b4f5f39
to
e47f6e4
Compare
if channel_join_confirm.initiator_id != user_channel_id | ||
|| channel_join_confirm.channel_id != channel_join_confirm.requested_channel_id | ||
|| channel_join_confirm.channel_id != channel_id | ||
{ | ||
return Err(general_err!("received bad MCS Channel Join Confirm")); | ||
if channel_join_confirm.initiator_id != user_channel_id { | ||
warn!( | ||
channel_join_confirm.initiator_id, | ||
user_channel_id, "Inconsistent initiator ID for MCS Channel Join Confirm", | ||
) | ||
} | ||
|
||
if channel_id != channel_join_confirm.requested_channel_id { | ||
return Err(reason_err!( | ||
"ChannelJoinConfirm", | ||
"unexpected requested_channel_id in MCS Channel Join Confirm: received {}, got {}", | ||
channel_id, | ||
channel_join_confirm.requested_channel_id, | ||
)); | ||
} | ||
|
||
if channel_id != channel_join_confirm.channel_id { | ||
return Err(reason_err!( | ||
"ChannelJoinConfirm", | ||
"unexpected channel_id in MCS Channel Join Confirm: received {}, got {}", | ||
channel_id, | ||
channel_join_confirm.channel_id, | ||
)); | ||
} |
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.
More lenient handling and improved error reporting of this sanity check:
- Warn when the initiator ID does not match the user channel ID
- Fail when the requested channel ID doesn’t match the channel ID set in the Channel Join Request sent previously. This is because currently we don’t batch all the join request, but once we do, the join confirm messages may arrive out of order and the check should then be removed. Related: Send all the join requests in a single batch #112
- Fail when the joined channel ID does not match the requested channel ID. The server should follow what it advertised in the GCC Server Network Data.
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.
👍
For context: #314 (comment)