Currently, there are some methods in mutable Rd collections (all implementors of IMutableViewableMap, IMutableViewableList, and IMutableViewableSet) that will modify the collections but won't trigger the accompanying action (such as taking a cookie, writing the value to the protocol etc.).
This is caused by two issues:
- Interface delegation (i.e.
IMutableViewableMap<K, V> by map clause in the RdMap's inheritance list) will just call all the methods from the base object without wrapping them, if they aren't overridden in the implementing class. So, this delegation should be removed.
- Mutable collections in Kotlin expose members that allow indirect mutation of the collection: say,
Map::entries: MutableCollection<Map.Entry>, or iterator: MutableIterator, or even MutableMap.MutableEntry.
Particularly problematic methods in this regard are variations of MutableList::addAll and MutableMap::putAll (soon to be fixed), but I'm not sure about a systematic solution, yet.