When does database cleanup occur?

Noticed that when delete a folder and then re-add a folder with the same ID that the database still “remembers” the folder.

After deleting a folder will the database eventually overwrite the data for a removed folder, or does this already happen on restart?

That’s not supposed to be the case. It’s supposed to be cleaned out directly. It also happens on restart (because things might have been removed from the config while we were down).

I wonder how you would recoginze that “remembering”.

Could you please elaborate?

A folder was having issues not picking up all files due to ignores, even after all ignore parameters removed. Unshared the folder from all other devices. Re-added folder with same ID a few hours later. The same issues with not picking up all files existed. Re-adding with a different folder ID immediately resolved. Auto-accept, introducer both off so everything needed manual action to pull from cluster.

Backup config, delete folder, restart, stop, recover config, restart. Didnt work for me. The folder hashes and data were still there.

I’ll repeat SiSa’s question above: how do you know? I tested now, with tracing enabled on the scanner and db to be sure of what’s happening, and both “live” remove/add and stop/edit-config/start/add did the expected thing for me and cleaned out the folder data. This manifests as having to do a full rescan when adding, and that’s what happens when I do it.

Will eventually take time to do screenshots or video while keeping the command line open.

For right now it is no big deal if not everyone can replicate. Anyone who uses Syncthing regularly knows it has small (emphasis on small) kinks here or there, and otherwise is an amazing tool.