[Bug]: macOS: the server reads every file in a project on OneDrive (File Provider), re-downloading files the user had set to online-only #49728
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server (desktop build)
What happened#
I have a T3 project whose root is a OneDrive folder on macOS (~/Library/CloudStorage/OneDrive-Personal/<project>). One subfolder holds an archive of about 12,900 files (about 115 GB) that I had set to "Free up space", so the files were dataless placeholders. I never opened that subfolder in T3, and no thread worked on it.
After I pinned the project and worked in a thread on a different subfolder, OneDrive began downloading the archive. I clicked "Free up space" again, and the downloads started over.
lsof caught the T3 server process (the --require ... apps/server child of the desktop app) reading the files one at a time through the same descriptor:
11:13:09 T3 Code <server-pid> 47r <archive>/<case-folder-A>/<file>.txt
T3 Code <server-pid> 47r <archive>/<case-folder-A>/<sub>/<file>.txt
T3 Code <server-pid> 47r <archive>/<case-folder-B>/<sub>/<file>.JPG
...
11:16:44 T3 Code <server-pid> 47r <archive>/<case-folder-K>/<sub>/.../<file>.htm
The walk goes depth-first in code-point order, at about one file per second. That rate matches one OneDrive download per file. Every file it opens gets materialized.
Timeline (local time, same day)#
| Time | Event |
|---|---|
| 10:45:36 | Project pinned in the sidebar |
| 10:46:11 to 10:52:25 | 545 files materialized in another large subfolder of the same project (also not used by any thread) |
| 11:02:02 to 11:16+ | The walk moved into the archive subfolder. The local copy went from 0 to 660 files and about 250 MB, still rising |
| ~11:23 | Quit T3 (Cmd+Q) and freed up space again. The local copy dropped to 1 file |
| 11:26 to 11:30+ | T3 restarted. The project is still present and pinned. No further reads, and the count stayed at 1 |
So the walk does not seem to run just because the project exists. Something during that session started it, and it did not run again after the restart, at least while I was watching.
What I ruled out#
- OneDrive policy: no item in the archive subtree is pinned ("Always keep on this device"). Every file's content policy is
lazy(fromfileproviderctl dump). - Git: the project root is not a git repository, so the periodic
git statuspolling exits immediately. - Other agents and threads: no other agent process had files open there, and no thread transcript mentions the subfolder.
- Spotlight, Time Machine and QuickLook did not hold the files open. The reader was always the T3 server process.
- T3 snapshots:
~/.t3/userdata/snap-shotsis empty.
No span in server.trace.ndjson matches the reads. Around 10:46 and 11:02 the trace has only git status polling, WorkspaceFolders.scan, ProjectFaviconResolver.* and WorkspacePaths.resolveRelativePathWithinRoot (713 calls at 11:03:4x). None of them should read file contents. Whatever does the reads is not traced.
Network check: during the walk the server process sent only a few KB per minute (nettop), and all its sockets were loopback. So I don't think the content leaves the machine. I'm reporting this as a bug, not a security incident.
Questions#
- Which feature reads file contents across the whole project tree? Is it the project-search content index (
FileFinder/ fff, as in #37086), a watcher, or something else? - What starts it: pinning, opening the project, the file viewer, or
@mentions? And why did it not run again after a restart? - Can it skip dataless files on macOS?
st_flags & SF_DATALESS(0x40000000) shows whether a file is online-only without materializing it. The same goes for File Provider and iCloud placeholders. - Could there be a per-project exclude list or size limit, or a warning when a project root is inside
~/Library/CloudStorage?
Related#
- #37789: the same class of problem on Windows. A watcher enumerates on-demand placeholders, here the Phone Link CrossDevice mount, and triggers mass downloads.
- #28510 / #26417: reads of evicted iCloud files block the libuv pool on macOS. A full-tree content walk over dataless files would hit the same path whenever the provider is slow or offline.
- #37086: the content index reads every file in the project.
Impact#
Major. "Free up space" stops working for any large OneDrive, iCloud or Dropbox folder inside a project. A whole-tree walk could re-download about 115 GB here, with disk and bandwidth to match.
Version or commit#
T3 Code (Beta) 0.1.14 (com.t3tools.t3code, Developer ID T3 Tools, Inc., notarized)
Environment#
macOS 27.2.1 (26B131), Apple Silicon MacBook Air, OneDrive 26.213.1101 (File Provider mode). Server started by the desktop app.
tanstack-source added labelsbug
Sign in to join this conversation.