Skip to content

Restart discovery after re-initializing client. #1167

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 5 commits into from
Jul 14, 2022

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Jul 11, 2022

Motivation

Before #1132 the core gRPC client was not re-initialized (InitRequest) after the indexes update. Hence; the CLI could not provide up-to-date core search results to the IDE2. Now, it is working in IDE2 but after the core gRPC re-initialization, the board discovery (BoardListWatchRequest) is non-functional. This PR fixes it by sending out an event after the core client re-initialization so that the board discovery can restart in IDE2.

From here:

The Rescan gRPC function has been removed completely in favour of Init.

UpdateIndex and UpdateLibrariesIndex gRPC functions now don't implicitly reload the indexes, it has to be done explicitly with the Init function.

How to test:

  • start IDE2,
  • make sure you have at least one 3rd party URL in the Settings,
  • after the indexes update progress notification, try to attach and detach boards, the IDE2 should show the attached boards. This is not working on the main with f4a68e7.

Change description

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)

Otherwise, board discovery stops working after indexes update.

Signed-off-by: Akos Kitta <[email protected]>
@kittaakos kittaakos requested review from AlbyIanna and per1234 July 11, 2022 10:26
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Jul 11, 2022
@kittaakos
Copy link
Contributor Author

kittaakos commented Jul 11, 2022

For reviewers:

I am optimistic this PR should fix the discovery issue. At least, the nightly (f4a68e7) is broken here, the build from the PR works. Here is another way to verify. Connect at least one board to the machine before starting the IDE2. IDE2 starts, it's up and running, and shows the attached board(s). Wait for the indexes update, then detach the boards. IDE2 does not show the board changes from the nightly build. It works from this PR.

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.

The code looks fine with me.
LGTM 🚀

@per1234
Copy link
Contributor

per1234 commented Jul 11, 2022

UPDATE: fixed when using the build for e9cd290

I don't have a proper report prepared yet, but wanted to give a quick status update: Unfortunately, this does not fix the discovery issue for me on my Windows machine (it does work on my Linux machine). I will investigate further and provide full details as soon as possible.

@kittaakos
Copy link
Contributor Author

Unfortunately, this does not fix the discovery issue for me on my Windows machine

I can also see a defect on my Windows machine.

I will investigate further and provide full details as soon as possible.

Thank you! Do not spend too much time with it, the discovery also bogus on this slower Windows machine.

@kittaakos
Copy link
Contributor Author

  • IDE2 starts,
  • Index update runs, finishes,
  • I plug in a MKR1000, and I see this in the logs:
daemon INFO {"level":"info","msg":"boards watcher interrupted by client","time":"2022-07-11T18:25:38+02:00"}

Nothing else happens. IDE2 does not recognize the board.

@kittaakos kittaakos changed the title Restart discovery after re-initializing client. [WIP]: Restart discovery after re-initializing client. Jul 12, 2022
@kittaakos kittaakos marked this pull request as draft July 13, 2022 07:16
Akos Kitta added 3 commits July 13, 2022 09:39
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
@kittaakos kittaakos mentioned this pull request Jul 13, 2022
4 tasks
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 able to reproduce the bug this PR addresses when using the latest build from the main branch (7fed8fe).

Using the build from this PR, the discovery works extremely reliably. I was able to reproduce the issue reported at #1181 (comment), but very rarely even though I was specifically producing the conditions it occurs under.

So I would be satisfied with this fix even without the addition of the change proposed in #1181

@kittaakos kittaakos marked this pull request as ready for review July 14, 2022 06:43
@kittaakos kittaakos changed the title [WIP]: Restart discovery after re-initializing client. Restart discovery after re-initializing client. Jul 14, 2022
@kittaakos
Copy link
Contributor Author

As discussed, I am merging this PR and will open a follow-up described in #1181. Also, I'll put #1181 on hold.

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.

Teensy 4 turned on after I started IDE - No Port menu
3 participants