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

MLIBZ-2096: allow custom URLSessions #244

Merged
merged 1 commit into from Oct 2, 2017

Conversation

Projects
None yet
3 participants
@heyzooi
Contributor

heyzooi commented Sep 26, 2017

Description

Allow custom URLSessions for background calls for example

Changes

  • Added a property called urlSession in the Options class
  • Changed all places where a URLSession is used

Tests

  • No need to add unit tests

@heyzooi heyzooi self-assigned this Sep 26, 2017

@heyzooi heyzooi requested a review from tejasranade Sep 26, 2017

@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io Sep 28, 2017

Codecov Report

Merging #244 into develop will increase coverage by <.01%.
The diff coverage is 87.5%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #244      +/-   ##
===========================================
+ Coverage    87.69%   87.69%   +<.01%     
===========================================
  Files           65       65              
  Lines         7434     7444      +10     
===========================================
+ Hits          6519     6528       +9     
- Misses         915      916       +1
Flag Coverage Δ
#Mac 87.69% <87.5%> (ø) ⬆️
Impacted Files Coverage Δ
Kinvey/Kinvey/RequestFactory.swift 100% <100%> (ø) ⬆️
Kinvey/Kinvey/MIC.swift 90.29% <100%> (ø) ⬆️
Kinvey/Kinvey/HttpRequest.swift 81.48% <100%> (ø) ⬆️
Kinvey/Kinvey/FileStore.swift 77.47% <84.21%> (+0.05%) ⬆️
Kinvey/Kinvey/URLSessionTaskRequest.swift 90% <90%> (+0.44%) ⬆️

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 c5c23df...0088943. Read the comment docs.

codecov-io commented Sep 28, 2017

Codecov Report

Merging #244 into develop will increase coverage by <.01%.
The diff coverage is 87.5%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #244      +/-   ##
===========================================
+ Coverage    87.69%   87.69%   +<.01%     
===========================================
  Files           65       65              
  Lines         7434     7444      +10     
===========================================
+ Hits          6519     6528       +9     
- Misses         915      916       +1
Flag Coverage Δ
#Mac 87.69% <87.5%> (ø) ⬆️
Impacted Files Coverage Δ
Kinvey/Kinvey/RequestFactory.swift 100% <100%> (ø) ⬆️
Kinvey/Kinvey/MIC.swift 90.29% <100%> (ø) ⬆️
Kinvey/Kinvey/HttpRequest.swift 81.48% <100%> (ø) ⬆️
Kinvey/Kinvey/FileStore.swift 77.47% <84.21%> (+0.05%) ⬆️
Kinvey/Kinvey/URLSessionTaskRequest.swift 90% <90%> (+0.44%) ⬆️

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 c5c23df...0088943. Read the comment docs.

@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io Sep 28, 2017

Codecov Report

Merging #244 into develop will increase coverage by 0.03%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop    #244      +/-   ##
==========================================
+ Coverage    90.37%   90.4%   +0.03%     
==========================================
  Files           65      65              
  Lines         7976    7986      +10     
==========================================
+ Hits          7208    7220      +12     
+ Misses         768     766       -2
Flag Coverage Δ
#Mac 87.69% <87.5%> (ø) ⬆️
#iOS 89.3% <87.5%> (+0.03%) ⬆️
Impacted Files Coverage Δ
Kinvey/Kinvey/HttpRequest.swift 81.48% <100%> (ø) ⬆️
Kinvey/Kinvey/MIC.swift 95.56% <100%> (ø) ⬆️
Kinvey/Kinvey/RequestFactory.swift 100% <100%> (ø) ⬆️
Kinvey/Kinvey/FileStore.swift 78.62% <84.21%> (+0.03%) ⬆️
Kinvey/Kinvey/URLSessionTaskRequest.swift 90% <90%> (+0.44%) ⬆️
Kinvey/Kinvey/Kinvey.swift 100% <0%> (+0.77%) ⬆️
Kinvey/Kinvey/Client.swift 92.57% <0%> (+0.99%) ⬆️

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 f12f4bf...70bcbf2. Read the comment docs.

codecov-io commented Sep 28, 2017

Codecov Report

Merging #244 into develop will increase coverage by 0.03%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop    #244      +/-   ##
==========================================
+ Coverage    90.37%   90.4%   +0.03%     
==========================================
  Files           65      65              
  Lines         7976    7986      +10     
==========================================
+ Hits          7208    7220      +12     
+ Misses         768     766       -2
Flag Coverage Δ
#Mac 87.69% <87.5%> (ø) ⬆️
#iOS 89.3% <87.5%> (+0.03%) ⬆️
Impacted Files Coverage Δ
Kinvey/Kinvey/HttpRequest.swift 81.48% <100%> (ø) ⬆️
Kinvey/Kinvey/MIC.swift 95.56% <100%> (ø) ⬆️
Kinvey/Kinvey/RequestFactory.swift 100% <100%> (ø) ⬆️
Kinvey/Kinvey/FileStore.swift 78.62% <84.21%> (+0.03%) ⬆️
Kinvey/Kinvey/URLSessionTaskRequest.swift 90% <90%> (+0.44%) ⬆️
Kinvey/Kinvey/Kinvey.swift 100% <0%> (+0.77%) ⬆️
Kinvey/Kinvey/Client.swift 92.57% <0%> (+0.99%) ⬆️

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 f12f4bf...70bcbf2. Read the comment docs.

@@ -101,6 +104,7 @@ public struct Options {
*/
public init(
client: Client? = nil,
urlSession: URLSession? = nil,

This comment has been minimized.

@tejasranade

tejasranade Oct 2, 2017

Member

Just a side note, not directly related to this ticket - the constructor of Options probably shouldn't expose each property in the class. As the number of properties grows, it'll get too verbose. It's ok to expect developers to set each property individually after they have created an Options instance.

@tejasranade

tejasranade Oct 2, 2017

Member

Just a side note, not directly related to this ticket - the constructor of Options probably shouldn't expose each property in the class. As the number of properties grows, it'll get too verbose. It's ok to expect developers to set each property individually after they have created an Options instance.

@heyzooi heyzooi merged commit 22dd5d3 into develop Oct 2, 2017

2 of 3 checks passed

codebeat 11 issues resolved and 13 introduced
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@heyzooi heyzooi deleted the feature/MLIBZ-2096-custom_urlsession branch Oct 2, 2017

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