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(connector): better errors for MCS channel confirm #329

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

CBenoit
Copy link
Member

@CBenoit CBenoit commented Dec 8, 2023

For context: #314 (comment)

@CBenoit CBenoit enabled auto-merge (squash) December 8, 2023 03:31
@CBenoit CBenoit mentioned this pull request Dec 8, 2023
Copy link

github-actions bot commented Dec 8, 2023

Coverage Report 🤖 ⚙️

Past:
Total lines: 26995
Covered lines: 16394 (60.73%)

New:
Total lines: 27015
Covered lines: 16397 (60.70%)

Diff: -0.03%

[this comment will be updated automatically]

Comment on lines -176 to 199
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,
));
}
Copy link
Member Author

@CBenoit CBenoit Dec 8, 2023

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.

@CBenoit CBenoit enabled auto-merge (squash) December 8, 2023 03:59
@CBenoit CBenoit changed the title fix(connector): handle requested_channel_id != joined_channel_id fix(connector): better errors for MCS channel confirm Dec 8, 2023
Copy link
Contributor

@pacmancoder pacmancoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants