Skip to content

Conversation

@KazuCocoa
Copy link
Member

No description provided.

@KazuCocoa KazuCocoa requested a review from Copilot June 13, 2025 06:18
Copy link
Contributor

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 enhances the requireFreePort function by improving how the existing local server is closed, adding error handling and logging to prevent potential hangs.

  • Added an err parameter to the close callback to catch and log errors when shutting down the server.
  • Ensured the promise always resolves, even if an error occurs.
  • Applied optional chaining on this.localServer.close.
Comments suppressed due to low confidence (2)

driver/lib/sessions/ios.ts:69

  • Consider adding a unit test that simulates an error in localServer.close(...) to verify that the error path logs correctly and still resolves the promise without hanging.
if (err) {

driver/lib/sessions/ios.ts:69

  • When logging the error, consider that err might not always be an Error instance with a message property. You could log err directly or ensure it’s converted to a string to avoid logging undefined.
if (err) {

@KazuCocoa KazuCocoa merged commit 7ffd5b1 into main Jun 13, 2025
11 of 12 checks passed
@KazuCocoa KazuCocoa deleted the KazuCocoa-patch-1 branch June 13, 2025 06:21
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