Soil icon indicating copy to clipboard operation
Soil copied to clipboard

adding and removing keys should be logged in order to the journal

Open noha opened this issue 1 year ago • 5 comments

noha avatar Jun 24 '23 17:06 noha

I thought this would be fixed by using an OrderedDictionary in the skip list dictionary but that is already the case.

noha avatar Jun 27 '23 15:06 noha

"in order" means which order? The OrderedDictionary is sorted by when the key was added, not in the order that they are later in the index (see https://github.com/ApptiveGrid/Soil/issues/415 )

MarcusDenker avatar Jul 21 '23 11:07 MarcusDenker

with remove and add being in two different dictionaries, there is no order between them: we log first all adds, then all removes. This can lead to the order between add and remove passible being wrong ("add, remove, add remove" is logged as "add add remove remove")

MarcusDenker avatar Jul 21 '23 11:07 MarcusDenker

Now SoilIndexedDictionary uses newValues removedValues just for creating the journal.

To have the Journal in correct oder, we need to instead have one OrdredCollection that stores both add and removes.

But this list need to be condensed to not log multiple adds/remove for the same key

MarcusDenker avatar Dec 07 '23 11:12 MarcusDenker

Note from discussion:

  • We should not fix this now on the level of the SoilIndexDictionary, but do this later on the level of the page when it manages newValues/removedValues

MarcusDenker avatar Jan 15 '24 15:01 MarcusDenker