Skip to content

cleanup: GetMeshdFiles hardcodes perpage=1000, silently truncates large folders #31

Description

@gitcoder89431

Problem

GetMeshdFiles in internal/syncthing/client.go fetches the need-to-sync list with a hardcoded limit:

c.get("/rest/db/need?folder="+MeshdFolderID+"&perpage=1000", &need)

If ~/meshd contains more than 1000 files needing sync, the extras are silently missing from needSet, so they show as InSync: true in the TUI and MCP list_files output when they're actually not in sync.

Fix

Either:

  1. Paginate through all pages using page + perpage until the result is exhausted, or
  2. Use a much larger value (e.g. 100000) with a comment explaining the trade-off, or
  3. Add a page/perpage parameter to GetMeshdFiles so callers can control it

Option 1 is most correct. Option 2 is an acceptable short-term fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions