Skip to content

Auto-accept accepts folders that are in the device's ignored folders #10935

Closed

Description

@axos88

What happened?

Device A has auto-accept enabled for device B. Folder F is in A's ignored folders for B. When B announces F, A auto-accepts F anyway. The config cleanup then removes the ignore entry, because the folder exists again. The ignore is lost and there is no warning.

With auto-accept enabled, this means that a device cannot leave a shared folder. The folder comes back at the next connection, and ignoring it does not help.

Steps to reproduce, with two devices A and B, where A has auto-accept enabled for B:

  1. On B, create folder F and share it with A. A auto-accepts F.
  2. On A, remove F.
  3. On A, add F to the ignored folders of B (The ignore entry must be added after the folder is removed, because while the folder exists, the config cleanup drops the entry - although one could argue that shouldn't be the case either)
  4. On A, pause B and resume it, so that B sends a new cluster config.
  5. A auto-accepts F again, and the ignored folders of B are empty.

With auto-accept enabled, the GUI never shows the "new folder" dialog, so it has no "Ignore" button. A user gets into this state by ignoring a folder before enabling auto-accept, or through the config file or the REST API.

If the folder's label directory still exists under the default path, the re-accepted folder goes into a new directory named after the folder ID.

Possible fix

The auto-accept loop in ClusterConfig (lib/model/model.go) runs before the ignored-folder check in ccHandleFolders and does not check deviceCfg.IgnoredFolder(). I have a fix with a test on this branch: https://github.com/axos88/syncthing/tree/fix-auto-accept-ignored-folder. It skips ignored folders in the auto-accept loop. The new test fails without the change, and go test ./lib/model/ passes with it.

Syncthing version

v2.1.7 "Hafnium Hornet" (go1.27.3 linux-amd64)

Platform & operating system

Linux amd64, Ubuntu 24.04

Browser version

No response

Relevant log output

On A, after step 4:


INF Auto-accepted folder (folder.label=F folder.id=testf-00001 folder.type=sendreceive path=...)
INF Adding folder (folder.label=F folder.id=testf-00001 folder.type=sendreceive log.pkg=model)

Activity

  1. added
    bug
    needs-triage
    on Oct 22, 2026
  2. added theissue type on Oct 22, 2026
  3. added a commit that references this issue on Oct 22, 2026
    3809aa7
  4. axos88 commented on Oct 22, 2026

    @axos88
    ContributorAuthor

    TBH, the ignore seems like a workaround in reality, (but that does not influence that the reported bug is real). The real problem in my use case is that when B removes F, A keeps offering F to B. With auto-accept on on B from A, F then comes back, but I believe this can be avoided since A can notice that B dropped F, from information it already has:

    • When B announced F earlier, A stored B's index ID for F. A keeps it until B is removed from F in A's config.
    • If B later connects and does not announce F, B has removed F, or has stopped sharing F with A. A paused folder does not look like this, because paused folders are still announced with a stop reason.

    A could then remove B from F as well, maybe as an opt-in setting per device, next to auto-accept. B's removal then sticks without any ignore entry, and A sees that B left. If A shares F with B again later, that is a new decision, and B gets F again.

    This needs no protocol change, and a device can only cause its own removal. One edge case caught by AI: a receive-encrypted folder without a password token is not announced yet, so it must not count as leaving.

    This is probably a separate feature from this bug. I can open a feature request or a forum thread for it if you prefer.

  5. added a commit that references this issue on Oct 23, 2026
    a4a2da4
  6. calmh commented on Oct 23, 2026

    @calmh
    Member

    I agree ignore should win over auto accept, thanks for the fix.

    As for the rest... auto-accept is for unattended operation, but you've somehow turned that on its head and made the receiving side the one you can change instead of the other side that shares the folder? I don't think that's a use case that warrants the complexity here.

  7. axos88 commented on Oct 23, 2026

    @axos88
    ContributorAuthor

    Thanks for merging the fix!

    I think I explained the other part badly, partly because I swapped A and B between the issue and my comment. So once more, with fixed roles: A shares folders. B has auto-accept on for A. That's the ordinary unattended setup: A decides what to share, and B takes whatever it gets without anyone clicking. I'm not trying to change that - A stays the side that decides what it shares.

    The gap is that B has no way to leave one of those folders. If B removes F, A offers it again and B accepts it again. Since the fix, an ignore entry stops that, but it doesn't end the share. It's a "never accept F from A" filter hidden in B's config, and it's fragile. The list can be emptied or pruned, and the entry is stored under A's device entry, so removing and re-adding A drops it too. When the entry goes, F comes back, even though B never wanted it again. Meanwhile A still lists B on F, and if B does change its mind, B first has to find and remove the ignore entry. Turning auto-accept off isn't an answer either, because then B loses every future folder from A.

    It's like filtering a mailing list to the spam folder instead of unsubscribing: the sender still thinks you're on the list, and if the filter goes, the mail comes back.

    So the proposal is about letting B leave its share of F with A. A already holds B's index ID for F. If B connects and no longer announces F (and F isn't paused, or receive-encrypted waiting for a token), B has left, and A reciprocally drops B from F. This could be opt-in per device, next to auto-accept. B can only cause its own removal, never change anything else that A shares. There's no protocol change, and nobody has to step in on either side. If A shares F with B again later, that's a new decision, and B gets F again.

    Does that make more sense?

  8. added a commit that references this issue on Oct 28, 2026
    c2ffc33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triage

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions