Skip to content

chore: address more comments from #361 #389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 22, 2025
Merged

chore: address more comments from #361 #389

merged 7 commits into from
Jul 22, 2025

Conversation

fmenezes
Copy link
Collaborator

@fmenezes fmenezes commented Jul 22, 2025

Proposed changes

address more comments from #361

Checklist

@fmenezes fmenezes marked this pull request as ready for review July 22, 2025 15:11
@Copilot Copilot AI review requested due to automatic review settings July 22, 2025 15:11
@fmenezes fmenezes requested a review from a team as a code owner July 22, 2025 15:11
Copy link
Contributor

@Copilot 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 addresses code review feedback from issue #361 by improving function naming and simplifying error handling. The changes focus on making the code more maintainable and consistent.

  • Renamed handleRequest to handleSessionRequest for better clarity about the function's purpose
  • Simplified error handling in the main function by removing redundant logging and cleanup logic
  • Updated all references to use the new function name consistently

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/transports/streamableHttp.ts Renamed handleRequest function to handleSessionRequest and updated all call sites
src/index.ts Simplified error handling by removing duplicate cleanup logic and redundant logging

src/index.ts Outdated
} finally {
process.exit(1);
}
await transportRunner.close();
Copy link
Preview

Copilot AI Jul 22, 2025

Choose a reason for hiding this comment

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

The transportRunner.close() call in the catch block may fail and throw an error, which would mask the original error. Consider wrapping this in a try-catch block to ensure the original error is preserved and re-thrown.

Suggested change
await transportRunner.close();
try {
await transportRunner.close();
} catch (closeError: unknown) {
logger.error(LogId.serverCloseFailure, "server", `Error closing server during shutdown: ${closeError as string}`);
}

Copilot uses AI. Check for mistakes.

Copy link
Collaborator

@gagik gagik Jul 22, 2025

Choose a reason for hiding this comment

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

hmm.. this is a good point, maybe we can log the error beforehand? I guess we can also preserve the old structure

@fmenezes fmenezes mentioned this pull request Jul 22, 2025
1 task
@coveralls
Copy link
Collaborator

coveralls commented Jul 22, 2025

Pull Request Test Coverage Report for Build 16449914667

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 6 of 9 (66.67%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 80.261%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/index.ts 0 3 0.0%
Totals Coverage Status
Change from base Build 16448284562: 0.03%
Covered Lines: 3099
Relevant Lines: 3825

💛 - Coveralls

@fmenezes fmenezes requested a review from gagik July 22, 2025 15:18
@gagik
Copy link
Collaborator

gagik commented Jul 22, 2025

I guess we can omit the src/index.ts as well, Copilot comment is fair enough. We can ideally clean it up later

@fmenezes fmenezes enabled auto-merge (squash) July 22, 2025 16:22
@fmenezes fmenezes merged commit fdea0df into main Jul 22, 2025
15 of 17 checks passed
@fmenezes fmenezes deleted the chore_more_comments branch July 22, 2025 16:26
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.

3 participants