-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[core] Fixed race condition on contribution initialization #6817
[core] Fixed race condition on contribution initialization #6817
Conversation
} | ||
|
||
async onStart(app: FrontendApplication): Promise<void> { | ||
await this.workspacePreferences.ready; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@federicobozzini should we instead opt for a non-blocking asynchronous call?
Example:
@inject(FrontendApplicationStateService)
protected readonly stateService: FrontendApplicationStateService;
async onStart(app: FrontendApplication): Promise<void> {
this.stateService.reachedState('ready').then(
() => this.updateAddRemoveFolderActions(this.menuRegistry);
);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't use FrontendApplicationStateService
, FrontendApplicationContribution
provides already with sufficient lifecycle hooks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vince-fugnitto I've made it non-blocking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@federicobozzini with this change I no longer see the toolbar menu item for Add Folder to Workspace
, something which is added by:
this.updateAddRemoveFolderActions(this.menuRegistry);
In order for the item to return, one must right-click the empty area in the navigator for the command to exist. This is a regression from master and we may need to adjust.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vince-fugnitto Can you please be more specific about where that item should be? On master I see it only in the "Explorer" menu (just above the file navigator) and on the context menu opened on right-click in the navigator. I see the item in the same two places on this branch.
This is on the electron version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Federico Bozzini <federico.bozzini@gmail.com>
6dd2ee1
to
7b328ed
Compare
@vince-fugnitto please merge if it is good |
What it does
It fixes #6807 by delayin the registration of menu actions for the folder operations.
How to test
See #6807.
Review checklist
Reminder for reviewers