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

feat: MLIBZ-2448 Fix setting client app version #165

Conversation

@yuliya-guseva
Copy link
Contributor

commented May 2, 2018

Description

"X-Kinvey-Client-App-Version" header is absent in a Pre-Save hook for users collection.

Changes

Added "X-Kinvey-Client-App-Version" header for login and sighup requests.

Tests

Added unit test.

@yuliya-guseva yuliya-guseva requested a review from vinaygahlawat May 2, 2018

@codecov-io

This comment has been minimized.

Copy link

commented May 2, 2018

Codecov Report

Merging #165 into indev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              indev     #165   +/-   ##
=========================================
  Coverage     57.75%   57.75%           
  Complexity      466      466           
=========================================
  Files            41       41           
  Lines          3087     3087           
  Branches        477      477           
=========================================
  Hits           1783     1783           
  Misses         1153     1153           
  Partials        151      151

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 07c86ef...f426caa. Read the comment docs.

feat: Fix setting client app version
MLIBZ-2448 (reverted from commit 96dbe79)
this.request.setKinveyHeaders(((KinveyClientRequestInitializer) client.getKinveyRequestInitializer()).getKinveyHeaders());
KinveyHeaders kinveyHeaders = (((KinveyClientRequestInitializer) client.getKinveyRequestInitializer()).getKinveyHeaders());
kinveyHeaders.set("X-Kinvey-Client-App-Version", clientAppVersion);
this.request.setKinveyHeaders(kinveyHeaders);

This comment has been minimized.

Copy link
@vinaygahlawat

vinaygahlawat May 7, 2018

Contributor

We should only be setting the X-Kinvey-Client-App-Version header if the clientAppVersion has been set by the developer. If the clientAppVersion is null or empty, the header should not be added.

This comment has been minimized.

Copy link
@yuliya-guseva

yuliya-guseva May 7, 2018

Author Contributor

Updated

String clientAppVersionHeader = (String) kinveyHeaders.get("X-Kinvey-Client-App-Version");
assertEquals(clientAppVersion, clientAppVersionHeader);
}

This comment has been minimized.

Copy link
@vinaygahlawat

vinaygahlawat May 7, 2018

Contributor

Please also add a test case to verify that if clientAppVersion is not set, that the X-Kinvey-Client-App-Version header is not added to the request.

This comment has been minimized.

Copy link
@yuliya-guseva

yuliya-guseva May 7, 2018

Author Contributor

Added

@yuliya-guseva yuliya-guseva merged commit 2af318b into indev May 7, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@yuliya-guseva yuliya-guseva deleted the feature/MLIBZ-2448_Android_doesn't_send_"X-Kinvey-Client-App-Version"_before_user_is_authorized branch May 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.