many small fixes from Intellij analysis

This commit is contained in:
zadam
2023-05-05 23:17:23 +02:00
parent 0af6f91d21
commit 6dfc72c065
41 changed files with 73 additions and 83 deletions

View File

@@ -189,7 +189,7 @@ class AbstractBeccaEntity {
* We're using the unencrypted blob for the hash calculation, because otherwise the random IV would
* cause every content blob to be unique which would balloon the database size (esp. with revisioning).
* This has minor security implications (it's easy to infer that given content is shared between different
* notes/attachments, but the trade-off comes out clearly positive.
* notes/attachments, but the trade-off comes out clearly positive).
*/
newBlobId = utils.hashedBlobId(unencryptedContentForHashCalculation);
blobNeedsInsert = !sql.getValue('SELECT 1 FROM blobs WHERE blobId = ?', [newBlobId]);
@@ -228,7 +228,10 @@ class AbstractBeccaEntity {
return newBlobId;
}
/** @protected */
/**
* @protected
* @returns {string|Buffer}
*/
_getContent() {
const row = sql.getRow(`SELECT content FROM blobs WHERE blobId = ?`, [this.blobId]);