History

Use preview server when not on stable (#2909)

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.

Nathan Sobo committed 3 years ago

Commit a2e91e42 parents 246b699 2d411301 file · +3 −3Browse files

Unified · Split

crates/client/src/client.rs+3−3
@@ -1011,9 +1011,9 @@ impl Client { · 1010 unmodified lines
1011 credentials: &Credentials,1011 credentials: &Credentials,
1012 cx: &AsyncAppContext,1012 cx: &AsyncAppContext,
1013 ) -> Task<Result<Connection, EstablishConnectionError>> {1013 ) -> Task<Result<Connection, EstablishConnectionError>> {
1014 let is_preview = cx.read(|cx| {1014 let use_preview_server = cx.read(|cx| {
1015 if cx.has_global::<ReleaseChannel>() {1015 if cx.has_global::<ReleaseChannel>() {
1016 *cx.global::<ReleaseChannel>() == ReleaseChannel::Preview1016 *cx.global::<ReleaseChannel>() != ReleaseChannel::Stable
1017 } else {1017 } else {
1018 false1018 false
1019 }1019 }
@@ -1028,7 +1028,7 @@ impl Client { · 8 unmodified lines
1028 1028
1029 let http = self.http.clone();1029 let http = self.http.clone();
1030 cx.background().spawn(async move {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 let rpc_host = rpc_url1032 let rpc_host = rpc_url
1033 .host_str()1033 .host_str()
1034 .zip(rpc_url.port_or_known_default())1034 .zip(rpc_url.port_or_known_default())

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t