Skip to content

fix(files): rescan workspace from refresh actions - #7358

Closed
ralphsmith80 wants to merge 2 commits into
pingdotgg:mainfrom
ralphsmith80:fix/workspace-files-refresh
Closed

ralphsmith80 wants to merge 2 commits into
pingdotgg:mainfrom
ralphsmith80:fix/workspace-files-refresh

Conversation

@ralphsmith80

@ralphsmith80 ralphsmith80 commented Aug 18, 2026 •

Copy link
Copy Markdown

What this does

Refresh files now triggers a real server-side workspace index rescan before the clients reload the listing. Files created, renamed, moved, or deleted outside T3 become visible from the existing refresh controls on web, desktop, iOS, and Android, including remote environments.

Fixes #6452.

Verification

  • Focused WorkspaceEntries test: 31 passed
  • Typechecks: contracts, client runtime, server, web, and mobile
  • Targeted lint and format checks
  • Diff and secret scans

Intentional decisions

Normal list reads keep the cached index for performance. Only explicit refresh performs a scan. Repeated refreshes for the same environment and workspace share one in-flight scan. If a scan fails, the existing server service invalidates the cache so the follow-up read rebuilds it.

Generated with GPT-5.6 in the Codex harness through T3 Code.


Note

Low Risk
Scoped to explicit refresh UX and read-path RPC; list caching behavior for normal reads is unchanged, with a focused server test for rescan-after-cache.

Overview
File refresh no longer only re-fetches the cached listing—it triggers a server-side workspace index rescan first, so files changed outside T3 show up when users hit existing refresh controls on web and mobile.

A new projects.refreshEntries RPC wires through WorkspaceEntries.refresh, with read-scope auth. The client adds a refreshEntries command (single-flight per environment + cwd) that invalidates listEntries after a successful scan; normal list reads stay cached for performance.

Web useProjectEntriesQuery and mobile useProjectEntriesRefresh call that command and keep the file tree in a pending state until the scan finishes, replacing prior local query-atom refresh behavior.

Reviewed by Cursor Bugbot for commit b6f120f. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add projects.refreshEntries RPC to rescan workspace from refresh actions

  • Introduces a new projects.refreshEntries WebSocket RPC (defined in rpc.ts) that triggers a server-side rescan of workspace directory entries.
  • Adds a refreshEntries command in projectCommands.ts with single-flight concurrency keyed by [environmentId, cwd]; on success, it invalidates the listEntries query cache.
  • Replaces direct query refresh calls in the mobile Files screen and navigator pane with a dedicated useProjectEntriesRefresh hook that tracks isRefreshing state and ignores stale completions when environmentId or cwd change.
  • Updates useProjectEntriesQuery on web to use the same command-based refresh instead of useAtomRefresh.

Macroscope summarized b6f120f.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 17ef6742-1c99-4707-8f36-e8e3db377cba

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 18, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cea3826. Configure here.

Comment thread apps/web/src/components/files/projectFilesQueryState.ts
@macroscopeapp

macroscopeapp Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new RPC endpoint projectsRefreshEntries that adds server-side filesystem rescan capability, changing how refresh actions work. While well-scoped with test coverage, new server API endpoints warrant human review.

You can customize Macroscope's approvability policy. Learn more.

@ralphsmith80

Copy link
Copy Markdown
Author

Not sure if this is a real issue, but my agent got crazy opening PRs so closing for now.

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

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Files panel stays stale after external file creation, F5, and Refresh files

1 participant