Repository: syncthing/syncthing (language: go)

Issue:
Incorrect rescan interval on auto accepted encrypted folder
Version: main

Rescan interval always change to 1 day, but gui only change 1 minute and 1 hour values to 1 day.


Discussion / hints:

Fix patch:
diff --git a/lib/model/model.go b/lib/model/model.go
index 24b37ece83e..43a13784fc3 100644
--- a/lib/model/model.go
+++ b/lib/model/model.go
@@ -1682,7 +1682,12 @@ func (m *model) handleAutoAccepts(deviceID protocol.DeviceID, folder protocol.Fo
 				fcfg.Type = config.FolderTypeReceiveEncrypted
 				// Override the user-configured defaults, as normally done by the GUI
 				fcfg.FSWatcherEnabled = false
-				fcfg.RescanIntervalS = 3600 * 24
+				if fcfg.RescanIntervalS != 0 {
+					minRescanInterval := 3600 * 24
+					if fcfg.RescanIntervalS < minRescanInterval {
+						fcfg.RescanIntervalS = minRescanInterval
+					}
+				}
 				fcfg.Versioning.Reset()
 				// Other necessary settings are ensured by FolderConfiguration itself
 			} else {


Test patch: