threaded view broken: crashes with IMAP backend; can't change tags with notmuch backend #200

Closed
opened 2022-11-07 05:58:01 +02:00 by falsifian · 5 comments

When using the notmuch backend and threaded view, I can't change tags. Specifically: if I run :tag add test on a message, then later in a terminal run notmuch search tag:test, I get no results.

Here's the configuration I used:

[accounts.notmuch]
root_mailbox = "/home/falsifian/var/mbsync/falsifian.org"
format = "notmuch"
identity="falsifian@falsifian.org"
display_name = "James Cook"
listing.index_style = "threaded"
  [accounts.notmuch.mailboxes]
  "INBOX" = {  query="tag:inbox", subscribe = true }
  "Drafts" = {  query="tag:draft", subscribe = true }
  "Reading" = {  query="tag:reading", subscribe = true }
  "Sent" = {  query="folder:Sent", subscribe = true }
  "Spam" = {  query="tag:spam", subscribe = true }

[composing]
send_mail = "sendmail"

[terminal]
theme = "light"

If I drop the line listing.index_style = "threaded", adding the tag test works.

I tried threaded view with the IMAP backend, but meli exits with exit code 101 shortly after (successfully) displaying the inbox.

I'm using the OpenBSD meli port, which is at git commit 3697b7d9 plus
some patches.

When using the notmuch backend and threaded view, I can't change tags. Specifically: if I run `:tag add test` on a message, then later in a terminal run `notmuch search tag:test`, I get no results. Here's the configuration I used: ``` [accounts.notmuch] root_mailbox = "/home/falsifian/var/mbsync/falsifian.org" format = "notmuch" identity="falsifian@falsifian.org" display_name = "James Cook" listing.index_style = "threaded" [accounts.notmuch.mailboxes] "INBOX" = { query="tag:inbox", subscribe = true } "Drafts" = { query="tag:draft", subscribe = true } "Reading" = { query="tag:reading", subscribe = true } "Sent" = { query="folder:Sent", subscribe = true } "Spam" = { query="tag:spam", subscribe = true } [composing] send_mail = "sendmail" [terminal] theme = "light" ``` If I drop the line `listing.index_style = "threaded"`, adding the tag `test` works. I tried threaded view with the IMAP backend, but meli exits with exit code 101 shortly after (successfully) displaying the inbox. I'm using the OpenBSD meli port, which is at git commit 3697b7d9 plus some patches.

Also, in threaded view (with notmuch backend) pressing v (to select a message) doesn't seem to do anything.

Also, in threaded view (with notmuch backend) pressing `v` (to select a message) doesn't seem to do anything.

@falsifian it seems some code was missing from the thread list, because selection etc logic was duplicated on all lists. I'd like in the future to tidy this up and have one list type that can instead change index style instead of separate type per style.

I pushed a refactoring in cc439b23 and it seems to work for me; this might introduce some new bugs though. Can you confirm?

@falsifian it seems some code was missing from the thread list, because selection etc logic was duplicated on all lists. I'd like in the future to tidy this up and have one list type that can instead change index style instead of separate type per style. I pushed a refactoring in cc439b23 and it seems to work for me; this might introduce some new bugs though. Can you confirm?

Just tried at commit cc439b23. Marking/unmarking does seem to have an effect: highlights the message in red (though I have to select a different message before it's visible; maybe that's a theme issue). I haven't tried a bulk action on marked messages yet.

I can also tag/untag messages with :tag add ... and :tag remove ... but the changes are not visible. If I quit meli and open it again I can see the tag change I made. (Or I can check it manually with notmuch search tag:....) This is an improvement over the previous behaviour where the tag didn't get changed at all.

Incidentally, I first tried building at commit 5ba7b2cd but ran into the following error, which I am guessing is related to commit bd22f986 which as far as I can tell removed some default implementations. However I am building it in an unconventional way, by modifying a few lines of the Makefile in the OpenBSD port, and haven't ruled out that it could have something to do with that. So I haven't filed a separate bug but could do that anyway if you like.

warning: unused macro definition: `get_conf_val`                                
   --> melib/src/backends/jmap.rs:156:14                                        
    |                                                                           
