Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- daemon: Build the list of devices offered to the user from libwebauthn's `available_transports()`, the same source discovery uses (#32)
- ui: Pass the caller's activation token to the compositor when showing the dialog, so it can take focus when the requesting window is in the background (#152)
- ui: Disable core dumps for the UI process, which handles typed PINs. Build with `-Denable_core_dumps=true` to allow them for debugging (#209)
- ui: Don't crash when a request ends while the UI is still sending it events, e.g. because the caller disconnected right after starting it

# 0.4.0 [2026-11-05]

Expand Down
16 changes: 12 additions & 4 deletions credentialsd-ui/src/gui/view_model/gtk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use gtk::glib::{self, Bytes};
use gtk::prelude::*;
use gtk::subclass::prelude::*;
use qrcode::QrCode;
use tracing::debug;
use tracing::{debug, warn};

use crate::config::{GETTEXT_PACKAGE, LOCALEDIR, RESOURCES_FILE};
use application::CredentialsUi;
Expand Down Expand Up @@ -118,7 +118,9 @@ impl ViewModel {
{
let tx = view_model.imp().tx.borrow();
let tx = tx.as_ref().expect("tx to exist");
tx.send_blocking(ViewEvent::Initiated).unwrap();
if tx.send_blocking(ViewEvent::Initiated).is_err() {
warn!("Request ended before the UI started");
}
}

view_model
Expand Down Expand Up @@ -325,7 +327,9 @@ impl ViewModel {
let id = button.widget_name().to_string();
let tx = tx.clone();
glib::spawn_future_local(async move {
tx.send(ViewEvent::CredentialSelected(id)).await.unwrap();
if tx.send(ViewEvent::CredentialSelected(id)).await.is_err() {
warn!("Request ended before the credential selection was handled");
}
});
});
button.into()
Expand Down Expand Up @@ -387,7 +391,11 @@ impl ViewModel {

async fn send_event(&self, event: ViewEvent) {
let tx = self.get_sender();
tx.send(event).await.unwrap();
if tx.send(event).await.is_err() {
// The request's event loop has ended, e.g. because the caller
// went away; the UI closes with it.
warn!("Request ended before the UI event was handled");
}
}
}

Expand Down