diff --git a/client/demo/boardapi.js b/client/demo/boardapi.js index d4d479b..8d0b534 100644 --- a/client/demo/boardapi.js +++ b/client/demo/boardapi.js @@ -395,7 +395,7 @@ module.exports = class extends BaseAPI { const removals = feature.tasks.map((t) => t.id); removals.push(feature_id); this.remove_all(tasks_store, removals, () => { - this.r(archive.count(), (count) => { + this.r(archive.index('board').count(this.name), (count) => { const boards = trans.objectStore('boards'); this.r(boards.get(this.name), (board) => { board.archive_count = count; @@ -430,7 +430,7 @@ module.exports = class extends BaseAPI { delete feature.tasks; tasks.push(feature); this.add_all(tasks_store, tasks, () => { - this.r(archive.count(), (count) => { + this.r(archive.index('board').count(this.name), (count) => { const boards = trans.objectStore('boards'); this.r(boards.get(this.name), (board) => { board.archive_count = count; diff --git a/client/tests/testdemoboardapi.js b/client/tests/testdemoboardapi.js index 94531bb..d5dbe63 100644 --- a/client/tests/testdemoboardapi.js +++ b/client/tests/testdemoboardapi.js @@ -859,6 +859,12 @@ describe("demo board api", () => { }); }); }) + .then(() => promise((cb) => { + // Archive a feature in an unrelated board to provoke leakage + new BoardAPI(view, 'sample', (api) => { + api.archive('proto', cb); + }); + })) .then(() => promise((cb) => { // Move the feature of interest to a different state, to make sure // the state is restored correctly