remove dist, clear error on reconnect

This commit is contained in:
emilis 2025-10-30 23:24:40 +00:00
parent 486b670556
commit 0bac7ae0b4
No known key found for this signature in database
8 changed files with 7 additions and 80 deletions

2
.gitignore vendored
View File

@ -1,6 +1,6 @@
target target
target-* target-*
calendar/dist plan/dist
.vscode .vscode
build-and-send.fish build-and-send.fish
.sqlx .sqlx

68
Cargo.lock generated
View File

@ -50,17 +50,6 @@ dependencies = [
"password-hash", "password-hash",
] ]
[[package]]
name = "async-trait"
version = "0.1.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.107",
]
[[package]] [[package]]
name = "atoi" name = "atoi"
version = "2.0.0" version = "2.0.0"
@ -97,7 +86,7 @@ version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a18ed336352031311f4e0b4dd2ff392d4fbb370777c9d18d7fc9d7359f73871" checksum = "8a18ed336352031311f4e0b4dd2ff392d4fbb370777c9d18d7fc9d7359f73871"
dependencies = [ dependencies = [
"axum-core 0.5.5", "axum-core",
"axum-macros", "axum-macros",
"base64", "base64",
"bytes", "bytes",
@ -128,26 +117,6 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "axum-core"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199"
dependencies = [
"async-trait",
"bytes",
"futures-util",
"http 1.3.1",
"http-body",
"http-body-util",
"mime",
"pin-project-lite",
"rustversion",
"sync_wrapper",
"tower-layer",
"tower-service",
]
[[package]] [[package]]
name = "axum-core" name = "axum-core"
version = "0.5.5" version = "0.5.5"
@ -174,7 +143,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9963ff19f40c6102c76756ef0a46004c0d58957d87259fc9208ff8441c12ab96" checksum = "9963ff19f40c6102c76756ef0a46004c0d58957d87259fc9208ff8441c12ab96"
dependencies = [ dependencies = [
"axum", "axum",
"axum-core 0.5.5", "axum-core",
"bytes", "bytes",
"futures-util", "futures-util",
"headers", "headers",
@ -190,18 +159,6 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "axum-limit"
version = "0.1.0-alpha.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3faa0b4a7a9fe9c072b3acde27ea8884cdc7a61982b5db9f402679631c2549ab"
dependencies = [
"async-trait",
"axum-core 0.4.5",
"dashmap",
"http 1.3.1",
]
[[package]] [[package]]
name = "axum-macros" name = "axum-macros"
version = "0.5.0" version = "0.5.0"
@ -473,20 +430,6 @@ dependencies = [
"typenum", "typenum",
] ]
[[package]]
name = "dashmap"
version = "6.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf"
dependencies = [
"cfg-if",
"crossbeam-utils",
"hashbrown 0.14.5",
"lock_api",
"once_cell",
"parking_lot_core",
]
[[package]] [[package]]
name = "data-encoding" name = "data-encoding"
version = "2.9.0" version = "2.9.0"
@ -1185,12 +1128,6 @@ dependencies = [
"byteorder", "byteorder",
] ]
[[package]]
name = "hashbrown"
version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.15.5" version = "0.15.5"
@ -1959,7 +1896,6 @@ dependencies = [
"argon2", "argon2",
"axum", "axum",
"axum-extra", "axum-extra",
"axum-limit",
"chrono", "chrono",
"ciborium", "ciborium",
"colored", "colored",

View File

@ -41,4 +41,3 @@ tower = { version = "0.5.2", features = [
"buffer", "buffer",
"timeout", "timeout",
] } ] }
axum-limit = "0.1.0-alpha.2"

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
<!doctype html><meta charset=utf-8><meta content="width=device-width,initial-scale=1" name=viewport><title>plan</title><link href=/index-1cee5a016147b48c.css integrity=sha384-aITEjaJfyZ4JpPUEhD6yGS9hmzF9c5Tr4+r+QK5nguomArm3mEnD+xFoAt5pmjmb rel=stylesheet><link crossorigin href=/plan-9b4f658762b65072.js integrity=sha384-h1jfwrVuYoeRA3OCiyYxIc8jqBQ5qcEMNiINHfjap2dkWqu9kB26DEyFM5r40lXI rel=modulepreload><link as=fetch crossorigin href=/plan-9b4f658762b65072_bg.wasm integrity=sha384-3uwozNtXv3EZpHAdBo8zai0D3hFBMVpnHyhnSA+NTHqeAV/Pm9WMRvGVaWiKHW0w rel=preload type=application/wasm></head><body><app> <script type=module>import init, * as bindings from '/plan-9b4f658762b65072.js';
const wasm = await init({ module_or_path: '/plan-9b4f658762b65072_bg.wasm' });
window.wasmBindings = bindings;
dispatchEvent(new CustomEvent("TrunkApplicationStarted", {detail: {wasm}}));</script><script>`use strict`;(()=>{let g=`div`,h=`0`;const a=`{{__TRUNK_ADDRESS__}}`;const b=`{{__TRUNK_WS_BASE__}}`;let c=``;c=c?c:window.location.protocol===`https:`?`wss`:`ws`;const d=c+ `://`+ a+ b+ `.well-known/trunk/ws`;class e{constructor(){this._overlay=document.createElement(g);const a=this._overlay.style;a.height=`100vh`;a.width=`100vw`;a.position=`fixed`;a.top=h;a.left=h;a.backgroundColor=`rgba(222, 222, 222, 0.5)`;a.fontFamily=`sans-serif`;a.zIndex=`1000000`;a.backdropFilter=`blur(1rem)`;const b=document.createElement(g);b.style.position=`absolute`;b.style.top=`30%`;b.style.left=`15%`;b.style.maxWidth=`85%`;this._title=document.createElement(g);this._title.innerText=`Build failure`;this._title.style.paddingBottom=`2rem`;this._title.style.fontSize=`2.5rem`;this._message=document.createElement(g);this._message.style.whiteSpace=`pre-wrap`;const c=document.createElement(g);c.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" fill="#dc3545" viewBox="0 0 16 16"><path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/></svg>`;this._title.prepend(c);b.append(this._title,this._message);this._overlay.append(b);this._inject();window.setInterval(()=>{this._inject()},250)}reason(a){this._message.textContent=a}_inject(){if(!this._overlay.isConnected){document.body?.prepend(this._overlay)}}}class f{constructor(a){this.url=a;this.poll_interval=5000;this._overlay=null}start(){const a=new WebSocket(this.url);a.onmessage=a=>{const b=JSON.parse(a.data);switch(b.type){case `reload`:this.reload();break;case `buildFailure`:this.buildFailure(b.data);break}};a.onclose=()=>this.onclose()}onclose(){window.setTimeout(()=>{const a=new WebSocket(this.url);a.onopen=()=>window.location.reload();a.onclose=()=>this.onclose()},this.poll_interval)}reload(){window.location.reload()}buildFailure({reason:a}){console.error(`Build failed:`,a);console.debug(`Overlay`,this._overlay);if(!this._overlay){this._overlay=new e()};this._overlay.reason=a}}new f(d).start()})()</script>

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -83,7 +83,9 @@ impl Session {
.started .started
.swap(true, core::sync::atomic::Ordering::SeqCst) .swap(true, core::sync::atomic::Ordering::SeqCst)
{ {
panic!("start ran more than once"); // panic!("start ran more than once");
log::info!("start");
return Ok(());
} }
log::debug!("starting connection runner"); log::debug!("starting connection runner");
let active = self let active = self
@ -211,7 +213,7 @@ impl Session {
log::info!("connecting to {url}"); log::info!("connecting to {url}");
let mut ws = match Self::connect(&url).await { let mut ws = match Self::connect(&url).await {
Ok(ws) => { Ok(ws) => {
// self.err_setter.set(None); self.err_setter.set(None);
ws.fuse() ws.fuse()
} }
Err(err) => { Err(err) => {