Skip to content

Fix monitor service id creation #1025

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 1 commit into from
Jun 8, 2022
Merged

Fix monitor service id creation #1025

merged 1 commit into from
Jun 8, 2022

Conversation

AlbyIanna
Copy link
Contributor

Motivation

This PR solves an issue that happens when uploading a sketch to some boards when the serial port is open.

Some boards need configuration parameters to append to the fqbn during the upload:
https://github.com/arduino/arduino-ide/blob/main/arduino-ide-extension/src/browser/contributions/upload-sketch.ts#L216-L219

and this is messing up with the MonitorManager because when notifyUploadStarted() is called, the monitor ID won't match the MonitorService instance that handles the serial connection:
https://github.com/arduino/arduino-ide/blob/main/arduino-ide-extension/src/node/monitor-manager.ts#L114-L119

Change description

Add some logic to make sure only the first part of an fqbn is relevant when creating a monitorID
https://github.com/arduino/arduino-ide/compare/fix-monitor-id?expand=1#diff-cf90510ad3f811b7073a1934f11698463693bf446a2521eb2a55f27a48328427R218-R220

Other information

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@AlbyIanna AlbyIanna requested review from fstasi and per1234 June 8, 2022 13:51
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

This fixes the issue for me. Great work @AlbyIanna!

@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Jun 8, 2022
@AlbyIanna AlbyIanna merged commit 726628e into main Jun 8, 2022
@AlbyIanna AlbyIanna deleted the fix-monitor-id branch June 8, 2022 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants