Skip to content

Extension enters duplicate data into local globalStorage sqlite db #17488

@mattseddon

Description

@mattseddon

Environment data

  • VS Code version: 1.60.1
  • Extension version (available under the Extensions sidebar): v2021.9.1246542782
  • OS and version: Darwin x64 20.6.0
  • Python version (& distribution if applicable, e.g. Anaconda): Multiple (pyenv)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): Multiple (all three listed)
  • Relevant/affected Python packages and their versions: N/A
  • Relevant/affected Python-related VS Code extensions and their versions: ms-python.python
  • Value of the python.languageServer setting: Pylance

Expected behaviour

Extension does not fill the local globalStorage sqlite db (Memento) with erroneous data and maintains a list of available python interpreters.

When left unchecked this can lead to the extension host behaving in unexpected ways and it was difficult to diagnose without significant effort (see #17432 for original issue).

Actual behaviour

Each reload of a window causes PYTHON_EXTENSION_GLOBAL_STORAGE_KEYS under the ms-python.python key to grow. Under most circumstances the list of environments underneath is not refreshed, i.e environments that are no longer on the machine are still shown.

This is a copy of the ms-python.python key before I managed to clear the cache by deleting the extension and going through the steps listed here:

globalStorage.txt

Note: There are 712 matches to INTERPRETERS_CACHE in that file.

Steps to reproduce:

Unsure how to recreate the stale environments issue (seems cache related) but for the ever growing list of PYTHON_EXTENSION_GLOBAL_STORAGE_KEYS:

  1. Completely remove extension from machine.
  2. delete from ItemTable where key = 'ms-python.python'; in ~/Library/Application\ Support/Code/User/globalStorage/state.vscdb (mac).
  3. Confirm key is empty in db.
  4. Reinstall extension.
  5. Reload window.
  6. Note entry under ms-python.python in the db.
  7. Reload window.
  8. Note entry under ms-python.python in the db (PYTHON_EXTENSION_GLOBAL_STORAGE_KEYS will have grown in size and contain duplicate entries).

Logs

Nothing of note is captured in the logs.

Metadata

Metadata

Assignees

Labels

area-internalLabel for non-user facing issuesbugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priorityregressionBug didn't exist in a previous releaseverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions