Skip to content
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

modify-labels-then-hide doesn't always remove labels #4396

Open
aspiers opened this issue Oct 2, 2024 · 1 comment
Open

modify-labels-then-hide doesn't always remove labels #4396

aspiers opened this issue Oct 2, 2024 · 1 comment
Labels

Comments

@aspiers
Copy link

aspiers commented Oct 2, 2024

Expected Behaviour

modify-labels-then-hide -inbox should always remove an inbox tag.

Actual Behaviour

modify-labels-then-hide -inbox doesn't always remove an inbox tag.

Steps to Reproduce

I'm using notmuch (and lieer, although that's not relevant here).

I have the following config:

tag-formats "inbox" "GI"
set index_format='%Z%<GI?I&a>%4C %@date@ %-18.18f %s%>  %g %c'

so that in the %<GI?I&a> column I see I when a mail has the inbox tag, and a if it doesn't (i.e. is archived).

I also have:

macro index,pager e "<modify-labels-then-hide>-inbox\n" "remove from inbox"

so that I can quickly archive email from my inbox by pressing e.

When in a vfolder and I press it, it should always change the above custom status column from I to a, and if the vfolder is based on a query containing tag:inbox, then reloading the vfolder should no longer display that mail.

How often does this happen?

Sometimes. It typically works the first time or two I press e, but it often stops working for subsequent times.

I haven't figured out an exact pattern yet for when it stops working, but it seems to happen consistently if I go into the pager mode to view a message in a thread, and then invoke it from there. Typically pressing e will change the status column from I to a once or twice, but by the third mail in the thread, nothing happens.

UPDATE: It seems to happen a lot less frequently from the index.

When did it start to happen?

I've only just started using notmuch with neomutt, and I noticed it immediately.

NeoMutt Version

Compiled from latest git just now:

NeoMutt 20241002
Copyright (C) 2015-2024 Richard Russon and friends
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.

System: Linux 6.8.8-1-default (x86_64)
ncurses: ncurses 6.5.20240922 (compiled with 6.5.20240922)
libidn2: 2.3.7 (compiled with 2.3.7)
GPGME: 1.23.2
GnuTLS: 3.8.7
libnotmuch: 5.6.0
storage: lmdb
compression: zlib

Configure options: --prefix= --ssl --gnutls --gpgme --notmuch --zlib --lmdb

Compilation CFLAGS: -std=c11 -fno-delete-null-pointer-checks -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED -I/include -I/include -DNCURSES_WIDECHAR -I/include -I/usr/include/p11-kit-1 -I/include -O2

Compile options:
  -autocrypt +fcntl -flock -fmemopen +futimens +getaddrinfo +gnutls +gpgme 
  -gsasl -gss +hcache -homespool +idn +inotify -locales_hack -lua +nls +notmuch 
  -openssl +pgp +regex -sasl +smime -sqlite +truecolor 

MAILPATH="/var/mail"
PKGDATADIR="/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/etc"

To learn more about NeoMutt, visit: https://neomutt.org
If you find a bug in NeoMutt, please raise an issue at:
    https://github.com/neomutt/neomutt/issues
or send an email to: <neomutt-devel@neomutt.org>

Extra Info

  • Operating System: openSUSE Tumbleweed Linux
  • Were you using multiple copies of NeoMutt at once? No
  • Were you using 'screen' or 'tmux'? tmux
  • Is your email local (maildir) or remote (IMAP)? local maildir

Debug logs from a successful removal of the inbox tag

In the below logs, I'm guessing that the presence of false at the end of this line is relevant:

nm_message_is_still_queried() nm: checking if message is still queried: id:27.C2.30375.D4E77866@kv.mta1vrest.cc.prd.sparkpost and (query:notion) = false

because it always seems to say false when the tag removal succeeds, and true when the bug appears.

[2024-10-02 17:03:00]<1> dlg_pager() Got op OP_MAIN_MODIFY_TAGS_THEN_HIDE (153)
[2024-10-02 17:03:00]<5> msgwin_window_observer() window state done, request WA_RECALC
[2024-10-02 17:03:00]<5> enter_recalc() recalc done, request WA_REPAINT
[2024-10-02 17:03:00]<5> enter_repaint() repaint done
[2024-10-02 17:03:00]<5> enter_repaint() repaint done
[2024-10-02 17:03:00]<5> mw_get_field() Got char - (0x2d)
[2024-10-02 17:03:00]<5> enter_repaint() repaint done
[2024-10-02 17:03:00]<5> mw_get_field() Got char i (0x69)
[2024-10-02 17:03:00]<5> enter_repaint() repaint done
[2024-10-02 17:03:00]<5> mw_get_field() Got char n (0x6e)
[2024-10-02 17:03:00]<5> enter_repaint() repaint done
[2024-10-02 17:03:00]<5> mw_get_field() Got char b (0x62)
[2024-10-02 17:03:00]<5> enter_repaint() repaint done
[2024-10-02 17:03:00]<5> mw_get_field() Got char o (0x6f)
[2024-10-02 17:03:00]<5> enter_repaint() repaint done
[2024-10-02 17:03:00]<5> mw_get_field() Got char x (0x78)
[2024-10-02 17:03:00]<5> enter_repaint() repaint done
[2024-10-02 17:03:00]<5> mw_get_field() Got char 
 (0x0a)
