@@ -122,8 +122,11 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
122122
123123// Every time we get a new proxiesResponse, update the latency check
124124// to each workspace proxy.
125- const { proxyLatencies, refetch :refetchProxyLatencies , loaded :latenciesLoaded } =
126- useProxyLatency ( proxiesResp ) ;
125+ const {
126+ proxyLatencies,
127+ refetch :refetchProxyLatencies ,
128+ loaded :latenciesLoaded ,
129+ } = useProxyLatency ( proxiesResp ) ;
127130
128131// updateProxy is a helper function that when called will
129132// update the proxy being used.
@@ -153,13 +156,14 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
153156// This useEffect will auto select the best proxy if the user has not selected one.
154157// It must wait until all latencies are loaded to select based on latency. This does mean
155158// the first time a user loads the page, the proxy will "flicker" to the best proxy.
156- //
159+ //
157160// Once the page is loaded, or the user selects a proxy, this will not run again.
161+ // biome-ignore lint/correctness/useExhaustiveDependencies: Only update if the source data changes
158162useEffect ( ( ) => {
159- if ( loadUserSelectedProxy ( ) !== undefined ) {
163+ if ( loadUserSelectedProxy ( ) !== undefined ) {
160164return ; // User has selected a proxy, do not auto select.
161165}
162- if ( ! latenciesLoaded ) {
166+ if ( ! latenciesLoaded ) {
163167// Wait until the latencies are loaded before
164168return ;
165169}
@@ -171,12 +175,11 @@ export const ProxyProvider: FC<PropsWithChildren> = ({ children }) => {
171175true ,
172176) ;
173177
174- if ( best ?. proxy ) {
178+ if ( best ?. proxy ) {
175179saveUserSelectedProxy ( best . proxy ) ;
176180updateProxy ( ) ;
177181}
178-
179- } , [ latenciesLoaded ] )
182+ } , [ latenciesLoaded , proxiesResp , proxyLatencies ] ) ;
180183
181184return (
182185< ProxyContext . Provider
@@ -250,7 +253,7 @@ export const getPreferredProxy = (
250253}
251254
252255// Use the primary proxy if we don't have any other options.
253- if ( ! selectedProxy ) {
256+ if ( ! selectedProxy ) {
254257selectedProxy = proxies . find ( ( proxy ) => proxy . name === "primary" ) ;
255258}
256259}