Skip to content

Ignore file events in excluded directories; sync empty files in real time - #22

Merged
SteveIves merged 2 commits into
masterfrom
exclude-file-events
Nov 20, 2026
Merged

SteveIves merged 2 commits into
masterfrom
exclude-file-events

Conversation

@SteveIves

Copy link
Copy Markdown
Collaborator

Why

Two problems showed up while testing a large Git branch switch on the previous release:

  1. Excluded directories were not honoured for real-time file events. Only the initial sync checked exclusions. The whole tree is watched, so files that changed or were deleted under an excluded directory (for example WINDOWS\DEPRECATED) were uploaded or deleted remotely. That produced "not found" delete warnings and created an unwanted Windows tree on the server. The old code only checked exclusions in the directory handlers, so this was there before the connection pool work, and the pool's recursive directory creation made the remote tree more complete.
  2. Genuinely empty files were never synced in real time. A file was only treated as ready once it was unlocked and non-empty, so a zero-byte file waited 30 seconds and was then skipped with Timeout waiting for file ready. The initial sync was not affected.

What changed

  • File events now check the file's directory and each parent up to the root, using the same rules the initial sync uses to choose directories: ExcludedDirectories, their subdirectories, and the built-in .git, .vs, bin, obj and dotted-name exclusions.
  • A file renamed into an excluded directory is deleted remotely (if delete support is on). A file renamed out of one is uploaded, with no cleanup of an old remote copy that never existed.
  • A newly created empty file gets a 2 second grace period for a writer to fill it, then is synced as an empty file. The 30 second limit still applies to locked files.

Testing

  • Library builds with no errors or warnings.
  • The exclusion check was verified directly on a temporary tree with an excluded Windows folder: files under it and under .git, obj and a dotted directory were excluded, and files under other directories and in the root were not.
  • Not run against a server. The empty-file change was prompted by FIL-POHMST.SDL and STR-POHMST.SDL, which are committed as zero-byte files in the test repo.

Notes

  • Any Windows tree already uploaded to the server by earlier real-time events is not removed by this change and needs deleting by hand.

🤖 Generated with Claude Code

SteveIves and others added 2 commits November 20, 2026 12:56
Only the initial sync honoured excluded directories. The whole tree is watched, so files that changed or were deleted in an excluded directory (or one of its subdirectories, or a built-in excluded one such as .git or obj) were uploaded or deleted remotely, producing 'not found' warnings. File events are now checked the same way the initial sync chooses directories. A file renamed into or out of an excluded directory is treated as a delete or an upload respectively.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A file was only treated as ready to upload once it was unlocked AND non-empty, so a real zero-byte file waited 30 seconds and was then skipped with a 'Timeout waiting for file ready' warning. A newly created empty file now gets a 2 second grace period for a writer to fill it, then is synced as an empty file. The 30 second limit still applies to locked files.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@SteveIves
SteveIves merged commit dcebf1f into master Nov 20, 2026
1 check passed
@SteveIves
SteveIves deleted the exclude-file-events branch November 20, 2026 21:25
@SteveIves SteveIves mentioned this pull request Nov 20, 2026
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.

1 participant