WIP: Fix for sync crash; Simplified pouchDbSyncOptions #2019
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.
Added pending to sync progress output
Description
This is a work-around for memory issues when syncing with the Cordova-Sqlcipher plugin
Type of Change
Proposed Solution
I simplified the code for creating the selector in the mango query. If a site is using 2-way sync, we are recommending syncing all forms; therefore, I removed the code that builds a very long $or statement.
Before the sync, the code checks for sync-checkpoint, which is populated during the first sync.
Limitations and Trade-offs
This code ignores any settings in Sync Configuration; instead, it syncs all forms. There is no checking of the couchdbSyncSettings.enabled property in each formInfo.
Also, after this sync process is done, the code progresses to this.syncCustomService.sync and does a push of most of the docs that were just synced (marked as customSyncSettings enabled and push). Note it is not a sync, using the changes feed, but instead a push using the doc _id's. Wouldn't it be better to do a couch sync instead? One thing the customSyncSettings can do is remove a field's value if a field is marked as private.