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

follow ups to fix for #9308 #9407

Merged
merged 1 commit into from
Jun 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/sessionStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ module.exports.cleanAppData = (data, isShutdown) => {
if (data.dragData) {
delete data.dragData
}
if (data.sync) {
// clear sync site cache
data.sync.objectsById = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

it probably shouldn't be recreated every time (my bad) but this is okay for now

}
const clearSiteSettings = isShutdown && getSetting(settings.SHUTDOWN_CLEAR_SITE_SETTINGS) === true
if (clearSiteSettings) {
data.siteSettings = {}
Expand Down
5 changes: 5 additions & 0 deletions app/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ const appStoreChangeCallback = function (diffs) {
const entry = state.getIn(statePath)
const isSite = type === 'sites'

if (action === writeActions.CREATE && entry && entry.get('skipSync')) {
// Don't re-create objects that were fetched by sync
return
}

if (isSite && action === writeActions.DELETE && !entry) {
// If we deleted the site, it is no longer availble in appState.
// Find the corresponding objectId using the sync cache
Expand Down