-
-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn on missing password executable #3249
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is related to #3213 and addresses it partially, but it doesn't close it so I've edited the top post. I'm handling the remaining tasks of that issue.
@aartaka I confess that this is not the solution I had in mind. And your description also seems to communicate that a different approach is desirable.
I think we should catch the error at execute
. But we need to catch it differently depending on whether we use uiop:run-program
or uiop:launch-program
. (uiop:run-program "tomato")
returns exit code 127 so that's easy. In the other case, we can fetch the exit code via (uiop:wait-process (uiop:launch-program "tomato"))
. What do you think?
Please ignore my comment above. The issue that we're trying to solve is that sera:resolve-executable
may return NIL. But then execute
from libraries/password-manager/password.lisp
should handle it. If there's no executable, then there's nothing to execute.
While both uiop:run-program
and uiop:launch-program
handle the case when they're passed a NIL value, an error should be raised when (executable interface)
returns NIL.
Is there something I am missing, would the following work?
|
Of course we would then have to put guards in Nyxt to see if a function returns nil... |
d9a50a1
to
84d5db5
Compare
Okay, another shot at a better design in dd2f0da. I haven't yet added the user-facing side of it, focusing on the right place for error signalling. Looks alright? |
The strategy is in line with what I had in mind. I still have to test it. Thanks. Note the this PR needs to be rebased onto master. |
84d5db5
to
53060b3
Compare
Done ✅ |
In my understand the PR, as it stands, doesn't answer to the issue at hand. Populate the config file with the snippet below and ensure that (define-configuration nyxt/mode/password:password-mode
((nyxt/mode/password:password-interface (make-instance 'password:keepassxc-interface)))) |
It errors on me with this piece of config (ensuring NIL value): (define-configuration :password-mode
((password-interface (make-instance 'password:keepassxc-interface :executable nil)))) |
And what conclusion can be drawn? |
Commands that use password interface will get an error and warn the user about it. Good pattern? Good pattern. |
As explained above, I don't think that this assertion is correct. Did you try the recipe? |
53060b3
to
7179bae
Compare
I'm taking over this @jmercouris. |
Description
This warns the user if Nyxt cannot find the executable for their password manager, instead of erroring down the line.
Discussion
It uses
:around
method, which might be dangerous. But then,password-mode
is all about hijacking intopassword-interface
and making it more considerate, so it's aligned with the general approach.Warning in any other place is not feasible, because it's either too early (in
password-manager
, because it mustn't know anything about Nyxt or user config) or too late (inpassword:execute
anduiop:*-program
).Checklist:
Everything in this checklist is required for each PR. Please do not approve a PR that does not have all of these items.
cd /path/to/nyxt/checkout git submodule add https://gitlab.common-lisp.net/nyxt/py-configparser _build/py-configparser
:documentation
s written in the aforementioned style. (It's OK to skip the docstring for really trivial parts.)changelog.lisp
with my changes if it's anything user-facing (new features, important bug fix, compatibility breakage).migration.lisp
entry for all compatibility-breaking changes.(asdf:test-system :nyxt)
and(asdf:test-system :nyxt/gi-gtk)
) and they pass.