ソースを参照

Add more detail to tombstone comment

Rod Hynes 6 年 前
コミット
f6ae6e0af1
1 ファイル変更8 行追加2 行削除
  1. 8 2
      psiphon/dataStore.go

+ 8 - 2
psiphon/dataStore.go

@@ -207,8 +207,14 @@ func StoreServerEntry(serverEntryFields protocol.ServerEntryFields, replaceIfExi
 
 
 		serverEntryTagBytes := []byte(serverEntryTag)
 		serverEntryTagBytes := []byte(serverEntryTag)
 
 
-		// Ignore the server entry if it was previously pruned and a tombstone
-		// is set.
+		// Ignore the server entry if it was previously pruned and a tombstone is
+		// set.
+		//
+		// This logic is enforced only for embedded server entries, as all other
+		// sources are considered to be definitive and non-stale. These exceptions
+		// intentionally allow the scenario where a server is temporarily deleted
+		// and then restored; in this case, it's desired for pruned server entries
+		// to be restored.
 		if serverEntryFields.GetLocalSource() == protocol.SERVER_ENTRY_SOURCE_EMBEDDED {
 		if serverEntryFields.GetLocalSource() == protocol.SERVER_ENTRY_SOURCE_EMBEDDED {
 			if serverEntryTombstoneTags.get(serverEntryTagBytes) != nil {
 			if serverEntryTombstoneTags.get(serverEntryTagBytes) != nil {
 				return nil
 				return nil