Repository navigation
Description
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:
- On B, create folder F and share it with A. A auto-accepts F.
- On A, remove F.
- 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)
- On A, pause B and resume it, so that B sends a new cluster config.
- 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
fix(model): skip ignored folders when auto-accepting (fixes syncthing…
axos88 commentedon Oct 22, 2026
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:
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.
fix(model): skip ignored folders when auto-accepting (fixes syncthing…
calmh commentedon Oct 23, 2026
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.
axos88 commentedon Oct 23, 2026
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?
Merge branch 'main' into trashcansize