From e4956358fbab0d78e975d474acba2a0d098e4adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Colomb?= Date: Sun, 12 May 2019 21:17:55 +0200 Subject: [PATCH] lib/model: Remove superfluous check for IndexID in remote ClusterConfig (#5717) The check in ClusterConfig() when iterating through announced devices in a folder explicitly skips entries without a non-zero IndexID. Therefore, the check for IndexID == 0 just below will never be true and the intended cleanup of local index data will not happen. Plainly remove that check to make the intended case distinction work. --- lib/model/model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/model/model.go b/lib/model/model.go index cea32259..d9b16e61 100644 --- a/lib/model/model.go +++ b/lib/model/model.go @@ -1118,7 +1118,7 @@ func (m *model) ClusterConfig(deviceID protocol.DeviceID, cm protocol.ClusterCon l.Infof("Device %v folder %s has mismatching index ID for us (%v != %v)", deviceID, folder.Description(), dev.IndexID, myIndexID) startSequence = 0 } - } else if dev.ID == deviceID && dev.IndexID != 0 { + } else if dev.ID == deviceID { // This is the other side's description of themselves. We // check to see that it matches the IndexID we have on file, // otherwise we drop our old index data and expect to get a