Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when id params have same id, returnValue will occur same result if cache expired in loop #44

Open
Laverrr opened this issue May 29, 2023 · 1 comment

Comments

@Laverrr
Copy link

Laverrr commented May 29, 2023

we get idsArgument from CollectionCacheableCacheInterceptor#injectCollectionArgument.
but when args have the same id params, we will get repeated id in idsArgument.

Then when the method run into CollectionCacheableCacheInterceptor#findIdsInCache

because idsArgument is run in loop,if have two or more same id occur. The first id hit cache will put into cacheResult.

At that time, if cache expired. The next the id will not match cache and then get result from DB, then put the result into uncachedResult.

when merge uncachedResult and cacheResult. The returnValue will occur two or more same id result when use ListReturnValueConverter

@Laverrr
Copy link
Author

Laverrr commented May 29, 2023

The way to fix the bug is return distinct idsArgument in method CollectionCacheableCacheInterceptor#injectCollectionArgument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant