web: log all state changes and don't autoreload on error, causes infini-loop

This commit is contained in:
Bill Thiede 2025-03-12 13:50:06 -07:00
parent fc84562419
commit 8a0e4eb441

View File

@ -118,7 +118,7 @@ fn on_url_changed(old: &Url, mut new: Url) -> Msg {
// `update` describes how to handle each `Msg`. // `update` describes how to handle each `Msg`.
pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) { pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
debug!("update({})", msg); info!("update({})", msg);
match msg { match msg {
Msg::Noop => {} Msg::Noop => {}
Msg::RefreshStart => { Msg::RefreshStart => {
@ -293,7 +293,6 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
}); });
} }
Msg::FrontPageResult(Err(e)) => { Msg::FrontPageResult(Err(e)) => {
orders.send_msg(Msg::Reload);
error!("error FrontPageResult: {e:?}"); error!("error FrontPageResult: {e:?}");
} }
Msg::FrontPageResult(Ok(graphql_client::Response { Msg::FrontPageResult(Ok(graphql_client::Response {
@ -301,7 +300,6 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
errors: None, errors: None,
.. ..
})) => { })) => {
orders.send_msg(Msg::Reload);
error!("FrontPageResult no data or errors, should not happen"); error!("FrontPageResult no data or errors, should not happen");
} }
Msg::FrontPageResult(Ok(graphql_client::Response { Msg::FrontPageResult(Ok(graphql_client::Response {
@ -309,7 +307,6 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
errors: Some(e), errors: Some(e),
.. ..
})) => { })) => {
orders.send_msg(Msg::Reload);
error!("FrontPageResult error: {e:?}"); error!("FrontPageResult error: {e:?}");
} }
Msg::FrontPageResult(Ok(graphql_client::Response { Msg::FrontPageResult(Ok(graphql_client::Response {
@ -405,7 +402,6 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
orders.send_msg(Msg::WindowScrolled); orders.send_msg(Msg::WindowScrolled);
} }
Msg::ShowThreadResult(bad) => { Msg::ShowThreadResult(bad) => {
orders.send_msg(Msg::Reload);
error!("show_thread_query error: {bad:#?}"); error!("show_thread_query error: {bad:#?}");
} }
Msg::CatchupRequest { query } => { Msg::CatchupRequest { query } => {
@ -438,7 +434,6 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
} }
} }
Msg::CatchupResult(bad) => { Msg::CatchupResult(bad) => {
orders.send_msg(Msg::Reload);
error!("catchup_query error: {bad:#?}"); error!("catchup_query error: {bad:#?}");
} }
Msg::SelectionSetNone => { Msg::SelectionSetNone => {