vimeo / vimeo/vimeo-networking-java
Force cache invalidation on API version change
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 128
- Forks
- 48
- PR merge metrics
- No merged PRs in 30d
Description
Issue Summary
When the API version changes, the cache is not cleared. This creates a potential for serialization crashes due to changes in object representations.
Suggested Improvements
Since the API version is no longer exposed to the library consumer, we should invalidate the retrofit cache when we detect an API version change internally. This will require us to persist the current version of the API to disk. We should do this either using a flat file (since this is a java library) or force the consumer to provide an implementation of an interface that writes and retrieves key value pairs to disk.
interface KeyValueStorage {
fun storeStringForKey(key: String, value: String?)
fun retrieveStringForKey(key: String): String?
}
Then we will force cache invalidation any time we detect a change in the API Version.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the Retrofit cache is stored and where the API version is detected. Decide how the current version will be persisted, then verify that a detected version change invalidates the cache without requiring the consumer to expose the API version; the proposed KeyValueStorage interface is one option mentioned in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100