diff --git a/docs/backend_api/AbstractBeccaEntity.html b/docs/backend_api/AbstractBeccaEntity.html
index 56f75df52..739d9d2ca 100644
--- a/docs/backend_api/AbstractBeccaEntity.html
+++ b/docs/backend_api/AbstractBeccaEntity.html
@@ -259,7 +259,7 @@
Source:
@@ -400,7 +400,7 @@
- (protected) addEntityChange()
+ (protected) beforeSaving()
@@ -448,7 +448,7 @@
Source:
@@ -484,7 +484,7 @@
- (protected) beforeSaving()
+ (protected) generateHash()
@@ -532,7 +532,7 @@
Source:
@@ -568,7 +568,7 @@
- (protected) generateHash()
+ (protected) generateIdIfNecessary()
@@ -616,7 +616,7 @@
Source:
@@ -652,7 +652,7 @@
- (protected) generateIdIfNecessary()
+ (protected) getPojoToSave()
@@ -700,7 +700,7 @@
Source:
@@ -736,7 +736,7 @@
- (protected) getPojoToSave()
+ (protected) getUtcDateChanged()
@@ -784,7 +784,7 @@
Source:
@@ -820,19 +820,89 @@
- (protected) getUtcDateChanged()
+ markAsDeleted(deleteIdopt)
+
+ Mark the entity as (soft) deleted. It will be completely erased later.
+
+This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ | Name |
+
+
+ Type |
+
+
+ Attributes |
+
+
+
+ Default |
+
+ Description |
+
+
+
+
+
+
+ deleteId |
+
+
+
+
+ |
+
+
+
+
+ <optional>
+
+
+
+
+
+ |
+
+
+
+
+ null
+
+ |
+
+ |
+
+
+
+
@@ -868,7 +938,7 @@
Source:
@@ -904,89 +974,19 @@
- markAsDeleted(deleteIdopt)
+ (protected) putEntityChange()
-
- Mark the entity as (soft) deleted. It will be completely erased later.
-
-This is a low-level method, for notes and branches use `note.deleteNote()` and 'branch.deleteBranch()` instead.
-
-
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- | Name |
-
-
- Type |
-
-
- Attributes |
-
-
-
- Default |
-
-
- Description |
-
-
-
-
-
-
-
- deleteId |
-
-
-
- |
-
-
-
- <optional>
-
-
-
-
-
- |
-
-
-
-
- null
-
- |
-
- |
-
-
-
-
@@ -1022,7 +1022,7 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
Source:
diff --git a/docs/backend_api/BAttribute.html b/docs/backend_api/BAttribute.html
index 9411cf447..cc20d0db8 100644
--- a/docs/backend_api/BAttribute.html
+++ b/docs/backend_api/BAttribute.html
@@ -825,7 +825,7 @@ and relation (representing named relationship between source and target note)Source:
@@ -965,95 +965,6 @@ and relation (representing named relationship between source and target note)(protected) addEntityChange()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Overrides:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1940,7 +1851,96 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ (protected) putEntityChange()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Overrides:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
diff --git a/docs/backend_api/BBranch.html b/docs/backend_api/BBranch.html
index eecdbc133..4e716ec2e 100644
--- a/docs/backend_api/BBranch.html
+++ b/docs/backend_api/BBranch.html
@@ -945,7 +945,7 @@ of deletion should not act as a clone.
- Source:
@@ -1085,95 +1085,6 @@ of deletion should not act as a clone.
-
-
-
-
-
-
- (protected) addEntityChange()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Overrides:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -2054,7 +1965,96 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
- Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ (protected) putEntityChange()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Overrides:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
diff --git a/docs/backend_api/BEtapiToken.html b/docs/backend_api/BEtapiToken.html
index d0166f672..6fce5b28a 100644
--- a/docs/backend_api/BEtapiToken.html
+++ b/docs/backend_api/BEtapiToken.html
@@ -694,7 +694,7 @@ from tokenHash and token.
- Source:
@@ -834,95 +834,6 @@ from tokenHash and token.
-
-
-
-
-
-
- (protected) addEntityChange()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Overrides:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1497,7 +1408,96 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
- Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ (protected) putEntityChange()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Overrides:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
diff --git a/docs/backend_api/BNote.html b/docs/backend_api/BNote.html
index acee10500..6c07103c9 100644
--- a/docs/backend_api/BNote.html
+++ b/docs/backend_api/BNote.html
@@ -1171,7 +1171,7 @@
- Source:
@@ -1636,95 +1636,6 @@ See addLabel, addRelation for more specific methods.
-
-
-
-
-
-
- (protected) addEntityChange()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Overrides:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -12325,7 +12236,96 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
- Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ (protected) putEntityChange()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Overrides:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
diff --git a/docs/backend_api/BOption.html b/docs/backend_api/BOption.html
index 33566ad69..11696ebaf 100644
--- a/docs/backend_api/BOption.html
+++ b/docs/backend_api/BOption.html
@@ -552,7 +552,7 @@
- Source:
@@ -692,95 +692,6 @@
-
-
-
-
-
-
- (protected) addEntityChange()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Overrides:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1355,7 +1266,96 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
- Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ (protected) putEntityChange()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Overrides:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
diff --git a/docs/backend_api/BRecentNote.html b/docs/backend_api/BRecentNote.html
index ac3224c2b..d339e4657 100644
--- a/docs/backend_api/BRecentNote.html
+++ b/docs/backend_api/BRecentNote.html
@@ -484,7 +484,7 @@
- Source:
@@ -624,95 +624,6 @@
-
-
-
-
-
-
- (protected) addEntityChange()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Overrides:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1287,7 +1198,96 @@ This is a low-level method, for notes and branches use `note.deleteNote()` and '
- Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ (protected) putEntityChange()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Overrides:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
diff --git a/docs/backend_api/becca_entities_abstract_becca_entity.js.html b/docs/backend_api/becca_entities_abstract_becca_entity.js.html
index c0c0bc21d..d54522bc1 100644
--- a/docs/backend_api/becca_entities_abstract_becca_entity.js.html
+++ b/docs/backend_api/becca_entities_abstract_becca_entity.js.html
@@ -89,8 +89,8 @@ class AbstractBeccaEntity {
}
/** @protected */
- addEntityChange(isDeleted = false) {
- entityChangesService.addEntityChange({
+ putEntityChange(isDeleted = false) {
+ entityChangesService.putEntityChange({
entityName: this.constructor.entityName,
entityId: this[this.constructor.primaryKeyName],
hash: this.generateHash(isDeleted),
@@ -129,7 +129,7 @@ class AbstractBeccaEntity {
return;
}
- this.addEntityChange(false);
+ this.putEntityChange(false);
if (!cls.isEntityEventsDisabled()) {
const eventPayload = {
@@ -203,6 +203,8 @@ class AbstractBeccaEntity {
}
sql.execute("DELETE FROM blobs WHERE blobId = ?", [oldBlobId]);
+ // blobs are not marked as erased in entity_changes, they are just purged completely
+ // this is because technically every keystroke can create a new blob and there would be just too many
sql.execute("DELETE FROM entity_changes WHERE entityName = 'blobs' AND entityId = ?", [oldBlobId]);
}
@@ -245,7 +247,7 @@ class AbstractBeccaEntity {
// access to the decrypted content
const hash = blobService.calculateContentHash(pojo);
- entityChangesService.addEntityChange({
+ entityChangesService.putEntityChange({
entityName: 'blobs',
entityId: newBlobId,
hash: hash,
@@ -305,7 +307,7 @@ class AbstractBeccaEntity {
log.info(`Marking ${entityName} ${entityId} as deleted`);
- this.addEntityChange(true);
+ this.putEntityChange(true);
eventService.emit(eventService.ENTITY_DELETED, { entityName, entityId, entity: this });
}
@@ -322,7 +324,7 @@ class AbstractBeccaEntity {
log.info(`Marking ${entityName} ${entityId} as deleted`);
- this.addEntityChange(true);
+ this.putEntityChange(true);
eventService.emit(eventService.ENTITY_DELETED, { entityName, entityId, entity: this });
}