Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
On Sync init only send siteSettings without objectId
Browse files Browse the repository at this point in the history
Auditors: @diracdeltas

Test Plan:
1. Have Sync disabled.
2. Browse a site and toggle a Bravery Panel setting.
3. Enable Sync and restart your pyramid. Note that siteSettings are sent.
4. Restart your pyramid again. Note this time siteSettings are *not* sent.
  • Loading branch information
ayumi committed Jan 20, 2017
1 parent 293daaa commit 863e095
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,12 @@ module.exports.onSyncReady = (isFirstRun, e) => {
[syncUtil.createSiteData(site.toJS(), i)])
}
})
// Sync site settings in case they changed while sync was disabled
// Sync site settings that have not been synced yet
// FIXME: If Sync was disabled and settings were changed, those changes
// might not be synced.
const siteSettings =
appState.get('siteSettings').filter((value, key) => {
return syncUtil.isSyncable('siteSetting', value)
return !value.get('objectId') && syncUtil.isSyncable('siteSetting', value)
}).toJS()
if (siteSettings) {
sendSyncRecords(e.sender, writeActions.UPDATE,
Expand Down

0 comments on commit 863e095

Please sign in to comment.