expiringdict icon indicating copy to clipboard operation
expiringdict copied to clipboard

Changed items aren't moved to the end of the list, will be expired in the wrong order

Open MattEttus opened this issue 6 years ago • 1 comments

The order in an OrderedDict is based on the order of original insertion. If you modify an item, even though the expiry is changed, it stays in the same position as it originally was. This can cause the wrong items to be dropped.

The solution would be to first delete the item before setting it in set item.

MattEttus avatar Dec 10 '18 22:12 MattEttus

To clarify, this can result in newer unexpired items being pushed out while older expired items remain.

MattEttus avatar Dec 10 '18 22:12 MattEttus