After longer meditation on LRU cache sources it turns out that has check does not actually care about expired items removal. Only the get check does that.
Also, it could be that the internal structure of the cached file/folder is changed while it's being cached. For now I've added a very simple (and fast) integrity check for cached folders, which makes sure that the amount of items in the folder (files and subfolders) has not been decreased since the last check.
After longer meditation on LRU cache sources it turns out that
has
check does not actually care about expired items removal. Only theget
check does that. Also, it could be that the internal structure of the cached file/folder is changed while it's being cached. For now I've added a very simple (and fast) integrity check for cached folders, which makes sure that the amount of items in the folder (files and subfolders) has not been decreased since the last check.Related to https://github.com/appium/appium/issues/16109