Skip to content

Folder watcher waits a fixed 10 s before every sync of a local change #1049

Description

@digodigo

FolderWatcher collects change events for notificationTimeoutC = 10s before it reports them (src/gui/folderwatcher.cpp). Together with the 2 s SyncEngine::minimumFileAgeForUpload this means a saved file leaves the machine at the earliest 10 s after the save, on any network.

On a 1 GbE LAN the wait dominates: 10 x 10 MB take 13.4 s, of which 10 s are waiting; with a 2 s delay the same upload takes 4.7 s (measured with a patched client against OpenCloud 7.1, macOS 26). Other clients on the same machine react within 1 to 2 s (Synology Drive, Nextcloud desktop, which uses minimumFileAgeForUpload as its only delay).

Files still being written are already handled independently of the 10 s: PropagateUploadFileCommon skips files whose mtime is younger than minimumFileAgeForUpload and schedules another sync run, and the "changed during upload" detection (FileSystem::fileChanged) triggers a re-upload. A shorter default would therefore cost an occasional repeated upload for applications that write slowly, not an inconsistent file on the server.

Discussed in #1047, where making the delay configurable was declined for support reasons. Would a lower default (e.g. 3 to 5 s) be acceptable, or a shorter delay once the change set has been quiet for a moment?

🤖 Generated with Claude Code

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions