From 14a11c9c139087be6032ec5a03ef407cbf7c54ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 1 Dec 2026 03:46:50 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20wire=20ALPN=20yumush/3=20?= =?UTF-8?q?=E2=86=92=20yumush/4=20since=20Hello=20gained=20build/install;?= =?UTF-8?q?=20stale=20clients=20were=20rejected=20with=20a=20bitcode=20dec?= =?UTF-8?q?ode=20error=20and=20retried=20every=20~8s.=20Outdated/banned=20?= =?UTF-8?q?links=20now=20show=20the=20error=20alone,=20without=20the=20Rec?= =?UTF-8?q?onnecting=20spinner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui.rs | 18 +++++++++++++----- crates/client/src/net/fail.rs | 2 +- crates/common/src/transport.rs | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/crates/client/src/gui.rs b/crates/client/src/gui.rs index 837277e..5f60c0f 100644 --- a/crates/client/src/gui.rs +++ b/crates/client/src/gui.rs @@ -26,7 +26,9 @@ use gpui_kit::{ notification::Notification, spinner::Spinner, }, - div, img, px, rems, + div, img, + prelude::FluentBuilder as _, + px, rems, }; use jiff::{Timestamp, tz::TimeZone}; use tokio::sync::mpsc; @@ -545,6 +547,7 @@ enum Connection { Connecting, Connected, Lost { error: String, attempts: u32 }, + Failed(String), } impl Connection { @@ -553,6 +556,10 @@ impl Connection { } fn lost(&mut self, error: &LinkError) { + if error.terminal() { + *self = Self::Failed(error.to_string()); + return; + } let attempts = match self { Self::Lost { attempts, .. } => *attempts + 1, _ => 1, @@ -565,12 +572,13 @@ impl Connection { } fn connection_notice(connection: &Connection, palette: Palette) -> Option
{ - let (label, color) = match connection { - Connection::Connecting => (w().gui.connecting.to_string(), palette.muted), + let (label, color, busy) = match connection { + Connection::Connecting => (w().gui.connecting.to_string(), palette.muted, true), Connection::Connected => return None, Connection::Lost { error, attempts } => { - (w().gui.reconnecting(attempts, error), palette.alert) + (w().gui.reconnecting(attempts, error), palette.alert, true) } + Connection::Failed(error) => (error.clone(), palette.alert, false), }; Some( div() @@ -581,7 +589,7 @@ fn connection_notice(connection: &Connection, palette: Palette) -> Option
{ .gap(px(space::SM)) .text_size(text(style::text::CAPTION)) .text_color(color) - .child(Spinner::new().xsmall().color(color)) + .when(busy, |row| row.child(Spinner::new().xsmall().color(color))) .child(label), ) } diff --git a/crates/client/src/net/fail.rs b/crates/client/src/net/fail.rs index 4d3cdc6..45f72f0 100644 --- a/crates/client/src/net/fail.rs +++ b/crates/client/src/net/fail.rs @@ -27,7 +27,7 @@ impl std::fmt::Display for LinkError { } impl LinkError { - pub(super) fn terminal(self) -> bool { + pub fn terminal(self) -> bool { matches!(self, Self::Outdated | Self::Closed(Close::Banned)) } diff --git a/crates/common/src/transport.rs b/crates/common/src/transport.rs index 36b851c..d398cb1 100644 --- a/crates/common/src/transport.rs +++ b/crates/common/src/transport.rs @@ -13,7 +13,7 @@ use quinn::{ use quinn_proto::RttEstimator; use socket2::{Domain, Protocol, Socket, Type}; -pub const ALPN: &[u8] = b"yumush/3"; +pub const ALPN: &[u8] = b"yumush/4"; const IDLE_TIMEOUT: Duration = Duration::from_secs(10); pub const KEEP_ALIVE: Duration = Duration::from_secs(1);