Compare commits

..

10 Commits

Author SHA1 Message Date
251151244b chore: Release
Some checks failed
Continuous integration / Check (push) Successful in 1m29s
Continuous integration / Test Suite (push) Successful in 41s
Continuous integration / Rustfmt (push) Successful in 30s
Continuous integration / Trunk (push) Failing after 1m9s
Continuous integration / build (push) Successful in 47s
Continuous integration / Disallow unused dependencies (push) Successful in 3m19s
2025-04-15 20:38:08 -07:00
9d232b666b server: add debug message for WS connection 2025-04-15 20:37:35 -07:00
1832d77e78 chore: Release
Some checks failed
Continuous integration / Check (push) Successful in 39s
Continuous integration / Test Suite (push) Successful in 41s
Continuous integration / Trunk (push) Failing after 35s
Continuous integration / build (push) Successful in 48s
Continuous integration / Rustfmt (push) Successful in 56s
Continuous integration / Disallow unused dependencies (push) Successful in 54s
2025-04-15 20:30:21 -07:00
aca6bce1ff web: connect to the correct ws endpoint in production 2025-04-15 20:30:02 -07:00
7bb2f405da chore: Release
Some checks failed
Continuous integration / Check (push) Successful in 36s
Continuous integration / Test Suite (push) Successful in 41s
Continuous integration / Trunk (push) Failing after 35s
Continuous integration / Rustfmt (push) Successful in 30s
Continuous integration / build (push) Successful in 48s
Continuous integration / Disallow unused dependencies (push) Successful in 3m8s
2025-04-15 19:33:55 -07:00
60e2824167 server: reenable per-account unread counts 2025-04-15 19:33:32 -07:00
cffc228b3a chore: Release
Some checks failed
Continuous integration / Check (push) Successful in 36s
Continuous integration / Test Suite (push) Successful in 41s
Continuous integration / Trunk (push) Failing after 35s
Continuous integration / Rustfmt (push) Successful in 32s
Continuous integration / build (push) Successful in 49s
Continuous integration / Disallow unused dependencies (push) Successful in 3m24s
2025-04-15 19:25:41 -07:00
318c366d82 server: disable per-email counts in tags, it's breaking production 2025-04-15 19:25:22 -07:00
90d7f79ca0 server: slow refresh interval as procmail should be on demand 2025-04-15 19:24:59 -07:00
3f87038776 web: proxy /notifcation 2025-04-15 18:39:36 -07:00
9 changed files with 26 additions and 19 deletions

10
Cargo.lock generated
View File

