Ignoring change watch events misses fast re-creation events and leaves environment state stale
@edvilme ci sta già lavorando.
Dal 9/6/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Environment data
- Python Environments extension version: 1.30.0
- Python extension (
ms-python.python) version: 2026.4.0 - VS Code version (Help → About): 1.123.0
- OS and version: macOS 26.5.1 (should happen on Linux and Windows too)
- Python version: Any
- Environment manager in use: Not relevant (uv)
- Shell: Not relevant (bash)
- Remote / container scenario: none
- Workspace type: single folder
- Is this a regression?: Unknown
Repro Steps
- Open a workspace containing a Python environment.
- Allow the Python Environments extension to discover the environment.
- Replace a watched file, such as an activation script or package
METADATA
file, using a rapid remove-and-create or atomic replacement operation. - Observe the Python Environments view - if the operation happened fast enough
to be coalesced into a UPDATED, it will not result in the extension picking
up the change.
A simple way to reproduce this is to use uv sync --python <different version to the current one> on a reasonably fast machine.
Expected behavior
The relevant environment or package state is invalidated and refreshed after
the watched file is replaced, regardless of whether VS Code reports the
operation to the extension as create/delete events or as a change event.
Actual behavior
The extension does not refresh when VS Code or (in case of FS Events on MacOS,
the underlying filesystem API) coalesces the DELETED and ADDED into a UPDATED.
Logs
Example (partially redacted and trimmed) of VS Code coalescing two parcel events:
...
2026-06-07 12:42:45.951 [trace] [File Watcher ('parcel')] [DELETED] /.../project/.venv/bin/activate
...
2026-06-07 12:42:46.015 [trace] [File Watcher ('parcel')] [ADDED] /.../project/.venv/bin/activate
...
2026-06-07 12:42:46.027 [trace] [File Watcher ('parcel')] >> normalized [CHANGED] /.../project/.venv/bin/activate
...
Additional context
The affected watchers explicitly ignore change events and register handlers
only for creation and deletion:
The second ignore argument is ignoreChangeEvents, so onDidChange is never
delivered. There is also no onDidChange listener.
A rapid delete and recreate may be coalesced into a change event by various
parts of the VSCode file watching stack:
-
Sometimes at the OS API, like it allegedly is for FSEvent on macOS
-
parcel (underlying library used by VS Code)
-
VS Code itself
Therefore, the assumption that the code makes, that changes are not relevant,
is unsound.
- Lingua principale
- TypeScript
- Stelle
- 140
- Fork
- 63
- Merge medio
- 1g 4h
- PR unite (30g)
- 35
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/vscode-python-environments
-
microsoft/vscode-python-environments#1799 · 1 assegnatario ·
-
microsoft/vscode-python-environments#1796 · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
triage-needed
microsoft/vscode-python-environments#1791 · 1 reazione · 2 assegnatari ·
-
triage-needed
Difficoltà 4/5 3-5 giorni Idoneità per principianti 74/100
microsoft/vscode-python-environments#1779 · 1 commento · 1 reazione ·
Tutte le issue di microsoft/vscode-python-environments
Issue simili
-
Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OpenNSW/nsw-srilanka#497 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
0xMiden/bridge-portal#132 ·
-
react-doctor severity:warning tech-debt
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
digidem/comapeo-cloud-app#403 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100