-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
fix: getFeatures() invocation in plugin start() unhandled error #1778
base: master
Are you sure you want to change the base?
Conversation
Throw on error.
I think the proper fix would be to change This however may create a kind of a deadlock: getFeatures never returns because all plugins do not finish starting up because they are waiting for getFeatures... |
Return emtpy plugins array after maxTries has been reached.
Implemented a "wait a max number of retries" approach. |
@tkurki any further feedback? |
I think I was a bit too hasty with my Promise suggestion. I think using PropertyValues would be a much more sane API, as the listeners (other plugins) would be forced to handle updates in the set of features available not only during startup but all the time. For example when another plugin is activated. What do you think? |
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.
See my comment about PropertyValues.
Seems a reasonable approach to me.
|
That's correct. So next steps would be
|
(Addresses #1777)
Add test to
getFeatures()
to check if pluginManager has been initalised prior to interrogating features.Invoking
getFeatures()
in a pluginstart()
function causes an error as the pluginManager is still initialising plugins.Added a test prior to features being interrogated and throw a meaningful error on exception.