Skip to content

fix: HTTP request cancelation for native client#117

Open
tx3stn wants to merge 1 commit into
Snapchat:mainfrom
tx3stn:fix-native-http-cancelation
Open

fix: HTTP request cancelation for native client#117
tx3stn wants to merge 1 commit into
Snapchat:mainfrom
tx3stn:fix-native-http-cancelation

Conversation

@tx3stn

@tx3stn tx3stn commented Jul 17, 2026

Copy link
Copy Markdown

Description

Native HTTP performRequest returns the wrong shape for its cancel handle.

NativeHTTPClient.d.ts declares performRequest(...) => () => void (a bare function), and HTTPClient.ts calls the return value as (() => cancelFn?.()).
But the C++ factory HTTPRequestManagerModuleFactory.cpp returns an object { cancel: fn } instead.

This means trying to cancel an in flight http request on native always throws an error.

WebHTTPClient.ts already returns the bare function so works fine (and is aligned with the type defs).

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Documentation improvement
  • Performance optimization
  • Test improvement
  • Other (please describe)

Testing

  • Tests pass locally (bazel test //...)
  • Added/updated tests for changes (if applicable)
  • Tested on multiple platforms (iOS/Android/Web/macOS as applicable)
  • Manual testing performed (describe below)

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

  • Code follows project style guidelines
  • Documentation updated (if needed)
  • No breaking changes (or documented in description)
  • Commit messages follow conventional format
  • No secrets, API keys, or internal URLs included

Related Issues

Additional Context

@github-actions github-actions Bot added the area/build-system Bazel build rules and config label Jul 17, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build-system Bazel build rules and config

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant