widok / todomvc

TodoMVC implementation for Widok
GNU General Public License v3.0
35 stars 5 forks source link

Removing uncompleted item can lead to negative completed count #2

Open deterdw opened 9 years ago

deterdw commented 9 years ago

Unless I change line 29 of Application.scala to

todos.removals.attach(t=>if (completed.contains$(t)) completed -= t)

the completed count sometimes becomes negative! (Try removing an uncompleted item.)

To me this actually seems like a bug in the BufSet source. (Adding an existing element to a set, or removing a non-existent one should ideally not influence the count.) Fundamentally the problem seems to me that the size of the set is stateful, therefore cannot really be part of DeltaBufSet.