Browse Source

lib/db: Reset index-id when dropping device (#7135)

Simon Frei 4 years ago
parent
commit
641b7aee38
1 changed files with 7 additions and 0 deletions
  1. 7 0
      lib/db/set.go

+ 7 - 0
lib/db/set.go

@@ -74,6 +74,13 @@ func (s *FileSet) Drop(device protocol.DeviceID) {
 		// announced from the remote is newer than our current sequence
 		// number.
 		s.meta.resetAll(device)
+		// Also reset the index ID, as we do want a full index retransfer
+		// if we ever reconnect, regardless of if the index ID changed.
+		if err := s.db.setIndexID(device[:], []byte(s.folder), 0); backend.IsClosed(err) {
+			return
+		} else if err != nil {
+			fatalError(err, opStr, s.db)
+		}
 	}
 
 	t, err := s.db.newReadWriteTransaction()