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

SDK version bump + Null context breaking change fix. #21655

Merged
merged 2 commits into from
May 19, 2021

Conversation

azabbasi
Copy link
Contributor

  • Manually perform the version bump since the last released did not go through all the way to create the automated PR.
  • Fix a behavior change that was introduced in version 1.0.2 in which a user could no longer pass down null for the context parameter in the synchronous APIs. We now use Context.NONE as the default value even if the user passes down null

@@ -586,6 +614,10 @@ public DigitalTwinsServiceVersion getServiceVersion() {
}

Mono<Response<Void>> deleteRelationshipWithResponse(String digitalTwinId, String relationshipId, DeleteRelationshipOptions options, Context context) {
if (context == null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

since these are package private methods, they can be called from elsewhere within the namespace so we do a null check and assign a default value to all of them.

Comment on lines +768 to +769
() -> listIncomingRelationshipsFirstPageAsync(digitalTwinId, context != null ? context : Context.NONE),
nextLink -> listIncomingRelationshipsNextSinglePageAsync(nextLink, context != null ? context : Context.NONE ));
Copy link
Member

Choose a reason for hiding this comment

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

nit: can do the check just once

if (context == null) {
       context = Context.NONE;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried but the parameter in the lambda expression needs to be final :)

@azabbasi azabbasi merged commit 2e737fb into master May 19, 2021
@azabbasi azabbasi deleted the feature/adt/azabbasi/fixNullContext branch May 19, 2021 19:13
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.

3 participants