Skip to content
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

fix: serialPort.open() failing #35306

Merged
merged 1 commit into from Aug 15, 2022
Merged

fix: serialPort.open() failing #35306

merged 1 commit into from Aug 15, 2022

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Aug 11, 2022

Description of Change

Closes #35282.

Fixes an issue where serialPort.open() failed with NetworkError: Failed to open serial port..

This was happening because we returned nullptr from ElectronSerialDelegate::GetPortInfo:

const device::mojom::SerialPortInfo* ElectronSerialDelegate::GetPortInfo(
content::RenderFrameHost* frame,
const base::UnguessableToken& token) {
// TODO(nornagon/jkleinsc): pass this on to the chooser context
return nullptr;
}

and SerialService::OpenPort expects that delegate->GetInfo returns non-null in order to succeed.

Tested with https://gist.github.com/17afc65be515f3a1aec6256cb69f069d and an Arduino Uno.

Checklist

Release Notes

Notes: Fixed an issue where serialPort.open() failed with NetworkError: Failed to open serial port..

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/20-x-y target/21-x-y PR should also be added to the "21-x-y" branch. labels Aug 11, 2022
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Aug 11, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Aug 12, 2022
@jkleinsc jkleinsc merged commit 6725391 into main Aug 15, 2022
@jkleinsc jkleinsc deleted the fix-opening-serial-port branch August 15, 2022 15:49
@release-clerk
Copy link

release-clerk bot commented Aug 15, 2022

Release Notes Persisted

Fixed an issue where serialPort.open() failed with NetworkError: Failed to open serial port..

@trop
Copy link
Contributor

trop bot commented Aug 15, 2022

I was unable to backport this PR to "20-x-y" cleanly;
you will need to perform this backport manually.

@trop
Copy link
Contributor

trop bot commented Aug 15, 2022

I have automatically backported this PR to "21-x-y", please check out #35339

@trop trop bot added in-flight/21-x-y merged/21-x-y PR was merged to the "21-x-y" branch. and removed target/21-x-y PR should also be added to the "21-x-y" branch. in-flight/21-x-y labels Aug 15, 2022
schetle pushed a commit to schetle/electron that referenced this pull request Nov 3, 2022
fix: serialPort.open() failing
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
fix: serialPort.open() failing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/21-x-y PR was merged to the "21-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: WebSerial - SerialPort doesn't open in Electron 20
4 participants