Apologies if I've filed a bug when it should come under feature/enhancement!
I couldn't find any docs on response caching, but happy to update them if there are any.
Before the change?
If the CachingHttpClient received a non-200 and non-304 response from GitHub, it still attempts to update the underlying response cache, resulting in a higher number of subsequent cache misses if IResponseCache implementations don't guard for it themselves.
After the change?
Only attempts to update the response cache if a 2xx response code is received from GitHub.
Pull request checklist
[x] Tests for the changes have been added (for bug fixes / features)
[x] Docs have been reviewed and added / updated if needed (for bug fixes / features)
Does this introduce a breaking change?
I don't believe this is classed as a breaking change, but it is a change in behaviour that could impact users who rely on it calling the response cache for non-200 responses.
I am going to classify this as a breaking change due to the change in behavior in potential expectations that you point out. This is a great change, thank you for doing it! ❤️
Resolves https://github.com/octokit/octokit.net/issues/2876
Apologies if I've filed a bug when it should come under feature/enhancement! I couldn't find any docs on response caching, but happy to update them if there are any.
Before the change?
CachingHttpClient
received a non-200 and non-304 response from GitHub, it still attempts to update the underlying response cache, resulting in a higher number of subsequent cache misses ifIResponseCache
implementations don't guard for it themselves.After the change?
Pull request checklist
Does this introduce a breaking change?
I don't believe this is classed as a breaking change, but it is a change in behaviour that could impact users who rely on it calling the response cache for non-200 responses.
[x] Yes
[ ] No