It looks like the @cache decorator ignores the first argument when generating a cache key. This led to a very confusing issue where some methods seemed to be cached correctly and some were incorrectly hashing to the same key and never being called.
It looks like this issue is from the _get_key function in repository.py:
if args:
serialized_arguments = (
self._store.serialize(args[1:]) # <================= HERE ==============
+ self._store.serialize([(k, kwargs[k]) for k in sorted(kwargs.keys())])
)
Perhaps this bug is because in the __call__ call function in cache_manager.py the store is already trimmed off args:
if len(args) > 0:
store = args[0]
args = args[1:] if len(args) > 1 else []
else:
store = None
It looks like the
@cache
decorator ignores the first argument when generating a cache key. This led to a very confusing issue where some methods seemed to be cached correctly and some were incorrectly hashing to the same key and never being called.It looks like this issue is from the
_get_key
function in repository.py:Perhaps this bug is because in the
__call__
call function in cache_manager.py the store is already trimmed off args: