fix: HTTP request cancelation for native client#117
Open
tx3stn wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
🎉 Thanks for your first contribution to Valdi!
A maintainer will review your PR soon. Here are a few things to check while you wait:
- ✅ All tests pass (
bazel test //...) - ✅ Your changes follow our coding standards
- ✅ You've added tests for your changes (if applicable)
- ✅ You've updated documentation (if needed)
Join our Discord community if you have questions!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Native HTTP
performRequestreturns the wrong shape for its cancel handle.NativeHTTPClient.d.tsdeclaresperformRequest(...) => () => void(a bare function), andHTTPClient.tscalls the return value as(() => cancelFn?.()).But the C++ factory
HTTPRequestManagerModuleFactory.cppreturns an object{ cancel: fn }instead.This means trying to cancel an in flight http request on native always throws an error.
WebHTTPClient.tsalready returns the bare function so works fine (and is aligned with the type defs).Type of Change
Testing
bazel test //...)Testing Details
Note
running the full integration test suite locally fails for me due to some pre-existing issues, not sure if these are setup issues my end, or they are known failures.
But running just the new test passed fine. (
bazel test //valdi:test_integration --test_output=errors --test_arg=--gtest_filter='HTTPClientCancelTests/*'Checklist
Related Issues
Additional Context