add memberId to entity_changes to avoid having to resend all changes second time

This commit is contained in:
zadam
2022-01-09 20:16:39 +01:00
parent c448d34a38
commit 7159b13c9d
25 changed files with 11520 additions and 266 deletions

View File

@@ -22,9 +22,9 @@ async function processEntityChanges(entityChanges) {
} else if (ec.entityName === 'note_contents') {
delete froca.noteComplementPromises[ec.entityId];
loadResults.addNoteContent(ec.entityId, ec.sourceId);
loadResults.addNoteContent(ec.entityId, ec.componentId);
} else if (ec.entityName === 'note_revisions') {
loadResults.addNoteRevision(ec.entityId, ec.noteId, ec.sourceId);
loadResults.addNoteRevision(ec.entityId, ec.noteId, ec.componentId);
} else if (ec.entityName === 'note_revision_contents') {
// this should change only when toggling isProtected, ignore
} else if (ec.entityName === 'options') {
@@ -87,7 +87,7 @@ function processNoteChange(loadResults, ec) {
return;
}
loadResults.addNote(ec.entityId, ec.sourceId);
loadResults.addNote(ec.entityId, ec.componentId);
if (ec.isErased && ec.entityId in froca.notes) {
utils.reloadFrontendApp(`${ec.entityName} ${ec.entityId} is erased, need to do complete reload.`);
@@ -125,7 +125,7 @@ function processBranchChange(loadResults, ec) {
delete parentNote.childToBranch[branch.noteId];
}
loadResults.addBranch(ec.entityId, ec.sourceId);
loadResults.addBranch(ec.entityId, ec.componentId);
delete froca.branches[ec.entityId];
}
@@ -133,7 +133,7 @@ function processBranchChange(loadResults, ec) {
return;
}
loadResults.addBranch(ec.entityId, ec.sourceId);
loadResults.addBranch(ec.entityId, ec.componentId);
const childNote = froca.notes[ec.entity.noteId];
const parentNote = froca.notes[ec.entity.parentNoteId];
@@ -175,7 +175,7 @@ function processNoteReordering(loadResults, ec) {
}
}
loadResults.addNoteReordering(ec.entityId, ec.sourceId);
loadResults.addNoteReordering(ec.entityId, ec.componentId);
}
function processAttributeChange(loadResults, ec) {
@@ -199,7 +199,7 @@ function processAttributeChange(loadResults, ec) {
targetNote.targetRelations = targetNote.targetRelations.filter(attributeId => attributeId !== attribute.attributeId);
}
loadResults.addAttribute(ec.entityId, ec.sourceId);
loadResults.addAttribute(ec.entityId, ec.componentId);
delete froca.attributes[ec.entityId];
}
@@ -207,7 +207,7 @@ function processAttributeChange(loadResults, ec) {
return;
}
loadResults.addAttribute(ec.entityId, ec.sourceId);
loadResults.addAttribute(ec.entityId, ec.componentId);
const sourceNote = froca.notes[ec.entity.noteId];
const targetNote = ec.entity.type === 'relation' && froca.notes[ec.entity.value];