Skip to content

response interceptor doesn't fire when results are loaded from cache #235

Closed
@pwelter34

Description

@pwelter34

Describe the bug
When cachePolicy: CachePolicies.CACHE_FIRST, the response interceptor doesn't get called when the results are read from cache, ie the second time its called.

⚠️ Make a Codesandbox ⚠️
I've tweaked the useFetch + + Request/Response Interceptors demo to reproduce.

https://codesandbox.io/s/usefetch-provider-requestresponse-interceptors-6zwmw

To Reproduce
Steps to reproduce the behavior:

  1. let page run first time
  2. after loaded, click re-fetch button
  3. data read from cache
  4. the data is not transformed using the response interceptor

Expected behavior

the response interceptor should be called even if the data is read from cache.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions