Repository navigation
credential: Pass request handle to the handler - #1
Open
dangerousplay wants to merge 3 commits into
Open
dangerousplay wants to merge 3 commits into
dangerousplay wants to merge 3 commits into
Conversation
The handler is asked to Close() the impl Request at request->id when the client closes the request or disconnects, but it was never told that path. Pass it as the `request_handle` option so the handler can export org.freedesktop.impl.portal.Request there and cancel the in-flight ceremony.
iinuwa
requested changes
Nov 7, 2026
iinuwa
left a comment
Member
There was a problem hiding this comment.
This needs a little bit more machinery: we need to hook into the closed signal and call the handler's Close() method from there. portal clients shouldn't call the handler's Close() method directly.
When the caller closes its request or disconnects, the request forwards Close() to the backend through its org.freedesktop.impl.portal.Request proxy. Portals that delegate to a handler with a different request interface have no way to learn about it. Emit a "closed" signal in both cases, so that such portals can cancel the call on their side. Assisted-by: Claude:claude-opus-5-5
The handler interface is internal to the frontend and credentialsd, so the object the handler exports at `request_handle` should not look like a regular backend request. Add org.freedesktop.handler.portal.experimental.Request with a Close() method, and call it from the XdpRequest "closed" signal instead of forwarding Close() through an org.freedesktop.impl.portal.Request proxy. Document the `request_handle` option in the handler interface. Assisted-by: Claude:claude-opus-5-5
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.
Hi, I hope you are having a good day ^^
When a client closes its Credential request or disconnects, the handler is never told, so the ceremony keeps running and its UI stays open.
request_handle(o) entry in the options ofCreateCredential/GetCredential. The handler exportsorg.freedesktop.handler.portal.experimental.Requestthere for the duration of the call.closedsignal toXdpRequest, emitted when the client callsClose()on its request or disconnects.Close()on the handler's request from that signal. This replaces forwarding through anorg.freedesktop.impl.portal.Requestproxy, since the handler interface is internal and not a regular backend.The option keeps old handlers working. credentialsd support: linux-credentials/credentialsd#246.
Tested by running the built portal against a mock handler on a private bus: both
Request.Close()and a client disconnect result inClose()on the handler's request object.