Extension enters duplicate data into local `globalStorage` sqlite db
See original GitHub issueEnvironment 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 https://github.com/microsoft/vscode-python/issues/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:
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
:
- Completely remove extension from machine.
delete from ItemTable where key = 'ms-python.python';
in~/Library/Application\ Support/Code/User/globalStorage/state.vscdb
(mac).- Confirm key is empty in db.
- Reinstall extension.
- Reload window.
- Note entry under
ms-python.python
in the db. - Reload window.
- 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.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10
Top GitHub Comments
@karrtikr that seems to have fixed the issue.
@mattseddon Can you please try https://github.com/microsoft/vscode-python/suites/3965062360/artifacts/99642505, thanks!