You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Recreated folders can show deleted files in the Files panel #36589
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
Keep the Files panel mounted and expand src, initially containing old.ts.
Refresh while another actor removes src. The child listing succeeds with the old contents, while the parent listing observes the removal. This ordering can arise with coalesced refreshes and concurrent filesystem edits.
Recreate src containing new.ts, then refresh the root and expand src.
The deterministic reproduction is a real React browser test controlling directory-response ordering, rather than a full-app filesystem race. It is included in the accompanying fix as reloads a removed folder when it reappears under the same name in useDirectoryEntries.browser.test.tsx.
Expected behavior
The recreated folder loads its current files, including src/new.ts.
Actual behavior
The file tree reattaches src/old.ts and ordinary expansion skips the directory read. Removed descendants retain their cached listings and loaded markers. A normal child ENOENT already clears the marker and does not trigger this bug.
Linux, Chromium browser test. Web and desktop share this file browser. Concurrent agent or external filesystem edits can produce the ordering; prevalence is not measured.
Logs or stack traces
Focused test on current main: expected src/new.ts, received src/old.ts.
Workaround
Refresh again after the folder reappears, or remount the Files panel.
Activity