Emit transaction deltas when transaction is committed

This commit is contained in:
Ben Gotow 2017-09-24 12:09:17 -05:00
parent a81cf69f7e
commit 15f8864008
2 changed files with 8 additions and 5 deletions

View file

@ -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}));
}
}

@ -1 +1 @@
Subproject commit 535c875507bdb5fba089c18cfcac9c564a0b8da1
Subproject commit 8201244c343978d5118f38a4309582189a0d9188