Syncthing deletes .stfolder

Hi, I use Syncthing to sync my PC with two phones.

One folder tree is synced completely between PC and phone 1, with phone 2 I sync only a subfolder of that tree. So on my PC there is one .stfolder in the root of that tree and one in the subfolder.

On the phone 1 the full tree and on the PC the subfolder are send-only.

When I sync the full tree with phone 1 the .stfolder in the subfolder on the PC is deleted. The result is the message that .stfolder is missing in that folder on my PC.

I think Syncthing should not touch any .stfolder during syncing or do I misunderstand something?

Syncthing doesn’t. It removes the marker when then folder is removed from Syncthing in the GUI (for cleanup purposes), but not otherwise.

Some android things are notorious for cleaning out empty folders though. Maybe you’re running into something like that.

Thank you for your answer.

.stfolder has gone when I synced the full folder tree the first time after I had added the subfolder as another folder pair.

As soon as I add again the .stfolder manually to the subfolder on my PC Syncthing shows a local change on that folder pair and on the phone Syncthing-Fork shows notification to overwrite these changes. As soon as I click on that the .stfolder is gone again.

That’s a problem of nesting folders, because android is send only (and override deletes new files. added by the the other side). You can ignore subfolder/.stfolder on either side to fix it.

1 Like

It’s also a bug in that case I think. Override should ignore internal files, as the scanner does. In fact I’m not sure how it can even know about the nested .stfolder… but definitely a bug if we remove it.

Edit: Ok, so .stfolder, .stignores etc are only special & protected at the folder root, so what will happen is indeed precisely as @AudriusButkevicius describes it. I think we should probably special case these anyhow everywhere…


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