Skip to content

Try-fix webserial disconnect not actually disconnecting#796

Merged
danditomaso merged 2 commits into
mainfrom
fix-webserial-close
Aug 20, 2025
Merged

Try-fix webserial disconnect not actually disconnecting#796
danditomaso merged 2 commits into
mainfrom
fix-webserial-close

Conversation

@thebentern

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 webserial disconnect functionality by implementing proper cleanup of streaming operations before closing the serial port connection. The changes follow Web Serial API best practices to ensure streams are properly cancelled and unlocked before closing the port.

Key changes:

  • Added proper cancellation mechanism using AbortController for pipe operations
  • Implemented stream cleanup before port closure to avoid locks
  • Made disconnect method asynchronous to handle cleanup operations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread packages/transport-web-serial/src/transport.ts
Comment thread packages/transport-web-serial/src/transport.ts Outdated
@vercel

vercel Bot commented Aug 20, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
web-test Ready Ready Preview Comment Aug 20, 2025 1:58pm

@danditomaso danditomaso left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@danditomaso danditomaso merged commit 5b2c25d into main Aug 20, 2025
4 checks passed
@danditomaso danditomaso deleted the fix-webserial-close branch August 20, 2025 15:01
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