-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
new.tags not being honoured if not specified in database #229
Comments
Maybe it should be reverted to the old behavior. Does notmuch still use the config file for that setting? |
They seem to. Maybe they're in the middle of a transition though? I used to use notmuch 0.27 before and In the current documentation, it seems more fluid, though there are definite references to the config file. I guess I'll need to search through their mailing list or something to see if they're making changes (edit: their mailing list archives end in 2020). I did see that in their release notes for 0.36, they called out:
It doesn't seem well documented, but seems to be referring to https://github.com/notmuch/notmuch/blob/master/bindings/python-cffi/notmuch2/_config.py. If I set the value in the database:
Either way, the current README for lieer is out of sync with the behaviour I'm seeing. |
I too seem to be getting hit by the always-add- |
I ran into this and the fix for me was to install 1.3 and work off of that instead of latest main. |
I will do the same, but it seems to me an issue that should be solved. I spent a lot of time figuring out what was happening to the tags and why I was getting the 'unread' tag on all emails. Maybe for the moment a warning in the README? By the way, thank you for the excellent utility. |
I am experiencing the same issue, how to reproduce:
I'd assume the fist sync messes up with local labels by adding something like "inbox" and "unread". Then when it syncs second time, it pushes those changes as local changes? Hypothesis.... I was trying to look to the code, which does partial pull, but my limited understanding doesn't find any issues there. Could it be the labels are added on |
What I do not understand is why we use bitwise "and" operator there:
isn't it supposed to be logical "and"? |
Can we revert it back? :) |
I think that's the same. Does it fix the issue? |
I would be able to tests it in a few days, but it's bothering me a lot :) So, I wouldn't be able to avoid trying it... I think, I can kick off the python in REPL and see what the not much binding returns and make some conclusions basing on that. |
I think this is |
where
Seems like notmuch doesn't load the config my default... |
Does it work better if you also set that config in the database (taken from above):
I suspect that's everything lieer gets now. I'm not sure what notmuch wants us to do. |
I think you're 100% correct. The
fixes the code as well:
Weird that
|
I can confirm that |
Ok. So maybe the fix is to update the README, bug notmuch and add a line to caveats. If we're nice we could check for difference, but that means adding code for reading the config again, which would be nice to avoid. |
I agree, My mental model of the notmuch config is broken now and I can't find a good explanation of how it is supposed to work (having 2 configs: one in home directory, the other one in database). Cuz my assumption notmuch uses HOME config to find the database location, but then the rest of options ignore or overwritten by Database config or they're merged somehow... Confusing... Looking into the python binding of notmuch2, it uses the home config ONLY to read database location and the create a config mapping from the database. And the config (seems like) is stored as some binary blob (not a text file), since I can't find it anywhere. Also, there is no way from shell to READ the database config... I hope, I am wrong... |
According to #229 (comment) you can read db config from shell, if you remove text config value. |
Right, I really didn't it through! I see it now! |
Is there a configuration that would go into the database that works in this regard if we don't want any tags added to new mail? (eg, if I'm letting gmail handle all labeling, and don't need to use any notmuch-side filtering/tagging) |
@nickurak I'm fairly sure this single space trick works, although not heavily tested yet:
Note that it's critical to have the single space inside the quotes here. If there's no space then it defaults to With this trick, it's also critical to not set |
@arvindsv commented on December 14, 2022 6:20 PM:
I did a small bit of archaeology and found notmuch/notmuch@dd9112e which is somewhat enlightening, but still doesn't explain why they split config between two places in the first place. |
First of all, thank you for writing and maintaining lieer! I've used it for a while, and it does what it does very well. :)
I've been trying to debug this issue for a little while now. The behaviour I see is described below. I'm not entirely sure when it started happening, because I also switched laptops -- but it seems like it started with the shift to the new notmuch2 bindings.
Observed behaviour
When
gmi pull
finishes, the tags it adds always includesunread
andinbox
even ifnew.tags
in$NOTMUCH_CONFIG
is set to something else.Click / unhide this to see a shell session which demonstrates this issue
I made sure to create a new GMail account and a new notmuch database to verify this. As can be seen above, even archiving and changing a label does not prevent lieer from adding
inbox
andunread
tags locally, and then pushing those back.Potential issue causing this
I don't know the lieer codebase well enough. But, I poked around and it seems like the below lines might be relevant:
lieer/lieer/local.py
Lines 355 to 358 in 2cfbc5b
I looked into the notmuch2 python bindings documentation (here) and it says: "Return a mutable mapping with the settings stored in this database" (emphasis mine).
The older notmuch bindings said much the same: "Note that only config values that are stored in the database are searched and returned. The config file is not read".
Till September 2022 (till this commit), lieer used to do the correct thing, and read from the config file. See:
lieer/lieer/local.py
Lines 303 to 311 in bf719d6
At this time, when I add print statements around this:
lieer/lieer/local.py
Lines 355 to 358 in 2cfbc5b
unread
andinbox
and I have not been able to get it to show anything else.Given that
db.config.get
seems to only read from the Xapian metadata, and not from the notmuch config file, it feels like this code should read directly from the config file, to fix this issue. Happy to be corrected.The text was updated successfully, but these errors were encountered: