Skip to content

fix(app): ignore stale file tree requests after reset - #47757

Open
Woolgathererer wants to merge 1 commit into
anomalyco:devfrom
Woolgathererer:file-tree-requests
Open

fix(app): ignore stale file tree requests after reset#47757
Woolgathererer wants to merge 1 commit into
anomalyco:devfrom
Woolgathererer:file-tree-requests

Conversation

@Woolgathererer

Copy link
Copy Markdown

Issue for this PR

Closes #47741

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

After a file-tree reset, an old listing could delete a newer pending request, overwrite its file list, or report a stale error. Check that each promise still owns its in-flight entry before applying results, errors, or cleanup.

The production change is three guards in tree-store.ts; there are no API or layout changes.

How did you verify your code works?

  • Added four deterministic tests against the real tree store with deferred list responses. Three regression cases failed before the fix; all four now pass.
  • File-tree and cache tests: 15 pass across four files (bun test --conditions=solid src/context/file/tree-store.test.ts src/context/file-content-eviction-accounting.test.ts src/components/file-tree.test.ts src/components/file-tree-v2-model.test.ts, from packages/app).
  • bun typecheck in packages/app, Prettier, and git diff --check pass.

Screenshots / recordings

No layout change. Verified the request race at the store boundary; no desktop UI recording was captured.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File-tree requests from before a reset can overwrite newer state

1 participant