Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better describe what DownloadProgress event actually is/does #830

Open
mackinleysmith opened this issue Oct 6, 2023 · 3 comments
Open

Comments

@mackinleysmith
Copy link

Hey there! Syncthing is really an amazing piece of software and I am loving the experience of working with it. I am a Go programmer and would be happy to contribute if necessary.

Something I have noticed that is causing issues for me is that the event stream does not seem to behave as the documentation would indicate when it comes to tiny files. The docs for the DownloadProgress event state:

Files/folders appearing in the event data imply that the download has been started for that file/folder, where disappearing implies that the downloads have been finished or failed for that file/folder. There is always a last event emitted with no data, which implies all downloads have finished/failed.

This is definitely the case for reasonably sized files, however, I've noticed that if I add a file that is just a few bytes (think just typing "hello" into a text file and saving it), no DownloadProgress event is fired at all. The file synchronizes just fine, but I have yet to uncover any way for my application to become aware of these tiny files other than perhaps polling the filesystem, which is what I was hoping to let Syncthing do for me.

This is on Syncthing 1.25.0 but also observed in 1.23 and 1.24. I'm running the official Docker image on Mac.

Is there some other event that I should subscribe to? I thought a bit about watching the FolderCompletion event, but contrary to what's stated in the docs, it only seems to fire for remote devices, never local.

Steps to reproduce: just set up two nodes and write a small file, then check GET /rest/events.

@calmh
Copy link
Member

calmh commented Oct 6, 2023

Yeah, the implications in the docs are incorrect; it's never worked precisely like that. What it actually is is a periodic snapshot of files downloading at the time the event is fired; many files may be completely processed in between such updates. You need to look at it in correlation with ItemStarted and ItemFinished, or maybe the *IndexUpdated event, to get a complete picture of what's going on.

@mackinleysmith
Copy link
Author

Aha! That appears to be exactly what I needed. Should we perhaps update the docs to be a bit more descriptive?

@calmh
Copy link
Member

calmh commented Oct 7, 2023

Yes.

@calmh calmh transferred this issue from syncthing/syncthing Oct 7, 2023
@calmh calmh changed the title DownloadProgress event never fires for small files Better describe what DownloadProgress event actually is/does Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants