-
-
Notifications
You must be signed in to change notification settings - Fork 77
feat: allow request middleware to set a response to bypass downloader #106
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
Conversation
once/if you accept my two PRs, i'll submit PRs for new adapters to use the new code, as well as a PR for the docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please also add tests for the new code? There should be tests to check that
- Requests with set responses should not get sent
- Requests with set responses still get passed through the middleware stack (i.e. they get passed to
onResponseReceived
) withResponse
returns a new request with the provided response set but does not alter the original request
You can look at the existing DownloaderTest
and RequestTest
tests for reference. Let me know if you need help implementing the tests.
Can you clarify what you mean by adapters? |
Sorry, i meant the new classes like RedisQueue and CacheMiddleware. Thanks for the feedback, sorry that you had to flag so many issues, i'll fix them soon! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a few more comments on the tests but looks good otherwise 👍 You can ignore the failing commit lint action for now as I will squash the commit anyway and can fix it then.
e4c9373
to
c452738
Compare
Thank you for your patience! |
Can you have look at the merge conflict? Looks good otherwise! |
c452738
to
c3b74aa
Compare
Thanks for the contribution!
Please hold off on this for a bit because I'm not sure yet if I want to include a caching middleware in the core library yet. It would be a useful third-party package, however. PRs to the docs would be appreciated though 😊 |
No description provided.