[2024-10-02 17:03:00]<5> msgwin_window_observer() window state done, request WA_RECALC
[2024-10-02 17:03:00]<5> msgwin_recalc() recalc done, request WA_REPAINT
[2024-10-02 17:03:00]<5> msgwin_repaint() msgwin repaint done
[2024-10-02 17:03:00]<2> nm_db_get_filename() nm: db filename '/home/adam/mail/work/notmuch'
[2024-10-02 17:03:00]<1> nm_db_do_open() nm: db open '/home/adam/mail/work/notmuch' [WRITE] (timeout 5)
[2024-10-02 17:03:00]<2> get_nm_message() nm: find message (27.C2.30375.D4E77866@kv.mta1vrest.cc.prd.sparkpost)
[2024-10-02 17:03:00]<1> nm_tags_commit() nm: tags modify: '-inbox'
[2024-10-02 17:03:00]<1> update_tags() nm: remove tag: 'inbox'
[2024-10-02 17:03:00]<2> update_email_tags() nm: tags update requested (27.C2.30375.D4E77866@kv.mta1vrest.cc.prd.sparkpost)
[2024-10-02 17:03:00]<2> update_email_tags() nm: new tags transformed: 'notion'
[2024-10-02 17:03:00]<2> update_email_tags() nm: new tag: 'notion'
[2024-10-02 17:03:00]<5> mutt_addr_is_user() no, all failed
[2024-10-02 17:03:00]<5> mutt_regexlist_match() adam@my.domain.censored matches adam@my.domain.censored
[2024-10-02 17:03:00]<5> mutt_alternates_match() yes, adam@my.domain.censored matched by alternates
[2024-10-02 17:03:00]<1> nm_db_release() nm: db close
[2024-10-02 17:03:00]<1> nm_tags_commit() nm: tags modify done [rc=0]
[2024-10-02 17:03:00]<2> nm_db_get_filename() nm: db filename '/home/adam/mail/work/notmuch'
[2024-10-02 17:03:00]<1> nm_db_do_open() nm: db open '/home/adam/mail/work/notmuch' [READ] (timeout 5)
[2024-10-02 17:03:00]<2> get_query_string() nm: true
[2024-10-02 17:03:00]<2> windowed_query_from_query() nm: query:notion
[2024-10-02 17:03:00]<2> query_window_reset() entering
[2024-10-02 17:03:00]<2> get_query_string() nm: query (windowed) 'query:notion'
[2024-10-02 17:03:00]<2> nm_message_is_still_queried() nm: checking if message is still queried: id:27.C2.30375.D4E77866@kv.mta1vrest.cc.prd.sparkpost and (query:notion)
[2024-10-02 17:03:00]<2> nm_message_is_still_queried() nm: checking if message is still queried: id:27.C2.30375.D4E77866@kv.mta1vrest.cc.prd.sparkpost and (query:notion) = false
[2024-10-02 17:03:00]<5> pbar_index_observer() index done, request WA_RECALC
[2024-10-02 17:03:00]<5> pager_index_observer() index done, request WA_RECALC
[2024-10-02 17:03:00]<5> ibar_index_observer() index done, request WA_RECALC
[2024-10-02 17:03:00]<5> index_index_observer() index done, request WA_RECALC
[2024-10-02 17:03:00]<5> ibar_menu_observer() menu done, request WA_RECALC
[2024-10-02 17:03:00]<1> index_function_dispatcher() Handled OP_MAIN_MODIFY_TAGS_THEN_HIDE (153) -> success

Debug logs from a failed removal of the inbox tag

