podman-desktop
podman-desktop copied to clipboard
Duplicated entries for extension activation if extension's got into Failed state
Bug description
Often is happens that extension activation just times out in 10s. If I then retries to active it again, it usually comes with an error message (not always) that extension's id is already registered, or if the extension is activated, it duplicates its entries, like navigation bar items or any other items it bring -> system tray, etc.
Operating system
any
Installation Method
Installer from website/GitHub releases
Version
1.10.0
Steps to reproduce
No response
Relevant log output
No response
Additional context
No response
https://github.com/containers/podman-desktop/pull/7053 might help
A fix would be to dispose the subscriptions the extension failing would have already pushed.
https://github.com/containers/podman-desktop/blob/be0e823bc125728bb6506959e4beca93ccfc935c/packages/main/src/plugin/extension-loader.ts#L1401
Here we are providing the extensionContext, but we are not disposing the elements pushed in the subscriptions on error.
We should probably add a disposing mechanism in the error catching block
https://github.com/containers/podman-desktop/blob/be0e823bc125728bb6506959e4beca93ccfc935c/packages/main/src/plugin/extension-loader.ts#L1422-L1423
As this feel to be a bit critical (I was facing it, and https://github.com/containers/podman-desktop/pull/7053 is more a work around) , I can made the fix @benoitf