diff --git a/src/public/app/entities/note_short.js b/src/public/app/entities/note_short.js index 03f39f630..1fa815344 100644 --- a/src/public/app/entities/note_short.js +++ b/src/public/app/entities/note_short.js @@ -61,8 +61,6 @@ class NoteShort { this.type = row.type; /** @param {string} content-type, e.g. "application/json" */ this.mime = row.mime; - /** @param {boolean} */ - this.isDeleted = !!row.isDeleted; } addParent(parentNoteId, branchId) { diff --git a/src/public/app/services/tree.js b/src/public/app/services/tree.js index f8d03e4db..c87798f8b 100644 --- a/src/public/app/services/tree.js +++ b/src/public/app/services/tree.js @@ -72,7 +72,7 @@ async function resolveNotePathToSegments(notePath, hoistedNoteId = 'root', logEr if (logErrors) { const parent = froca.getNoteFromCache(parentNoteId); - console.log(utils.now(), `Did not find parent ${parentNoteId} (${parent ? parent.title : 'n/a'}) for child ${childNoteId} (${child.title}), available parents: ${parents.map(p => `${p.noteId} (${p.title})`)}`); + console.debug(utils.now(), `Did not find parent ${parentNoteId} (${parent ? parent.title : 'n/a'}) for child ${childNoteId} (${child.title}), available parents: ${parents.map(p => `${p.noteId} (${p.title})`)}. You can ignore this message as it is mostly harmless.`); } const someNotePath = getSomeNotePath(child, hoistedNoteId); diff --git a/src/public/app/services/ws.js b/src/public/app/services/ws.js index bec71d677..d94236036 100644 --- a/src/public/app/services/ws.js +++ b/src/public/app/services/ws.js @@ -219,8 +219,13 @@ async function processEntityChanges(entityChanges) { const note = froca.notes[ec.entityId]; if (note) { - note.update(ec.entity); - loadResults.addNote(ec.entityId, ec.sourceId); + if (ec.entity.isDeleted) { + delete froca.notes[ec.entityId]; + } + else { + note.update(ec.entity); + loadResults.addNote(ec.entityId, ec.sourceId); + } } } diff --git a/src/services/ws.js b/src/services/ws.js index 0fbddf4bd..15c4cb750 100644 --- a/src/services/ws.js +++ b/src/services/ws.js @@ -75,6 +75,10 @@ function sendMessageToAllClients(message) { } function fillInAdditionalProperties(entityChange) { + // most of these could be filled by becca + // the exception is isDeleted - in that case becca doesn't contain such entity at all + // this would have to be handled separately + // fill in some extra data needed by the frontend if (entityChange.entityName === 'attributes') { entityChange.entity = sql.getRow(`SELECT * FROM attributes WHERE attributeId = ?`, [entityChange.entityId]);