Recent changes and the database

This is in no way a bug nor is it anything close to a big deal. It is something small that want to briefly touch on to continue to understand Syncthing and how it operates behind the scenes. When creating a new file called absolutely-new-file.txt the recent changes shows “device-name added absolutely-new-file.txt.”

Delete absolutely-new-file.txt and if a new file is created with the same name (absolutely-new-file.txt) recent changes shows “device-name modified absolutely-new-file.txt.”

This indicates the *.ldb files making up the database keep file entries at least for some period of time. Does the database ever delete/ overwrite/ perform maintenance that results in old entries eventually being removed so that the database doesn’t just continue to grow larger without first overwriting old entries?

Deleted files are known forever, in case some device from 2000 BC comes back online with the file before it was deleted and tries to share it back to everyone, but that’s the generic syncthing database.

This created deleted global changes log is only stored in memory, so if you restart and refresh the page, there should be no knowledge left.

Assume that the hash of every file modifications is also stored in the database forever which would cause it to continually grow larger. Shouldn’t be too much of an issue for space though as text of file hashes probably does not take much space.

If a folder is removed from Syncthing does the database make entries for the deleted folder available to be overwritten to keep the size of the database as small as possible over the long run?

Depends on the definition of folder. If a syncthing folder is removed via the UI, the database is cleaned up on next restart.

A deleted folder on the filesystem (within a syncthing folder) is still kept in syncthings database forever.

Deleted items do not store hashes of their content, as they have no content. They just store the fact that they were deleted at some past point.