Jelajahi Sumber

Remove ReportAvailableRegions calls after storing server entries

- Relates to a6df78f. These unconditional ReportAvailableRegions
  calls could occur early, when importing embedded server lists,
  and report pre-tactics-filtered region lists.

- Instead of making these ReportAvailableRegions calls conditional
  on applying updates, the calls are removed entirely as the
  ReportAvailableRegions in Controller.launchEstablishing is
  probably sufficient, in most cases, for populating region lists
  with new regions obtained from remote server lists, etc.
Rod Hynes 7 tahun lalu
induk
melakukan
0b157c1147
2 mengubah file dengan 2 tambahan dan 11 penghapusan
  1. 2 3
      psiphon/controller.go
  2. 0 8
      psiphon/dataStore.go

+ 2 - 3
psiphon/controller.go

@@ -1216,9 +1216,8 @@ func (controller *Controller) launchEstablishing() {
 
 	// Unconditionally report available egress regions. After a fresh install,
 	// the outer client may not have a list of regions to display, so we
-	// always report here. Events that trigger ReportAvailableRegions,
-	// including storing new server entries and applying tactics, are not
-	// guaranteed to occur.
+	// always report here. Other events that trigger ReportAvailableRegions,
+	// are not guaranteed to occur.
 	//
 	// This report is delayed until after tactics are likely to be applied, as
 	// tactics can impact the list of available regions; this avoids a

+ 0 - 8
psiphon/dataStore.go

@@ -299,10 +299,6 @@ func StoreServerEntries(
 		}
 	}
 
-	// Since there has possibly been a significant change in the server entries,
-	// take this opportunity to update the available egress regions.
-	ReportAvailableRegions(config)
-
 	return nil
 }
 
@@ -337,10 +333,6 @@ func StreamingStoreServerEntries(
 		}
 	}
 
-	// Since there has possibly been a significant change in the server entries,
-	// take this opportunity to update the available egress regions.
-	ReportAvailableRegions(config)
-
 	return nil
 }