Skip to content

v1.33.0 disabled extension appears to be running #71752

Closed

Description

@john-aws

Issue Type: Bug

I can reliably reproduce this problem. It started happening today, following today's VS Code update (March 2019, 1.33.0). It is closely related to #21930.

I have formatOnSave=false but I am suddenly seeing my React JS files being modified upon save (the JSX is being mangled). I have the vscode-js-css-html-formatter extension installed, but disabled. Somehow, it appears to be functional (and also abusing formatOnSave=false).

The symptoms seem to suggest that the disabled extension is not actually disabled. If I uninstall the extension there is no indication that I need to reload VS Code to complete the uninstallation yet the save-on-format behavior is still present, post-uninstall.

If I uninstall the extension and actually reload VS Code, then the format-on-save behavior has gone and everything is good.

Any chance that v1.33.0 introduced a bug allowing disabled extensions, and uninstalled extension but VS-Code-not-yet-reloaded, to continue to run? Or is this extension somehow escaping whatever sandbox you have for disabled extensions?

This problem does not repro on v1.32.3.

VS Code version: Code 1.33.0 (0dd516d, 2019-04-04T15:11:32.076Z)
OS version: Darwin x64 16.7.0

Activity

  1. john-aws commented on Apr 5, 2019

    @john-aws
    Author

    Just noticed this bug raised against the extension: Formatter must unregister when being disabled

  2. sandy081 commented on Apr 5, 2019

    @sandy081
    Member

    john (@john-aws) I see reload action when I uninstall/disable the extension (vscode-JS-CSS-HTML-formatter). Can you please check if the extension is shown when you run the command Show Running Extensions before you disbaled/uninstalled it?

  3. added
    info-needed
    on Apr 5, 2019
  4. jrieken commented on Apr 5, 2019

    @jrieken
    Contributor

    The symptoms seem to suggest that the disabled extension is not actually disabled.

    How did you disable it? In the sense of disabling the extension or disabling it with its setting?

  5. szhu commented on Apr 5, 2019

    @szhu

    Ran across this issue as well. I have a bug report with system info at #71769.

    Sandeep Somavarapu (@sandy081) The disabled-but-not-really-disabled extension doesn't show up under Show Running Extensions.

    Johannes Rieken (@jrieken) I am alleviating this issue temporarily by just uninstalling the extensions I don't need. I guess if you have some extensions activated for only certain workspaces, you could be in a tough spot.

  6. john-aws commented on Apr 5, 2019

    @john-aws
    Author

    Sandeep Somavarapu (@sandy081) confirmed that the extension does not show up under Show Running Extensions after disabling but before uninstalling. In this state it does still appear to be reformatting my JSX.

    Johannes Rieken (@jrieken) to disable the extension, I used the native VS Code Extension Manager, clicked the settings cog, and chose Disable (not Disable (Workspace)).

  7. sandy081 commented on Apr 8, 2019

    @sandy081
    Member

    If it is not shown under running extensions, the extension should not be running unless there is a bug in it.

    alexandrudima any insights on this?

  8. john-aws commented on Apr 9, 2019

    @john-aws
    Author

    If it's technically possible for a disabled extension to run (I don't know for sure if it is, but it seems to be), shouldn't VS Code exert more control? A clear preference from the user to disable an extension would ideally take the decision out of the hands of the extension writer.

  9. sandy081 commented on Apr 10, 2019

    @sandy081
    Member

    john (@john-aws) It should not happen. When a user disables an extension and reload the window, it should not run. Can you please provide the steps for me to reproduce, also the set up (extensions you have) would be helpful too?

  10. szhu commented on Apr 11, 2019

    @szhu

    Sandeep Somavarapu (@sandy081) my #71752 has specific repro steps.
    (sorry if you were already aware -- just making sure!)

  11. 4 remaining items

  12. removed
    info-needed
    on Apr 16, 2019
  13. sandy081 commented on Apr 16, 2019

    @sandy081
    Member

    alexandrudima

    Today Johannes Rieken (@jrieken) has seen similar issue and we debugged it together. Outcome is that we are starting the extension host with all scanned extensions and not filtering the disabled extensions. See following code

    https://github.com/Microsoft/vscode/blob/f7b33b613ed05e3649da8fb93cec88dac7d85856/src/vs/workbench/services/extensions/electron-browser/extensionService.ts#L433-L440

    Not sure why are we not filtering out disabled extensions if it is initial start?

  14. added
    important
    on Apr 16, 2019
  15. added a commit that references this issue on Apr 16, 2019
    e22ea3d
  16. added a commit that references this issue on Apr 17, 2019
    83aac26
  17. sandy081 commented on Apr 17, 2019

    @sandy081
    Member

    Reverted the fix. I digged deep and above fix is not correct as the bug is not on renderer side. Root cause is in extension host.

    • We create extension host with all extensions
    • We start it after with only enabled extensions
    • We are not holding those activation events those come between ext host is created and ext host is started. This is causing disabled extensions to activate.

    Will come up with the accurate fix.

  18. added a commit that references this issue on Apr 17, 2019
    879c3a7
  19. added a commit that references this issue on Apr 17, 2019
    b4cd374
  20. aeschli commented on May 8, 2019

    @aeschli
    Contributor

    Verified by disabling the vscode-js-css-html-formatter, relaod and save a js file. No formatting happens.

  21. locked and limited conversation to collaborators on Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugextension-hostimportantverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions