From 15f88640084ebf4070e2e43187cbc534356396f3 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Sun, 24 Sep 2017 12:09:17 -0500 Subject: [PATCH] Emit transaction deltas when transaction is committed --- app/src/flux/mailsync-bridge.es6 | 11 +++++++---- mailsync | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/flux/mailsync-bridge.es6 b/app/src/flux/mailsync-bridge.es6 index a94b46e4f..25ca3318a 100644 --- a/app/src/flux/mailsync-bridge.es6 +++ b/app/src/flux/mailsync-bridge.es6 @@ -279,8 +279,8 @@ export default class MailsyncBridge { continue; } - const {type, objects, objectClass} = JSON.parse(msg); - if (!objects || !type || !objectClass) { + const {type, modelJSONs, modelClass} = JSON.parse(msg); + if (!modelJSONs || !type || !modelClass) { console.log(`Sync worker sent a JSON formatted message with unexpected keys: ${msg}`) continue; } @@ -288,8 +288,11 @@ export default class MailsyncBridge { // dispatch the message to other windows ipcRenderer.send('mailsync-bridge-rebroadcast-to-all', msg); - const models = objects.map(Utils.convertToModel); - this._onIncomingChangeRecord(new DatabaseChangeRecord({type, objectClass, objects: models})); + const models = modelJSONs.map(Utils.convertToModel); + this._onIncomingChangeRecord(new DatabaseChangeRecord({ + type, // TODO BG move to "model" naming style, finding all uses might be tricky + objectClass: modelClass, + objects: models})); } } diff --git a/mailsync b/mailsync index 535c87550..8201244c3 160000 --- a/mailsync +++ b/mailsync @@ -1 +1 @@ -Subproject commit 535c875507bdb5fba089c18cfcac9c564a0b8da1 +Subproject commit 8201244c343978d5118f38a4309582189a0d9188