This PR updates our client code to connect to preview whenever we're not on stable. This will make it more likely that we'll be able to collaborate on a dev build, but obviously won't work if there's a protocol change on main that hasn't made its way to preview yet.
Unified · Split
| @@ -1011,9 +1011,9 @@ impl Client { · 1010 unmodified lines | ||
| 1011 | 1011 | credentials: &Credentials, |
| 1012 | 1012 | cx: &AsyncAppContext, |
| 1013 | 1013 | ) -> Task<Result<Connection, EstablishConnectionError>> { |
| 1014 | − let is_preview = cx.read(|cx| { | |
| 1014 | + let use_preview_server = cx.read(|cx| { | |
| 1015 | 1015 | if cx.has_global::<ReleaseChannel>() { |
| 1016 | − *cx.global::<ReleaseChannel>() == ReleaseChannel::Preview | |
| 1016 | + *cx.global::<ReleaseChannel>() != ReleaseChannel::Stable | |
| 1017 | 1017 | } else { |
| 1018 | 1018 | false |
| 1019 | 1019 | } |
| @@ -1028,7 +1028,7 @@ impl Client { · 8 unmodified lines | ||
| 1028 | 1028 | |
| 1029 | 1029 | let http = self.http.clone(); |
| 1030 | 1030 | cx.background().spawn(async move { |
| 1031 | − let mut rpc_url = Self::get_rpc_url(http, is_preview).await?; | |
| 1031 | + let mut rpc_url = Self::get_rpc_url(http, use_preview_server).await?; | |
| 1032 | 1032 | let rpc_host = rpc_url |
| 1033 | 1033 | .host_str() |
| 1034 | 1034 | .zip(rpc_url.port_or_known_default()) |