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: CloudConnection did not forward close() call to cloud proxy #4546

Merged
merged 5 commits into from
Mar 5, 2021

Conversation

vipeller
Copy link
Contributor

@vipeller vipeller commented Mar 4, 2021

The main change is in BrokeredCloudConnection.cs where it did not forward the call to CloudProxy. The rest of the change is only about to being able to log the Identity in case of failure.
The removed "TODO" about the subscription is not needed anymore as the proper place was in ConnectionHander.cs/RemoveConnectionAsync() to remove existing subscriptions.

vadim-kovalyov
vadim-kovalyov previously approved these changes Mar 4, 2021
Copy link
Contributor

@vadim-kovalyov vadim-kovalyov left a comment

Choose a reason for hiding this comment

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

LGTM


try
{
result = await this.CloudProxy.Match(
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: suggest: .Map().GetOrElse(true)


try
{
result = await this.CloudProxy.Match(
Copy link
Contributor

Choose a reason for hiding this comment

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

test?


public class BrokeredCloudConnection : ICloudConnection
{
IIdentity identity;

public BrokeredCloudConnection(BrokeredCloudProxy cloudProxy)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this not a ICloudProxy? We should avoid passing in actual types.. if possible.

this.IsActive = true;
this.CloudProxy = Option.Some(cloudProxy as ICloudProxy);
this.identity = cloudProxy.Identity;
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems odd... can we just pass in the Identity separately, like we do for CloudConnection?

Copy link
Contributor

@nyanzebra nyanzebra left a comment

Choose a reason for hiding this comment

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

Let's put at least 1 UT covering the change, if we need more thorough tests, we can add those in another pr if that is easier or not a high priority. Will approve after that :)

@vipeller vipeller changed the title Fix: CouldConnection did not forward close() call to cloud proxy Fix: CloudConnection did not forward close() call to cloud proxy Mar 4, 2021
- BrokeredCloudConnection now relies on underlying CloudProxy for active status instead of maintaining itself
Copy link
Contributor

@nyanzebra nyanzebra left a comment

Choose a reason for hiding this comment

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

LGTM 🚢

@kodiakhq kodiakhq bot merged commit 6f3f8ec into Azure:master Mar 5, 2021
@vipeller vipeller deleted the vipeller/close_fix branch March 23, 2021 21:58
damonbarry pushed a commit to damonbarry/iotedge that referenced this pull request Apr 15, 2022
…re#4546)

The main change is in BrokeredCloudConnection.cs where it did not forward the call to CloudProxy. The rest of the change is only about to being able to log the Identity in case of failure.
The removed "TODO" about the subscription is not needed anymore as the proper place was in ConnectionHander.cs/RemoveConnectionAsync() to remove existing subscriptions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants