apollographql / apollo-kotlin

:rocket:  A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform.
https://www.apollographql.com/docs/kotlin
MIT License
3.76k stars 653 forks source link

LruCache returns partial record for QUERY_ROOT resulting in cache lookup failure #2013

Closed edenman closed 5 months ago

edenman commented 4 years ago

Summary I am trying to load a record from the Apollo cache. I know the record exists in the SQL cache. However, LruNormalizedCache has an incomplete record for QUERY_ROOT that it returns from loadRecord so the entire cache lookup fails. Steps:

I'm going to try to write a testcase that shows this bug but I'm having trouble importing this project into AS.

Version 1.3.2

martinbonnin commented 2 years ago

Hi 👋 . Indeed, I don't think we have such a test case at the moment. Maybe it's working on dev-3.x, maybe the bug is still there. In all cases we should add a test case. If you feel like it, the IDE situation is way better now than it was one year ago.

You can open the apollo-android/tests composite project in a recent IntelliJ and it should work fine. Feel free to send a PR. Or if it's been way too long since last year, we'll get on it at some point.

github-actions[bot] commented 5 months ago

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Kotlin usage and allow us to serve you better.