@@ -2995,7 +2995,7 @@ dependencies = [
[[package]]
name = "letterbox-notmuch"
version = "0.15.2"
version = "0.15.6"
dependencies = [
"itertools",
"log",
@@ -3010,14 +3010,14 @@ dependencies = [
[[package]]
name = "letterbox-procmail2notmuch"
version = "0.15.2"
version = "0.15.6"
dependencies = [
"anyhow",
]
[[package]]
name = "letterbox-server"
version = "0.15.2"
version = "0.15.6"
dependencies = [
"ammonia",
"anyhow",
@@ -3061,7 +3061,7 @@ dependencies = [
[[package]]
name = "letterbox-shared"
version = "0.15.2"
version = "0.15.6"
dependencies = [
"build-info",
"letterbox-notmuch",
@@ -3071,7 +3071,7 @@ dependencies = [
[[package]]
name = "letterbox-web"
version = "0.15.2"
version = "0.15.6"
dependencies = [
"build-info",
"build-info-build",

View File

@@ -8,7 +8,7 @@ authors = ["Bill Thiede <git@xinu.tv>"]
edition = "2021"
license = "UNLICENSED"
publish = ["xinu"]
version = "0.15.2"
version = "0.15.6"
repository = "https://git.z.xinu.tv/wathiede/letterbox"
[profile.dev]

View File

@@ -27,8 +27,8 @@ css-inline = "0.14.0"
futures = "0.3.31"
headers = "0.4.0"
html-escape = "0.2.13"
letterbox-notmuch = { version = "0.15.2", path = "../notmuch", registry = "xinu" }
letterbox-shared = { version = "0.15.2", path = "../shared", registry = "xinu" }
letterbox-notmuch = { version = "0.15.6", path = "../notmuch", registry = "xinu" }
letterbox-shared = { version = "0.15.6", path = "../shared", registry = "xinu" }
linkify = "0.10.0"
log = "0.4.17"
lol_html = "2.0.0"

View File

@@ -158,6 +158,7 @@ async fn start_ws(
connection_tracker, ..
}): State<AppState>,
) -> impl IntoResponse {
info!("intiating websocket connection for {addr}");
ws.on_upgrade(async move |socket| connection_tracker.lock().await.add_peer(socket, addr).await)
}
@@ -165,6 +166,7 @@ async fn start_ws(
struct NotificationParams {
delay_ms: Option<u64>,
}
async fn send_refresh_websocket_handler(
State(AppState {
connection_tracker, ..
@@ -249,7 +251,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
let connection_tracker = Arc::new(Mutex::new(ConnectionTracker::default()));
let ct = Arc::clone(&connection_tracker);
let poll_time = Duration::from_secs(10);
let poll_time = Duration::from_secs(60);
let _h = tokio::spawn(watch_new(nm.clone(), pool, ct, poll_time));
let api_routes = Router::new()

View File

@@ -12,6 +12,6 @@ version.workspace = true
[dependencies]
build-info = "0.0.40"
letterbox-notmuch = { version = "0.15.2", path = "../notmuch", registry = "xinu" }
letterbox-notmuch = { version = "0.15.6", path = "../notmuch", registry = "xinu" }
serde = { version = "1.0.147", features = ["derive"] }
strum_macros = "0.27.1"

View File

@@ -33,8 +33,8 @@ wasm-bindgen = "=0.2.100"
uuid = { version = "1.13.1", features = [
"js",
] } # direct dep to set js feature, prevents Rng issues
letterbox-shared = { version = "0.15.2", path = "../shared", registry = "xinu" }
letterbox-notmuch = { version = "0.15.2", path = "../notmuch", registry = "xinu" }
letterbox-shared = { version = "0.15.6", path = "../shared", registry = "xinu" }
letterbox-notmuch = { version = "0.15.6", path = "../notmuch", registry = "xinu" }
seed_hooks = { version = "0.4.0", registry = "xinu" }
strum_macros = "0.27.1"
gloo-console = "0.3.0"

View File

@@ -13,6 +13,9 @@ backend = "ws://localhost:9345/api/ws"
[[proxy]]
backend = "http://localhost:9345/api/"
[[proxy]]
backend = "http://localhost:9345/notification/"
[[hooks]]
stage = "pre_build"
command = "printf"

View File

@@ -62,7 +62,7 @@ pub fn init(url: Url, orders: &mut impl Orders<Msg>) -> Model {
},
catchup: None,
last_url: Url::current(),
websocket: websocket::init(&mut orders.proxy(Msg::WebSocket)),
websocket: websocket::init("/api/ws", &mut orders.proxy(Msg::WebSocket)),
}
}

View File

@@ -78,13 +78,14 @@ pub struct ClientMessage {
//const WS_URL: &str = "wss://9000.z.xinu.tv/api/ws";
//const WS_URL: &str = "wss://9345.z.xinu.tv/api/graphql/ws";
const WS_URL: &str = "wss://6758.z.xinu.tv/api/ws";
//const WS_URL: &str = "wss://6758.z.xinu.tv/api/ws";
// ------ ------
// Model
// ------ ------
pub struct Model {
ws_url: String,
web_socket: EventClient,
web_socket_reconnector: Option<StreamHandle>,
pub updates: VecDeque<WebsocketMessage>,
@@ -94,9 +95,10 @@ pub struct Model {
// Init
// ------ ------
pub fn init(orders: &mut impl Orders<Msg>) -> Model {
pub fn init(ws_url: &str, orders: &mut impl Orders<Msg>) -> Model {
Model {
web_socket: create_websocket(orders).unwrap(),
ws_url: ws_url.to_string(),
web_socket: create_websocket(ws_url, orders).unwrap(),
web_socket_reconnector: None,
updates: VecDeque::new(),
}
@@ -155,7 +157,7 @@ Reason: {2}
}
Msg::ReconnectWebSocket(retries) => {
info!("Reconnect attempt: {}", retries);
model.web_socket = create_websocket(orders).unwrap();
model.web_socket = create_websocket(&model.ws_url, orders).unwrap();
}
Msg::SendMessage(msg) => {
let txt = serde_json::to_string(&msg).unwrap();
@@ -164,10 +166,10 @@ Reason: {2}
}
}
fn create_websocket(orders: &impl Orders<Msg>) -> Result<EventClient, WebSocketError> {
fn create_websocket(url: &str, orders: &impl Orders<Msg>) -> Result<EventClient, WebSocketError> {
let msg_sender = orders.msg_sender();
let mut client = EventClient::new(WS_URL)?;
let mut client = EventClient::new(url)?;
client.set_on_error(Some(Box::new(|error| {
gloo_console::error!("WS: ", error);