X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=src%2Fdb%2Fbase.js;h=de0cd44a1b9c5a77eb0e8fcb22771ffbf7c488c1;hb=17b4ff9c1974842c02071d2cd02144d2e5a99eb5;hp=21e26642fad6ab703ef5c0a7a094180b4b3d19bc;hpb=28de4364128a4b03918a8cbe868009b5d427220a;p=websub-hub diff --git a/src/db/base.js b/src/db/base.js index 21e2664..de0cd44 100644 --- a/src/db/base.js +++ b/src/db/base.js @@ -96,7 +96,7 @@ class Database { const current = svh.schemaVersionObjectToNumber(currentSchema); const min = svh.schemaVersionObjectToNumber(this.schemaVersionsSupported.min); const max = svh.schemaVersionObjectToNumber(this.schemaVersionsSupported.max); - if (min >= current && max <= current) { + if (current >= min && current <= max) { this.logger.debug(_scope, 'schema supported', { currentSchema, schemaVersionsSupported: this.schemaVersionsSupported }); } else { this.logger.error(_scope, 'schema not supported', { currentSchema, schemaVersionsSupported: this.schemaVersionsSupported }); @@ -351,6 +351,16 @@ class Database { } + /** + * Remove any expired subscriptions to a topic. + * @param {*} dbCtx + * @param {*} topicId + */ + async subscriptionDeleteExpired(dbCtx, topicId) { + this._notImplemented('subscriptionDeleteExpired', arguments); + } + + /** * Claim subscriptions needing content updates attempted. * @param {*} dbCtx @@ -533,6 +543,7 @@ class Database { this._notImplemented('topicGetAll', arguments); } + /** * Get topic data, without content. * @param {*} dbCtx @@ -563,14 +574,15 @@ class Database { this._notImplemented('topicGetContentById', arguments); } - // /** - // * Call after an unsubscribe, to check if a topic is awaiting deletion, and that - // * was the last subscription belaying it. - // * @param {String|Integer} data topic url or id - // */ - // async topicPendingDelete(dbCtx, data) { - // this._notImplemented('topicPendingDelete', arguments); - // } + + /** + * Attempt to delete a topic, which must be set isDeleted, if there + * are no more subscriptions belaying its removal. + * @param {*} topicId + */ + async topicPendingDelete(dbCtx, topicId) { + this._notImplemented('topicPendingDelete', arguments); + } /**