Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Prevent response storage calls if method is not supported #464

Merged
merged 9 commits into from
Jan 18, 2023

Conversation

CatchABus
Copy link
Contributor

@CatchABus CatchABus commented Jan 16, 2023

It seems plugin performs a storage.get call when getting response from requests that do not meet the method criteria (e.g. method POST).
By following the same principle in request interceptor, we make sure response does not make unnecessary calls.

@CatchABus CatchABus marked this pull request as draft January 16, 2023 17:37
@codecov
Copy link

codecov bot commented Jan 16, 2023

Codecov Report

Merging #464 (21badb3) into main (f2f216d) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #464   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines          507       516    +9     
  Branches       155       159    +4     
=========================================
+ Hits           507       516    +9     
Impacted Files Coverage Δ
src/interceptors/response.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@CatchABus CatchABus marked this pull request as ready for review January 16, 2023 17:48
@arthurfiorette
Copy link
Owner

Awesome!! Can you add a test case for it?

@CatchABus CatchABus marked this pull request as draft January 16, 2023 22:45
@CatchABus CatchABus marked this pull request as ready for review January 16, 2023 23:24
@CatchABus
Copy link
Contributor Author

Awesome!! Can you add a test case for it?

I added tests for fulfill and my new change regarding reject. Please feel free to point out any needed changes. :)

test/interceptors/response.test.ts Show resolved Hide resolved
test/interceptors/response.test.ts Show resolved Hide resolved
src/interceptors/response.ts Outdated Show resolved Hide resolved
src/interceptors/response.ts Outdated Show resolved Hide resolved
@arthurfiorette
Copy link
Owner

Thank you so much for your catch... I'll release ASAIC.

@arthurfiorette arthurfiorette merged commit 7ea3023 into arthurfiorette:main Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants