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
Remove extension when folder is removed during runtime #1518
Conversation
de6a1e4
to
ea15cb4
Compare
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
ea15cb4
to
3756b8b
Compare
if (instance) { | ||
try { | ||
instance.disable(); | ||
this.events.emit("remove", instance); | ||
this.instances.delete(lensExtensionId); | ||
} catch (error) { | ||
logger.error(`${logModule}: deactivation extension error`, { lensExtensionId, error }); | ||
} | ||
} | ||
} |
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.
What do you think about the if (!instance) { return; }
style instead?
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.
I don't see that being necessarily better, but fixed
if (!this.extensions.delete(lensExtensionId)) { | ||
throw new Error(`Can't remove extension ${lensExtensionId}, doesn't exist.`); | ||
} | ||
|
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.
New line at the end of a function?
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.
Fixed
prettier@^2.2.0: | ||
version "2.2.0" | ||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.0.tgz#8a03c7777883b29b37fb2c4348c66a78e980418b" | ||
integrity sha512-yYerpkvseM4iKD/BXLYUkQV5aKt4tQPqaGW6EsZjzyu0r7sVZZNPJW4Y8MyKmicp6t42XUPcBVA+H6sB3gqndw== | ||
|
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.
I don't see any references to it in any of this diff. Are you sure you are actually using it for your intended purpose?
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.
That was mentioned in the issue description, jest requires this dependency for inline snapshots: jestjs/jest#8467
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.
Ah I saw that comment, but I assumed that it would have to be explicitly "used" somewhere.
Fixes #1461