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

MLIBZ-2490: pull with skip should not remove cached records #287

Merged
merged 2 commits into from
May 15, 2018

Conversation

heyzooi
Copy link
Contributor

@heyzooi heyzooi commented May 14, 2018

Description

When skip and limit is used we should not remove cached records

Changes

  • PullOperation now checks if the skip and limit are nil to determine if local records should be deleted before save the records pulled from the server

Tests

  • Unit Test added to reproduce the scenario described in the JIRA ticket

@@ -39,7 +39,7 @@ internal class PullOperation<T: Persistable>: FindOperation<T> where T: NSObject
}

override var mustRemoveCachedRecords: Bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Where does this get called? Can you link to a line number?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PullOperation extends from FindOperation, here's the line in FindOperation:

if self.mustRemoveCachedRecords {

@codecov-io
Copy link

codecov-io commented May 15, 2018

Codecov Report

Merging #287 into develop will increase coverage by 0.87%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #287      +/-   ##
===========================================
+ Coverage    88.39%   89.26%   +0.87%     
===========================================
  Files           70       70              
  Lines         8351     9001     +650     
===========================================
+ Hits          7382     8035     +653     
+ Misses         969      966       -3
Flag Coverage Δ
#Mac 88.46% <100%> (+0.06%) ⬆️
#iOS 88.14% <100%> (?)
Impacted Files Coverage Δ
Kinvey/Kinvey/PullOperation.swift 100% <100%> (ø) ⬆️
Kinvey/Kinvey/User.swift 92.22% <0%> (-3.09%) ⬇️
Kinvey/Kinvey/MIC.swift 91.39% <0%> (+0.41%) ⬆️
Kinvey/Kinvey/FileStore.swift 87.69% <0%> (+0.62%) ⬆️
Kinvey/Kinvey/FindOperation.swift 96.36% <0%> (+0.64%) ⬆️
Kinvey/Kinvey/HttpRequest.swift 85.88% <0%> (+0.8%) ⬆️
Kinvey/Kinvey/PushOperation.swift 94% <0%> (+1%) ⬆️
Kinvey/Kinvey/Error.swift 94.44% <0%> (+1.11%) ⬆️
Kinvey/Kinvey/HttpRequestFactory.swift 100% <0%> (+5.83%) ⬆️
Kinvey/Kinvey/Operation.swift 83.95% <0%> (+6.17%) ⬆️
... and 5 more

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 9bc105d...11c1527. Read the comment docs.

Copy link

@Martin-Hristov Martin-Hristov left a comment

Choose a reason for hiding this comment

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

LGTM

@heyzooi heyzooi merged commit 8926cee into develop May 15, 2018
@heyzooi heyzooi deleted the feature/MLIBZ-2490-pull_with_skip branch May 15, 2018 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants