Repository navigation
Fix 5 second freeze when reading secrets via the XDG portal - #1663
Merged
Merged
Conversation
The portal answers RetrieveSecret with a Response signal. When it refuses the request, e.g. for an app that is not sandboxed, it never writes the secret, and we waited for the full socket timeout on every get_password() call. Opening the transcription viewer did two such calls, freezing the UI for about 10 seconds. Wait for the Response signal and skip reading the socket on failure, cache the portal secret for the process and close the D-Bus connection. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
raivisdejus
enabled auto-merge (squash)
October 16, 2026 20:28
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1663 +/- ##
==========================================
+ Coverage 83.68% 83.91% +0.22%
==========================================
Files 116 115 -1
Lines 13851 13831 -20
==========================================
+ Hits 11591 11606 +15
+ Misses 2260 2225 -35
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Opening a transcript in the viewer took about 10 seconds on Linux, sometimes with an "is not responding" prompt. Every
get_password()call blocked for 5 seconds in_get_portal_secret(), and opening the viewer makes two of them (the viewer itself andTranslator.__init__).The portal sends a
Responsesignal on the request object. When it refuses the request (seen with xdg-desktop-portal 1.21 for an app that is not sandboxed, response code 2), it never writes the secret. We didn't listen for that signal and waited for the full 5 second socket timeout instead.Fix
Responsesignal and return straight away when the code is non-zero, without reading the socket.get_password()is called from many widgets.The first lookup now takes about 70ms, down from 5s, and later lookups take under 1ms.
Tests
New
TestPortalSecrettests intests/store/keyring_store_test.pycover the success path, a failed response returning without reading the socket, the caching, and non-Linux.🤖 Generated with Claude Code