Reconnect the edits websocket if it disconnects (#4391)

* Reconnect the edits websocket if it disconnects

* restart the server if the OS kills it

* fix clippy

* clean up code and add more comments

* cleanups

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
Evan AlmloffandJonathan Kelley authored and GitHub committed 2025-07-14 13:39:21 -07:00
1 parent c5b33924ae
commit 3f62cd8fc0
9 files changed
+368 -188

No files matched your search

+2 -2
View File
@@ -63,7 +63,7 @@ fn test_mounted() -> Element {
height: "100px",
onmounted: move |evt| async move {
let rect = evt.get_client_rect().await.unwrap();
println!("rect: {:?}", rect);
println!("rect: {rect:?}");
assert_eq!(rect.width(), 100.0);
assert_eq!(rect.height(), 100.0);
RECEIVED_EVENTS.with_mut(|x| *x += 1);
@@ -481,7 +481,7 @@ fn test_form_input() -> Element {
values.set(ev.values());
},
onsubmit: move |ev| {
println!("{:?}", ev);
println!("{ev:?}");
},
input {
r#type: "text",
+4 -5
View File
@@ -17,15 +17,14 @@ fn use_inner_html(id: &'static str) -> Option<String> {
tokio::time::sleep(std::time::Duration::from_millis(500)).await;
let res = document::eval(&format!(
r#"let element = document.getElementById('{}');
return element.innerHTML"#,
id
r#"let element = document.getElementById('{id}');
return element.innerHTML"#
))
.await
.unwrap();
if let Some(html) = res.as_str() {
println!("html: {}", html);
println!("html: {html}");
value.set(Some(html.to_string()));
}
});
@@ -42,7 +41,7 @@ fn check_html_renders() -> Element {
let desktop_context: DesktopContext = consume_context();
if let Some(raw_html) = inner_html {
println!("{}", raw_html);
println!("{raw_html}");
let fragment = &raw_html;
let expected = EXPECTED_HTML;
assert_eq!(raw_html, EXPECTED_HTML);