Repository navigation
Prevent hangs in polkit agent dialog - #242
Merged
Merged
Conversation
There shouldn't be any reason we can't let the user cancel while the polkit agent helper is running. If that hangs for any reason, this will also allow getting rid of the dialog.
If we don't call `.clear()`, `read_line()` will append to the existing line, and we'll try to parse the combined string with a `\n` in the middle.
jackpot51
approved these changes
Nov 5, 2026
Member
Author
|
@Elias-Graf was there some specific reason to add the |
leviport
approved these changes
Nov 5, 2026
leviport
left a comment
Member
There was a problem hiding this comment.
Confirmed to fix pop-os/cosmic-store#641 on Resolute. Password prompt still works as expected on Noble.
Regression testing passed:
Checklist
- Volume hotkeys work
- Plugging a headset into a combo jack prompts to select the type
- Screen brightness can be adjusted in 5% increments with hotkeys, down to 1%
- Keyboard backlight brightness can be adjusted via hotkeys
- Airplane mode can be enabled and disabled via hotkey
- Touchpad can be disabled and enabled via hotkey
- Open the Log Out dialog; tab key works to navigate buttons
- Enter on Cancel exits dialog
- Esc key (without anything focused) also exits dialog
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.
This should fix pop-os/cosmic-store#641.
There seem to be a few issues here:
AgentHelper::nextisn't correctly handling skipping over a line, and tries to parse a string with both lines and a\nfor _ in 0..3added in fix: polkit agent not working with sockets #193 doesn't seem to be working properly, and it hangs and doesn't make progress? Not sure what's going on there, or why this was added since I don't think the original version had something like that...The first issue requires patching
polkit, and I'm not sure exactly what to change with the last issue, so for now this fixes the second and third issues here. That should make the dialog generally behave as expected even with thepolkitbug, and allow cancelling even if something like this happens again.