浏览代码

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

Simon Frei 4 年之前
父节点
当前提交
641b7aee38
共有 1 个文件被更改,包括 7 次插入0 次删除
  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()