Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix incorrect fetch cache handling (vercel#58460)
### What? When `FetchCache` is used, cache gets were incorrectly bailing. This would result in unexpected behavior, like continuously revalidating a cache key, as described in vercel#57978. ### Why? vercel#57902 introduced a refactor to the `FileSystemCache` and changed the interface of `get`, but this change was not propagated to `FetchCache`. Specifically, `fetchCache` was removed in favor of a new type `kindHint`. As a result, cache reads would always short circuit because `fetchCache` would never be defined. ### How? This updates the interface on `FetchCache` to match what is defined on the base `CacheHandler`. I've also updated the args to both `get` and `set` to be derived from `CacheHandler` so we don't have any type inconsistencies in the future. I will be following up with a test in the CLI repo to test against a deployed app (since minimalMode cannot be easily mocked in our test suite). Manually verified these changes against the repro in the original issue below, at the following URLs: https://revalidate-vercel-test-iota.vercel.app/fetch-cache-test https://revalidate-vercel-test-iota.vercel.app/revalidate-tag-test Fixes vercel#57978 Fixes vercel#58306
- Loading branch information