'Out of sync' doesn't register as an API error?

Here’s a folder.

And here’s the result of calling /rest/system/error.

{
    "errors": null
}

:frowning: Is there another way to get this status via the API?

FWIW what’s happening here is that my friend has this weird habit of putting a space on the end of a folder name. LIKE THIS . Which causes sync issues between a QNAP and a Synology.

I’d like to be able to detect when she does this and correct it. I’m using Uptime Kuma which is great, and could detect if the API returned a non-20x error code.

But as it is, it returns 200 OK.

Yes, the events API, and more specifically, filter for the FolderSummary type.

If the following name–value pair in the JSON object is greater than 0, there’s been a local change – e.g.:

"receiveOnlyChangedFiles": 0,

Your friend is not alone – a friend of mine does exactly the same thing to folders and files. :smirk:

The 200 is a HTTP status code in response to the web request rather than an indication of Syncthing folder status (it’s likely to most frequently be 200 and 403 when using the API).

I’m familiar with Uptime Kuma but haven’t used it. There’s built-in support for parsing JSON queries, so it should be pretty easy.

Amazing, cheers.

This JSONata will grab the latest value.

$sort($[type="FolderSummary"], function($l, $r) { $r.id - $l.id })[0].data.summary.receiveOnlyChangedFiles

And it’s trivial to configure this in Uptime Kuma. Job done! :raised_hands:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.