-
Notifications
You must be signed in to change notification settings - Fork 298
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/file protection #1522
Merged
Merged
Fix/file protection #1522
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pasin
requested changes
Dec 13, 2016
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me. Can you fix the conflicts ? Also the link to MYUtilities is broken.
* Enabled file protection in the iOS test app (note: only takes effect on a real device; simulator does not implement file protection!) * The test app logs when app state changes in various ways, like going into/out of the background or files becoming inaccessible. * Made MYBackgroundMonitor work better if the app is already backgrounded and if the background task expires. (See MYUtilities commit) * Added CBLDatabase.fileProtection property * REST replicator monitors when files become inaccessible and suspends the replicator for the duration. * Thread-safety improvements in CBLRestReplicator+Backgrounding: make sure UIApplication is only called on the main thread. * Defined new internal status kCBLStatusFilesystemLocked for when we know that file I/O failed due to file protection. It gets reported as a 500 status with message “Device locked”. Should fix #1461 (background monitor); #1443 #1422 #1405 (file protection).
Otherwise it doesn’t save the checkpoint if it’s finishing a replication in a background task (the process will be suspended before the timer goes off.)
When _suspended is true it should always call goOffline regardless of trustReachability.
snej
force-pushed
the
fix/file_protection
branch
from
December 16, 2016 23:57
9eebca1
to
9303880
Compare
Rebased, added some issue links in the commits, pushed the latest MYUtilities. Ready for you, @pasin. |
@snej MYUtilities link is still not valid. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Better support for iOS file protection and backgrounding:
Replicator should save checkpoint before going idle
Otherwise it doesn’t save the checkpoint if it’s finishing a replication in a background task (the process will be suspended before the timer goes off.)
Replicator: Fixed some logic in -reachabilityChanged handling _suspended
When _suspended is true it should always call goOffline regardless of trustReachability.