Skip to content

ui: Don't abort when the request ended before a UI event was sent - #265

Open
kpanuragh wants to merge 2 commits into
linux-credentials:mainfrom
kpanuragh:ui-send-errors
Open

kpanuragh wants to merge 2 commits into
linux-credentials:mainfrom
kpanuragh:ui-send-errors

Conversation

@kpanuragh

Copy link
Copy Markdown
Contributor

Follow-up to the crash mentioned in #262.

If the caller disconnects right after CreateSession (e.g. a one-shot busctl call), the request's event loop ends before the GTK view model sends ViewEvent::Initiated, and credentialsd-ui aborts at gtk/mod.rs:121 with called Result::unwrap() on an Err value: SendError(..).

The three sends from the GTK view model to the event loop (Initiated, credential selection, and send_event) now log a warning instead of unwrapping. As discussed, the receiving loop has already ended, so there is nothing else to do; the UI closes with the request.

The tx_update unwraps in the other direction (event loop → GTK) are left for a separate change, since #261 touches that file heavily.

Testing

  • Ran credentialsd-ui and called CreateSession with busctl --user call, which disconnects immediately:
    • main: the UI aborts (SIGABRT) with the panic above.
    • this branch: the UI keeps running and logs the warning.
  • cargo build --locked, cargo fmt --check.

The GTK view model unwrapped every send to the request's event loop. If
the caller disconnected right after CreateSession, the loop had already
ended when the UI sent Initiated, and credentialsd-ui aborted with
SendError. Log a warning instead; the UI closes with the request anyway.
iinuwa
iinuwa previously approved these changes Nov 13, 2026

@iinuwa iinuwa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants