Skip to content

Commit

Permalink
Fixed: archive count was total accross boards
Browse files Browse the repository at this point in the history
  • Loading branch information
jimfulton committed Jul 2, 2017
1 parent 67c11d7 commit d6cbf77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/demo/boardapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions client/tests/testdemoboardapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d6cbf77

Please sign in to comment.