Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

#573 Listen on the client's port change event #1545

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
kittaakos merged 1 commit into main from #573
Oct 17, 2022
Merged

#573 Listen on the client's port change event #1545

kittaakos merged 1 commit into main from #573
Oct 17, 2022

Conversation

Copy link
Contributor

@kittaakos kittaakos commented Oct 7, 2022

Motivation

Listen on the client's port changes to fix intermittent failure to recognize ports.

The problem was that the board select dialog was listening on the backend's board/port changes to show the available ports in the dialog. This was fundamentally incorrect as the following use case could happen.

  • Attach boards,
  • Start IDE2,
  • Backend starts and detects the boards and ports via the board list -w gRPC equivalent, dispatches board/port change event but client is not started yet,
  • Client starts,
  • Initialize the dialog with zero ports (this is common practice to init with empty),
  • Listen on the backend board/port changes (event never arrives),
  • Attach/detach a board, and the ports section in the dialog starts working.

It was never an issue with the Tool > Port menu, as it was correctly listening on the client's events:

this.boardsServiceProvider.onAvailablePortsChanged(() =>
this.updateMenus()
);

With the proposed changes, the dialog is correctly listening on the client's board/port changes, so it cannot miss the event.

Change description

Other information

Closes #573

Locally, it was easy to reproduce the defect. Attach boards before starting IDE2. When IDE2 is up, open the board select dialog. Ports were empty. Now, it should work with the build from this PR.

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)

@kittaakos kittaakos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Oct 7, 2022
Copy link
Contributor

@AlbyIanna AlbyIanna left a comment

Choose a reason for hiding this comment

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

Tested it and it works just fine. I've just left a little remark on the code, but to me it's already okay ✅

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.

I am not able to reproduce the fault so I can't verify that the change proposed here fixes it.

I don't experience any problems when using the build for this PR though.

If the board select dialog is listening on the backend's event,
the frontend might miss the event when it comes up, although boards
are connected and ports are discovered.
Closes #573
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@per1234 per1234 per1234 approved these changes

+1 more reviewer

@AlbyIanna AlbyIanna AlbyIanna approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Intermittent failure to recognize ports

AltStyle によって変換されたページ (->オリジナル) /