REST API: db/completion no output when one folder is paused

When I use REST API GET /rest/db/completion it returns

{
  "completion": 100,
  "globalBytes": 56361182709,
  "globalItems": 120147,
  "needBytes": 0,
  "needDeletes": 0,
  "needItems": 0,
  "sequence": 0
}

with two folders running.

When I pause one of the folder I get:

folder is paused

The docs say:

Aggregated completion status for all folders on the local device:
    /rest/db/completion

Any hints ?

That seems like a bug to me. File it… The GUI sums this on its own I think, and there the local state gets reduced when a folder is paused, as that folder “disappears” from the summary.

I think that’s more of a limitation than a bug: We do remove paused folders from the model state, thus a call to /rest/db/completion checks if there is state, sees there is none, checks config and sees it’s paused → error. We’d have to either not remove the FileSet from model for paused folders or create one (potentially expensive) on API calls.

To mirror the GUI behaviour we’d simply skip paused folders in the iteration/calculation. I don’t think it makes sense to talk about the completion status of paused folders…

1 Like

Right got it, I was forgetting that there’s a “global, not folder specific completion”.

1 Like

filed: REST API: db/completion no output when one folder is paused · Issue #8219 · syncthing/syncthing · GitHub

keep on going and stay healthy!

1 Like