Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions plugins/listener/src/actors/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ impl Actor for ListenerActor {

ListenerMsg::StreamError(error) => {
tracing::info!("listen_stream_error: {}", error);
let _ = (SessionErrorEvent::ConnectionError {
session_id: state.args.session_id.clone(),
error: format!("listen_stream_error: {}", error),
is_retryable: false,
})
.emit(&state.args.app);
myself.stop(None);
}

Expand All @@ -181,6 +187,12 @@ impl Actor for ListenerActor {

ListenerMsg::StreamTimeout(elapsed) => {
tracing::info!("listen_stream_timeout: {}", elapsed);
let _ = (SessionErrorEvent::ConnectionError {
session_id: state.args.session_id.clone(),
error: format!("listen_stream_timeout: {}", elapsed),
is_retryable: false,
})
.emit(&state.args.app);
myself.stop(None);
}
}
Expand Down Expand Up @@ -353,11 +365,11 @@ async fn spawn_rx_task_single_with_adapter<A: RealtimeSttAdapter>(
tracing::error!(error = ?e, "listen_ws_connect_failed(single)");
let _ = (SessionErrorEvent::ConnectionError {
session_id: args.session_id.clone(),
error: format!("listen_ws_connect_failed: {:?}", e),
error: format!("listen_ws_connect_failed: {}", e),
is_retryable: true,
})
.emit(&args.app);
return Err(actor_error(format!("listen_ws_connect_failed: {:?}", e)));
return Err(actor_error(format!("listen_ws_connect_failed: {}", e)));
}
Ok(Ok(res)) => res,
};
Expand Down Expand Up @@ -425,11 +437,11 @@ async fn spawn_rx_task_dual_with_adapter<A: RealtimeSttAdapter>(
tracing::error!(error = ?e, "listen_ws_connect_failed(dual)");
let _ = (SessionErrorEvent::ConnectionError {
session_id: args.session_id.clone(),
error: format!("listen_ws_connect_failed: {:?}", e),
error: format!("listen_ws_connect_failed: {}", e),
is_retryable: true,
})
.emit(&args.app);
return Err(actor_error(format!("listen_ws_connect_failed: {:?}", e)));
return Err(actor_error(format!("listen_ws_connect_failed: {}", e)));
}
Ok(Ok(res)) => res,
};
Expand Down
4 changes: 2 additions & 2 deletions plugins/listener/src/actors/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ pub struct SourceArgs {
}

pub struct SourceState {
app: tauri::AppHandle,
session_id: String,
app: tauri::AppHandle,
mic_device: Option<String>,
onboarding: bool,
mic_muted: Arc<AtomicBool>,
Expand Down Expand Up @@ -143,8 +143,8 @@ impl Actor for SourceActor {
let pipeline = Pipeline::new(args.app.clone(), args.session_id.clone());

let mut st = SourceState {
app: args.app,
session_id: args.session_id,
app: args.app,
mic_device,
onboarding: args.onboarding,
mic_muted: Arc::new(AtomicBool::new(false)),
Expand Down
Loading