Skip to content

Conversation

@Gldywn
Copy link
Owner

@Gldywn Gldywn commented Aug 14, 2025

  • fix: correct casing of useNodeDefaultCaBundle in documentation and examples
  • refactor(validation-kit-events): enhance event handling and simplify socket attachment

Description

Related Issue

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have read the CONTRIBUTING.md file.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

Gldywn added 2 commits August 14, 2025 11:23
…examples

- Updated references to `useNodeDefaultCABundle` to `useNodeDefaultCaBundle` for consistency across README.md, examples, and source files.
- Ensured accurate documentation of the function to prevent confusion regarding its usage.
…socket attachment

- Introduced a typed event emitter for validation events in HardenedHttpsValidationKit, allowing for better event management.
- Updated the attachToSocket method to remove the callback, relying on events for success and error handling.
- Improved the createConnection method in HardenedHttpsAgent to handle validation success through events.
- Adjusted tests to reflect changes in event handling and socket attachment logic.
@codecov
Copy link

codecov bot commented Aug 14, 2025

Codecov Report

❌ Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/validation-kit.ts 90.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Gldywn Gldywn closed this Aug 14, 2025
@Gldywn Gldywn deleted the validation-kit-events branch August 14, 2025 13:07
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bugbot free trial expires on August 23, 2025
Learn more in the Cursor dashboard.


// Attach the validation kit to the socket
this.#kit.attachToSocket(socket);

Copy link

Choose a reason for hiding this comment

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

Bug: Connection Validation Fails with Concurrent Requests

The createConnection method's event handling has several issues. Using once listeners on the shared validation kit means concurrent connections can result in callbacks being invoked incorrectly or not at all. Additionally, validation:error events are not handled, causing validation failures to hang connections instead of propagating errors.

Fix in Cursor Fix in Web

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.

2 participants