Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: defer board+port state update for extensions #2233

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Sep 21, 2023

Motivation

To fix a race condition when setting the Arduin state for extensions at app startup. If the board+port state is set before it's read from the localStorage, clients will get an undefined fqbn.

Change description

Defer updating the board+port state for extensions when it's ready.

Other information

Ref: #2165
Ref: dankeboy36/esp-exception-decoder#10

Steps to reproduce:

  • you have an ESP32 board, the ESP32 platform and the debugger extension are installed.
  • create a new sketch,
  • attach the board, select the board and port, and save the sketch,
  • upload the sketch,
  • open the decoder terminal with the ESP Exception Decoder: Show Decoder Terminal command,
  • you see the FQBN and the sketch printed to the console,
  • quit IDE2,
  • start IDE2 and open the decoder terminal. You see the FQBN instead of the No board selected error message.

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)

If it is set before the board+port settings are restored from the
`localStorage`, extensions will see no board+port.

Ref: #2165
Ref: dankeboy36/esp-exception-decoder#10

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos kittaakos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Sep 21, 2023
@kittaakos kittaakos self-assigned this Sep 21, 2023
@kittaakos kittaakos requested a review from per1234 September 22, 2023 09:03
@kittaakos kittaakos marked this pull request as ready for review September 22, 2023 09:03
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 verified this fixes dankeboy36/esp-exception-decoder#10. Thanks Akos!

# for free to join this conversation on GitHub. Already have an account? # 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.

2 participants