Skip to content

[Bug]: Recreated folders can show deleted files in the Files panel #36589

Closed

Description

@StiensWout

Before submitting

  • 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

  1. Keep the Files panel mounted and expand src, initially containing old.ts.
  2. 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.
  3. 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.

Impact

Minor bug or occasional failure

Version or commit

pingdotgg/main @ e80468b

Environment

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

  1. added
    vouch:trusted
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions