REST Call to get state "Local Additions" or "current sync state"?


I wanted to get the current “sync state” of a given folder. Calling the endpoint /db/status and checking the state value returns “idle” even when the folder ist marked as “Local Additions” in the GUI (Read only folder).

I get why the folder is idle, because it is read only, so it is literally doing nothing. On the other hand I don’t have any chance to check if the folder is currently 100% synced? Is there any parameter I am missing?

My workaround now is to call db/localchanged when the state is “idle” and check if the files list is empty. But that call is marked as very expensive in the documentation.

So I am looking for a better way?

It’s in the folder status result: GET /rest/db/status — Syncthing documentation. I don’t think that’s particularly expensive any more, but if you’re calling it regularly you should anyway listen to the FolderSummary event instead which has the same data: FolderSummary — Syncthing documentation