8000 fix(composer): keep contact lookups off the UI thread by aheinze · Pull Request #484 · hyprlab/hylki · GitHub
[go: up one dir, main page]

Skip to content

fix(composer): keep contact lookups off the UI thread - #484

Closed
aheinze wants to merge 1 commit into
hyprlab:mainfrom
aheinze:codex/fix-composer-contact-hang
Closed

aheinze wants to merge 1 commit into
hyprlab:mainfrom
aheinze:codex/fix-composer-contact-hang

Conversation

@aheinze
@aheinze aheinze commented Oct 18, 2026
Copy link
Copy Markdown
Contributor

Opening Reply or New Message calls contacts::suggestions() while constructing the composer on the GTK thread. If Evolution Data Server owns its bus name but stops answering GetManagedObjects, the entire window stops responding. This was observed with a deadlocked GNOME Online Accounts/Microsoft 365 source registry on Fedora 44 and reproduced with Hylki 1.44.0 against a fake registry that never replies.

Load suggestions on the composer's existing background worker and deliver them after the editor opens. Bound the registry request to three seconds using GIO, allowing the existing cached-contact and mail-history fallback to finish without leaving blocked worker threads. Merge results with addresses added while loading and refresh the focused recipient field without replacing its text.

Validation:

  • cargo build --locked: passed in a Fedora 44 container.
  • cargo test --locked --bin hylki: 822 passed, 0 failed, 27 ignored. New tests cover registry reply decoding and suggestions arriving after another composer adds an address.
  • Real GTK/WebKit app regression checks: Reply and New Message remain responsive with a permanently hung, healthy or absent contact service. Hung-service checks also cover separate compose windows. All eight cases passed; each checks GTK main-loop responses, text insertion in the editor, a rendered screenshot and the expected contact/history suggestions.
  • The same hung-service checks against the installed, unpatched 1.44.0 binary failed for both Reply and New Message with main-loop request timeouts.
  • python3 tools/check-docs.py and git diff --check: passed.

The regression script uses demo mail, isolated XDG directories and a private D-Bus server with no service activation directories. Run it in a disposable desktop/container with Python GObject/GIO, dbus-daemon and Xvfb:

xvfb-run -a python3 tools/test-compose-responsiveness.py target/debug/hylki
xvfb-run -a python3 tools/test-compose-responsiveness.py target/debug/hylki --mode hang --windowed

This prevents the external service failure from freezing Hylki; the underlying Evolution Data Server deadlock is outside this change.

Load recipient suggestions after opening the composer and bound source-registry requests so a stuck contact service cannot freeze the window. Preserve addresses added while loading and fall back to cached contacts and mail history. Add unit coverage and real-app checks for Reply and New Message with hung, healthy and absent contact services.
@hyprlab
hyprlab commented Oct 19, 2026
Copy link
Copy Markdown
Owner

Agentic reply:

Your fix is in the 1.45.0-beta.2 release (x86_64 only). It landed as one commit with two changes: the regression script was left out, and the suggestions load on a thread of their own, so a slow keyring behind the directory lookup no longer holds up autocomplete. Please test it there and report anything that doesn't look right. It reaches the stable channel with the next stable release.

The beta build is in the repo now: flatpak update picks it up.

@hyprlab hyprlab closed this Oct 19, 2026
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

0