X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=src%2Fdb%2Fsqlite%2Findex.js;h=56afa000cb886f900277e4bf819139b93e926707;hb=bc2e0acf8844af08633c6ed0df15890a00116599;hp=cc4ea90af056db2c99f747f2705e25829801749a;hpb=737fbd003d5c4dfea81b667ef906f1c106a60612;p=websub-hub diff --git a/src/db/sqlite/index.js b/src/db/sqlite/index.js index cc4ea90..56afa00 100644 --- a/src/db/sqlite/index.js +++ b/src/db/sqlite/index.js @@ -20,7 +20,7 @@ const schemaVersionsSupported = { max: { major: 1, minor: 0, - patch: 3, + patch: 4, }, }; @@ -828,7 +828,7 @@ class DatabaseSQLite extends Database { const events = this.statement.topicPublishHistory.all({ topicId, daysAgo: days }); const history = Array.from({ length: days }, () => 0); - events.forEach(({ daysAgo, contentUpdates }) => history[daysAgo] = contentUpdates); + events.forEach(({ daysAgo, contentUpdates }) => history[daysAgo] = Number(contentUpdates)); return history; } @@ -865,6 +865,8 @@ class DatabaseSQLite extends Database { const _scope = _fileScope('topicSetContent'); const topicSetContentData = { contentType: null, + httpETag: null, + httpLastModified: null, ...data, }; const logData = { @@ -881,7 +883,11 @@ class DatabaseSQLite extends Database { if (result.changes != 1) { throw new DBErrors.UnexpectedResult('did not set topic content'); } - result = this.statement.topicSetContentHistory.run({ topicId: data.topicId, contentHash: data.contentHash, contentSize: data.content.length }); + result = this.statement.topicSetContentHistory.run({ + topicId: data.topicId, + contentHash: data.contentHash, + contentSize: data.content.length, + }); if (result.changes != 1) { throw new DBErrors.UnexpectedResult('did not set topic content history'); }