-
Notifications
You must be signed in to change notification settings - Fork 162
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
Make sure that we have a valid path for DBManager #1610
Conversation
Would it not be simpler, for this use case, to hard-code the same default value as notmuch does |
I'm not sure about that, since there isn't exactly simple hardcoded value to use. There is a logic notmuch follows to get the database path. I extracted the following from the notmuch-config(1) manpage:
So I think it is rather simpler to just ask it directly via |
Oops. I just realized there is an issue with the current patch, forgot to remove the line |
Otherwise, we run into problems when we need to use the path attribute and it is None (for example, in DBManager.add_message()). Getting the path directly from the notmuch config file is not enough, because the user might be using the default location with no explicit entry in the file. Since there is a bit of logic notmuch does to get the database path (see section "DATABASE LOCATION" in man page for notmuch-config(1)), it is better to ask it directly via "notmuch config" instead of reimplementing that same logic.
Force-pushed with the change above. I also took the opportunity to elaborate more on the reason for using |
It's taken me a while but I am generally on board now with calling the notmuch binary for stuff. Also, the main UI code as well as the settings manager are already too bloated, and all this could use some refactoring.
|
Doing this one with #1615. |
Do you know of a way we can reproduce it? Is there an issue already created for this? I'm thinking of closing this PR, since #1615 was merged. |
Unfortunately not. I will try to investigate next time it happens but it is rare and seemingly nondeterministic.
Yes, let's close this issue for now and open another one if needed for the mentioned bug.
Cheers!
#close
Quoting Gustavo José de Sousa (2023-04-16 15:39:53)
… □ making tagging operations; This is sometimes error prone as done now.
For example, I keep seeing individual mails in my inbox and alot's
untagging mech does not seem to work for those messages. Occasionally I
then just call notmuch on the command line. We could simply do this all
the time, or at least have this as an option in alot.
Do you know of a way we can reproduce it? Is there an issue already created for
this? I'm thinking of closing this PR, since #1615 was merged.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.*Message ID: <pazz/alot/pull/1610/
***@***.***>
|
Otherwise, we run into problems when we need to use the path attribute and it is None (for example, in DBManager.add_message()).
Getting the path directly from the notmuch config file is not enough, because the user might be using the default location with no explicit entry in the file. As such, it is better to ask it directly to notmuch.