156 | macro_rules! get_conf_val {                                               
    |              ^^^^^^^^^^^^                                                 
    |                                                                           
    = note: `#[warn(unused_macros)]` on by default                              
                                                                                
warning: unused import: `std::os::unix::io::AsRawFd`                            
   --> melib/src/lib.rs:185:9                                                   
    |                                                                           
185 |     use std::os::unix::io::AsRawFd;                                       
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^                                        
    |                                                                           
    = note: `#[warn(unused_imports)]` on by default                             
                                                                                
error[E0046]: not all trait items implemented, missing: `delete_mailbox`, `set_m
ailbox_subscription`, `set_mailbox_permissions`                                 
   --> melib/src/backends/jmap.rs:295:1                                         
    |                                                                           
295 |   impl MailBackend for JmapType {                                         
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `delete_mailbox`, `set_mailbox_sub
scription`, `set_mailbox_permissions` in implementation                         
    |                                                                           
   ::: melib/src/backends.rs:404:5                                              
    |                                                                           404 | /     fn delete_mailbox(                                                  
405 | |         &mut self,                                                      
406 | |         mailbox_hash: MailboxHash,                                      
407 | |     ) -> ResultFuture<HashMap<MailboxHash, Mailbox>>;                   
    | |_____________________________________________________- `delete_mailbox` f
rom trait                                                                       
408 |                                                                           
409 | /     fn set_mailbox_subscription(                                        
410 | |         &mut self,                                                      
411 | |         mailbox_hash: MailboxHash,      
412 | |         val: bool,
413 | |     ) -> ResultFuture<()>;
    | |__________________________- `set_mailbox_subscription` from trait
...
421 | /     fn set_mailbox_permissions(
422 | |         &mut self,
423 | |         mailbox_hash: MailboxHash,
424 | |         val: MailboxPermissions, 
425 | |     ) -> ResultFuture<()>;
    | |__________________________- `set_mailbox_permissions` from trait

For more information about this error, try `rustc --explain E0046`.
warning: `melib` (lib) generated 2 warnings
error: could not compile `melib` due to previous error; 2 warnings emitted


Just tried at commit cc439b23. Marking/unmarking does seem to have an effect: highlights the message in red (though I have to select a different message before it's visible; maybe that's a theme issue). I haven't tried a bulk action on marked messages yet. I can also tag/untag messages with `:tag add ...` and `:tag remove ...` but the changes are not visible. If I quit meli and open it again I can see the tag change I made. (Or I can check it manually with `notmuch search tag:...`.) This is an improvement over the previous behaviour where the tag didn't get changed at all. Incidentally, I first tried building at commit `5ba7b2cd` but ran into the following error, which I am guessing is related to commit `bd22f986` which as far as I can tell removed some default implementations. However I am building it in an unconventional way, by modifying a few lines of the `Makefile` in the OpenBSD port, and haven't ruled out that it could have something to do with that. So I haven't filed a separate bug but could do that anyway if you like. ``` warning: unused macro definition: `get_conf_val` --> melib/src/backends/jmap.rs:156:14 | 156 | macro_rules! get_conf_val { | ^^^^^^^^^^^^ | = note: `#[warn(unused_macros)]` on by default warning: unused import: `std::os::unix::io::AsRawFd` --> melib/src/lib.rs:185:9 | 185 | use std::os::unix::io::AsRawFd; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default error[E0046]: not all trait items implemented, missing: `delete_mailbox`, `set_m ailbox_subscription`, `set_mailbox_permissions` --> melib/src/backends/jmap.rs:295:1 | 295 | impl MailBackend for JmapType { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `delete_mailbox`, `set_mailbox_sub scription`, `set_mailbox_permissions` in implementation | ::: melib/src/backends.rs:404:5 | 404 | / fn delete_mailbox( 405 | | &mut self, 406 | | mailbox_hash: MailboxHash, 407 | | ) -> ResultFuture<HashMap<MailboxHash, Mailbox>>; | |_____________________________________________________- `delete_mailbox` f rom trait 408 | 409 | / fn set_mailbox_subscription( 410 | | &mut self, 411 | | mailbox_hash: MailboxHash, 412 | | val: bool, 413 | | ) -> ResultFuture<()>; | |__________________________- `set_mailbox_subscription` from trait ... 421 | / fn set_mailbox_permissions( 422 | | &mut self, 423 | | mailbox_hash: MailboxHash, 424 | | val: MailboxPermissions, 425 | | ) -> ResultFuture<()>; | |__________________________- `set_mailbox_permissions` from trait For more information about this error, try `rustc --explain E0046`. warning: `melib` (lib) generated 2 warnings error: could not compile `melib` due to previous error; 2 warnings emitted ```

Shoot, sorry for that. I pushed a fix for jmap compilation. I should really add another CI, I used to have a free gitlab.com repository but they removed unlimited free CI recently.

I reworked the list behaviors in the latest commits so you might see changes for the better or worse for this bug.

Shoot, sorry for that. I pushed a fix for jmap compilation. I should really add another CI, I used to have a free gitlab.com repository but they removed unlimited free CI recently. I reworked the list behaviors in the latest commits so you might see changes for the better or worse for this bug.

I think everything is fixed by now in master: I reworked selections to work the same on all list styles, and tag updates to update the screen properly. Please feel free to reopen this issue or a new one if something is wrong, I would want to fix it :)

I think everything is fixed by now in `master`: I reworked selections to work the same on all list styles, and tag updates to update the screen properly. Please feel free to reopen this issue or a new one if something is wrong, I would want to fix it :)
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: meli/meli#200
There is no content yet.