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 3 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 95.23810% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/agent.ts 85.71% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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 Callback Inconsistency

The createConnection method's callback is not reliably invoked. It's never called when ValidationKit emits a validation:error event, causing connections to hang. Additionally, the callback can be invoked multiple times by the validation:success and socket error handlers, leading to race conditions or post-validation errors.

Fix in Cursor Fix in Web

…t validation

- Updated the HardenedHttpsAgent to use a dedicated tlsSocket variable for improved clarity.
- Introduced a new event 'hardened:validation:success' in the HardenedHttpsValidationKit to better manage validation success notifications.
- Adjusted the error handling to emit 'hardened:validation:error' for consistency in event-driven architecture.
- Modified tests to reflect the new event names and ensure proper validation flow.
@Gldywn Gldywn merged commit db6f8a0 into main Aug 14, 2025
1 of 2 checks passed
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