Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 5, 2025

The test for dispatchEvent error handling was changed to use a try-catch block that ignores all exceptions, making the test always pass regardless of whether exceptions occur.

Changes

  • Restored expect(() => api.dispatchEvent(event)).not.toThrow() assertion in test/connection-state.spec.ts:238
  • Removed try-catch wrapper that silently swallowed exceptions

The test now properly validates that dispatchEvent handles callback errors without throwing, rather than unconditionally passing.

// Before (always passes)
try {
  api.dispatchEvent(event);
} catch (e) {
  // ignore
}

// After (validates behavior)
expect(() => api.dispatchEvent(event)).not.toThrow();

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: igorls <4753812+igorls@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 5, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • x
    • Triggering command: /home/REDACTED/.bun/bin/bun bun test ./test/builder.spec.ts ./test/call-wrapper-preview-stream.spec.ts ./test/call-wrapper-progress.spec.ts ./test/call-wrapper-streaming.spec.ts ./test/call-wrapper.spec.ts ./test/client-behavior.spec.ts ./test/client-preview.spec.ts ./test/client-websocket.spec.ts ./test/connection-state.spec.ts ./test/defensive-event-handling.spec.ts ./test/enqueue-error.spec.ts ./test/enqueue-failures.spec.ts ./test/features-extensions.spec.ts ./test/features-more.spec.ts ./test/features.spec.ts ./test/manager-monitoring.spec.ts ./test/model-loading.spec.ts ./test/per-job-timeouts.spec.ts (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] WIP Address feedback on event-based system implementation Restore proper Jest assertion in event dispatch error handling test Dec 5, 2025
Copilot AI requested a review from igorls December 5, 2025 03:58
@igorls igorls marked this pull request as ready for review December 5, 2025 06:36
Copilot AI review requested due to automatic review settings December 5, 2025 06:36
@igorls igorls merged commit 5c2f5d2 into feat/event-based-logging Dec 5, 2025
@igorls igorls deleted the copilot/sub-pr-6 branch December 5, 2025 06:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a test that was inadvertently changed to always pass regardless of the actual behavior being tested. The test for dispatchEvent error handling in the onReconnectionFailed callback flow was using a try-catch block that silently swallowed all exceptions, making it impossible to detect if the error handling was working correctly.

Key Changes:

  • Restored proper Jest assertion expect(() => api.dispatchEvent(event)).not.toThrow() in the error handling test
  • Removed the try-catch wrapper that made the test unconditionally pass

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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