[2024-10-02 17:03:02]<1> dlg_pager() Got op OP_MAIN_MODIFY_TAGS_THEN_HIDE (153)
[2024-10-02 17:03:02]<5> msgwin_window_observer() window state done, request WA_RECALC
[2024-10-02 17:03:02]<5> enter_recalc() recalc done, request WA_REPAINT
[2024-10-02 17:03:02]<5> enter_repaint() repaint done
[2024-10-02 17:03:02]<5> enter_repaint() repaint done
[2024-10-02 17:03:02]<5> mw_get_field() Got char - (0x2d)
[2024-10-02 17:03:02]<5> enter_repaint() repaint done
[2024-10-02 17:03:02]<5> mw_get_field() Got char i (0x69)
[2024-10-02 17:03:02]<5> enter_repaint() repaint done
[2024-10-02 17:03:02]<5> mw_get_field() Got char n (0x6e)
[2024-10-02 17:03:02]<5> enter_repaint() repaint done
[2024-10-02 17:03:02]<5> mw_get_field() Got char b (0x62)
[2024-10-02 17:03:02]<5> enter_repaint() repaint done
[2024-10-02 17:03:02]<5> mw_get_field() Got char o (0x6f)
[2024-10-02 17:03:02]<5> enter_repaint() repaint done
[2024-10-02 17:03:02]<5> mw_get_field() Got char x (0x78)
[2024-10-02 17:03:02]<5> enter_repaint() repaint done
[2024-10-02 17:03:02]<5> mw_get_field() Got char 
 (0x0a)
[2024-10-02 17:03:02]<5> msgwin_window_observer() window state done, request WA_RECALC
[2024-10-02 17:03:02]<5> msgwin_recalc() recalc done, request WA_REPAINT
[2024-10-02 17:03:02]<5> msgwin_repaint() msgwin repaint done
[2024-10-02 17:03:02]<2> get_nm_message() nm: find message (78.13.42904.5B3D7866@gc.mta1vrest.cc.prd.sparkpost)
[2024-10-02 17:03:02]<1> nm_tags_commit() nm: tags modify: '-inbox'
[2024-10-02 17:03:02]<1> update_tags() nm: remove tag: 'inbox'
[2024-10-02 17:03:02]<2> update_email_tags() nm: tags update requested (78.13.42904.5B3D7866@gc.mta1vrest.cc.prd.sparkpost)
[2024-10-02 17:03:02]<2> update_email_tags() nm: new tags transformed: 'notion'
[2024-10-02 17:03:02]<2> update_email_tags() nm: new tag: 'notion'
[2024-10-02 17:03:02]<5> mutt_addr_is_user() no, all failed
[2024-10-02 17:03:02]<5> mutt_regexlist_match() adam@my.domain.censored matches adam@my.domain.censored
[2024-10-02 17:03:02]<5> mutt_alternates_match() yes, adam@my.domain.censored matched by alternates
[2024-10-02 17:03:02]<1> nm_db_release() nm: db close
[2024-10-02 17:03:02]<1> nm_tags_commit() nm: tags modify done [rc=0]
[2024-10-02 17:03:02]<2> nm_db_get_filename() nm: db filename '/home/adam/mail/work/notmuch'
[2024-10-02 17:03:02]<1> nm_db_do_open() nm: db open '/home/adam/mail/work/notmuch' [READ] (timeout 5)
[2024-10-02 17:03:02]<2> get_query_string() nm: true
[2024-10-02 17:03:02]<2> windowed_query_from_query() nm: query:notion
[2024-10-02 17:03:02]<2> query_window_reset() entering
[2024-10-02 17:03:02]<2> get_query_string() nm: query (windowed) 'query:notion'
[2024-10-02 17:03:02]<2> nm_message_is_still_queried() nm: checking if message is still queried: id:78.13.42904.5B3D7866@gc.mta1vrest.cc.prd.sparkpost and (query:notion)
[2024-10-02 17:03:02]<2> nm_message_is_still_queried() nm: checking if message is still queried: id:78.13.42904.5B3D7866@gc.mta1vrest.cc.prd.sparkpost and (query:notion) = true
[2024-10-02 17:03:02]<5> pbar_index_observer() index done, request WA_RECALC
[2024-10-02 17:03:02]<5> pager_index_observer() index done, request WA_RECALC
[2024-10-02 17:03:02]<5> ibar_index_observer() index done, request WA_RECALC
[2024-10-02 17:03:02]<5> index_index_observer() index done, request WA_RECALC
[2024-10-02 17:03:02]<5> ibar_menu_observer() menu done, request WA_RECALC
[2024-10-02 17:03:02]<1> index_function_dispatcher() Handled OP_MAIN_MODIFY_TAGS_THEN_HIDE (153) -> success
@aspiers aspiers added the type:bug Bug label Oct 2, 2024
@aspiers
Copy link
Author

aspiers commented Oct 2, 2024

Comparing the logs from the good and bad runs, the only other difference I can spot except for the false vs. true is that in the good run, there are these two extra lines before the tag is removed:

[2024-10-02 17:03:00]<2> nm_db_get_filename() nm: db filename '/home/adam/mail/work/notmuch'
[2024-10-02 17:03:00]<1> nm_db_do_open() nm: db open '/home/adam/mail/work/notmuch' [WRITE] (timeout 5)

but I'm not sure that's always the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant