RealRaven2000 / QuickFolders

Thunderbird Add-on: QuickFolders
http://quickfolders.org/
Other
49 stars 9 forks source link

quick move from search list fails if first mail is already in target folder #23

Closed FrankMittelbach closed 3 years ago

FrankMittelbach commented 4 years ago

If you want to move a selection of mails to a specific folder, then that works well even if some of the mails are already in the target folder. However, it fails if the first of the messages is already in the target folder.

In my use case that is quite often the case: I select a whole thread and move it into a folder, but quite often the first of the mails (e.g., my initial message) is already in that folder and then it fails. Of course, one can select all and then unselect offending message, so there is a workaround, but it would be nice if the quick move would act on the others without the need to do that as it is easily overlooked first time and it works well if the messages are ordered differently.

RealRaven2000 commented 4 years ago

In my use case that is quite often the case: I select a whole thread and move it into a folder, but quite often the first of the mails (e.g., my initial message) is already in that folder and then it fails.

how do you do this? Some sort of a unified / all messages view? I always work with my "real inbox" and then answer "in place" (from a folder) using the copy sent to current Add-on.

Of course, one can select all and then unselect offending message, so there is a workaround, but it would be nice if the quick move would act on the others without the need to do that

yeah it shouldn't really "crash" the move if one (or several) mails are already in place - can you provide a (text only please) debug log? Ctrl+Shift+J opens the log window, which you can clear before you do the move. then use the context menu to select all, copy to clipboard and dump it here in a comment please.

FrankMittelbach commented 4 years ago

yeah it shouldn't really "crash" the move if one (or several) mails are already in place - can you provide a (text only please) debug log? Ctrl+Shift+J opens the log window, which you can clear before you do the move. then use the context menu to select all, copy to clipboard and dump it here in a comment please.

have to figure out first how the console works on a Mac with German locale, it looks quite different from you suggestions. If it is too complicated I'll try on a windows machine tonight (which also has the problem)

RealRaven2000 commented 4 years ago

have to figure out first how the console works on a Mac with German locale, it looks quite different from you suggestions. If it is too complicated I'll try on a windows machine tonight (which also has the problem)

Ok. The main difference is the keyboard shortcut - you can find it in the tools menu: image

Tools > Developer Tools > Error Console

to log additional diagnostic data you can:

image

How do you display emails that are already moved in the source folder while moving to target? With a "normal" inbox, you shouldn't see them. Note: you can also "gather" mails to quickMove in multiple drag + drop operations (hence the counter) and do the quickMove for all of them later. I assumed it should be resilient to missing mails (at least move the remaining ones).

FrankMittelbach commented 4 years ago

have to figure out first how the console works on a Mac with German locale, it looks quite different from you suggestions. If it is too complicated I'll try on a windows machine tonight (which also has the problem)

Ok. The main difference is the keyboard shortcut - you can find it in the tools menu:

thanks for the detailed explanations. Actually the starting problem with a locale different to English is usually also to find the right "translations", for example "Tools" simply doesn't exist as menu you have to use "Extras" etc etc :-) in some cases guessing is easy but in others it is not. Anyway ...

How do you display emails that are already moved in the source folder while moving to target? With a "normal" inbox, you shouldn't see them. Note: you can also "gather" mails to quickMove in multiple drag + drop operations (hence the counter) and do the quickMove for all of them later. I assumed it should be resilient to missing mails (at least move the remaining ones).

yes of course with the normal inbox view I don't see them. What I often do however is to select a mail and execute "In Themenbaum anzeigen" on the mac that's shift-cmd-O which gives me an additional (virtual) tab with all related message by message id (I guess) and that from where I use quickmove (see screenshot which show the tab which I used for the debugging data)

Screenshot 2020-01-15 at 10 10 22

I also often use virtual folders like "mails from the last 3 days in a defined set of folders" and execute it from there.

Anyway, here is the debug data. Basically I used select all in the virtual table shown above and then quickmove choosing a target folder archive/2020 because the first was already in that folder:

QuickFolders 9:53:32.682  [51891 ms]     
toggleMoveModeSearchBox(true)
QuickFolders 9:53:32.682  [0 ms]     
toggleMoveModeSearchBox(true)
QuickFolders 9:53:32.682  [0 ms]     
QuickFolders.quickMove.update()
isActive = true
QuickFolders 9:53:32.682  [0 ms]     
toggleMoveModeSearchBox(true)
QuickFolders {QUICKMOVE} 9:53:32.682  [0 ms]     
findFolder(true, quickMove)
QuickFolders 9:53:32.682  [0 ms]     
toggleMoveModeSearchBox(true)
QuickFolders 9:53:37.615  [4933 ms]  
findFolder (archiv/2020)
QuickFolders {QUICKMOVE} 9:53:37.629  [14 ms]    
Enter key forces match
QuickFolders {QUICKMOVE} 9:53:37.655  [26 ms]    
rememberLastFolder([xpconnect wrapped (nsISupports, nsIRDFResource, nsIMsgFolder, nsISupportsWeakReference)], archiv)
QuickFolders {QUICKMOVE} 9:53:37.655  [0 ms]     
Storing: archiv/2020
QuickFolders {QUICKMOVE} 9:53:37.655  [0 ms]     
quickMove.execute() , tabMode = glodaList
QuickFolders {QUICKMOVE} 9:53:37.655  [0 ms]     
QuickFolders.Util.moveMessages: target = 2020, makeCopy=false
QuickFolders 9:53:37.656  [1 ms]     
slideAlert: Nothing to do: Message is already in folder: 2020
QuickFolders {QUICKMOVE} 9:53:37.656  [0 ms]     
After move Messages actionCount: 0 resetting menu
QuickFolders 9:53:37.656  [0 ms]     
QuickFolders.quickMove.update()
isActive = false
QuickFolders 9:53:37.656  [0 ms]     
toggleMoveModeSearchBox(false)
QuickFolders {QUICKMOVE} 9:53:37.656  [0 ms]     
findFolder(false, null)
QuickFolders 9:53:37.677  [21 ms]    
QuickFolders.quickMove.update()
isActive = false
QuickFolders 9:53:37.677  [0 ms]     
toggleMoveModeSearchBox(false)
QuickFolders {QUICKMOVE} 9:53:37.678  [1 ms]     
findFolder(false, null)
QuickFolders 9:53:37.679  [1 ms]     
util.touch(2020)
1579078417
15/1 9:53:37
QuickFolders {QUICKMOVE} 9:53:37.679  [0 ms]     
After hideFindPopup
QuickFolders {QUICKMOVE} 9:53:37.679  [0 ms]     
tearDownSearchBox()
QuickFolders {QUICKMOVE} 9:53:37.679  [0 ms]     
findFolder(false, undefined)
QuickFolders 9:53:37.679  [0 ms]     
toggleMoveModeSearchBox(false)
QuickFolders 9:53:44.621  [6942 ms]  
persist tab category: undefined
QuickFolders 9:53:44.621  [0 ms]     
persist tab category: undefined 2
QuickFolders 9:53:44.622  [1 ms]     
persist tab category: undefined

Hope that's what you where looking for.

RealRaven2000 commented 4 years ago

thanks for the debug log. Strangely, no errors are listed - I will have to try and reproduce the problem or add more detail to the debug log.

can you press F9 (if you use QuickFolders Pro) to make the folder tree visible? Or: image

I need to see your current "Ordnerliste" for this. Or how do you get there - it appears the mails are in Inbox and 2020: image

Again even with the "Themenbaum" you won't see the original mail unless you are in a special folder such as "gmail/all mail". Themenbaum will only give you what is visible within that folder; so if the emails are in different folders I don't understand how it can display that, unless you did a search. Search (and virtual folders) can display emails that are in various folders - which basically answers my own question on how to test this. I am still curious how you make it work.

FrankMittelbach commented 4 years ago

thanks for the debug log. Strangely, no errors are listed - I will have to try and reproduce the problem or add more detail to the debug log.

sorry, guess I made myself not very clear then. It doesn't crash, ie no errors, it simply reports that nothing needs doing because the first message is in place. It gives me a nice popup saying so.

However, if the order is the other way around, ie the first message is not already in the target folder it then it moves all messages than need moving.

FrankMittelbach commented 4 years ago

Again even with the "Themenbaum" you won't see the original mail unless you are in a special folder such as "gmail/all mail". Themenbaum will only give you what is visible within that folder; so if the emails are in different folders I don't understand how it can display that, unless you did a search. Search (and virtual folders) can display emails that are in various folders - which basically answers my own question on how to test this. I am still curious how you make it work.

well, there must be some setting that makes that happen but don't ask me how I use this for ages, it is standard for me even across different accounts I just selected in my inbox a mail and Themenbaum did find me the same mail in the inbox of a different account. What it leaves out are mails I moved to the deleted folder but anything else is shown.

btw I use "Pro" but F9 doesn't work on the Mac version maybe it is assigned on a different key there, anyway the mails are in Inbox and in archiv/2020 even if Ablageort only shows "2020"

RealRaven2000 commented 4 years ago

sorry, guess I made myself not very clear then. It doesn't crash, ie no errors, it simply reports that nothing needs doing because the first message is in place. It gives me a nice popup saying so.

ok, I can fix that. Still need to reproduce the conditions for it, so:

well, there must be some setting that makes that happen but don't ask me how I use this for ages, it is standard for me even across different accounts I just selected in my inbox a mail and Themenbaum did find me the same mail in the inbox of a different account.

ok, that's the key right there - these are both inboxes. Sounds to me like you are using unified folders- is it set like this? Ansicht - Ordner - Gruppiert image

A screenshot of your folder tree and which node is selected would be super helpful. I thought you meant stuff in Sent (or another folder lower in the tree) plus your inbox. And (AFAIK) that's only possible with a virtual / search folder.

What it leaves out are mails I moved to the deleted folder but anything else is shown.

but these are all Inbox folders, right? I believe "unified folder view" shows all inboxes in the same "posteingang". Another stupid question - do you use filters to move mails from one inbox to another inbox, or how do they end up in a different inbox? (I am always trying to empty my inbox and move mail to more topical filters, but YMMV)

btw I use "Pro" but F9 doesn't work on the Mac version maybe it is assigned on a different key there, anyway the mails are in Inbox and in archiv/2020 even if Ablageort only shows "2020"

hmm that's strange, I checked the code and it's definitely there in the overlay:

<key id="quickFolders-ToggleTree" keycode="VK_F9" oncommand="QuickFolders.Interface.toggleFolderTree();"/>
FrankMittelbach commented 4 years ago

ok, that's the key right there - these are both inboxes. Sounds to me like you are using unified folders- is it set like this? Ansicht - Ordner - Gruppiert image

sort of

Screenshot 2020-01-15 at 15 09 12

A screenshot of your folder tree and which node is selected would be super helpful. I thought you meant stuff in Sent (or another folder lower in the tree) plus your inbox. And (AFAIK) that's only possible with a virtual / search folder.

just moved one of your replies into the Sent folder (which is called Gesendet) and using Themenbaum it finds it there, so I guess you are mistaken

Screenshot 2020-01-15 at 15 15 47

What it leaves out are mails I moved to the deleted folder but anything else is shown.

but these are all Inbox folders, right? I believe "unified folder view" shows all inboxes in the same "posteingang". Another stupid question - do you use filters to move mails from one inbox to another inbox, or how do they end up in a different inbox? (I am always trying to empty my inbox and move mail to more topical filters, but YMMV)

Not sure I have the right idea what "Inbox folders" are, on this Thunderbird I have afaik 2 inboxes from 2 different external accounts and a lot of topical boxes below one of them and one of the inboxes is rather huge.

btw I use "Pro" but F9 doesn't work on the Mac version maybe it is assigned on a different key there, anyway the mails are in Inbox and in archiv/2020 even if Ablageort only shows "2020"

hmm that's strange, I checked the code and it's definitely there in the overlay:

sorry, forget that one. the F9 works but only if not in a Themenbaum tab as that seems to be somehow the result of a search.

RealRaven2000 commented 4 years ago

A screenshot of your folder tree and which node is selected would be super helpful. I thought you meant stuff in Sent (or another folder lower in the tree) plus your inbox. And (AFAIK) that's only possible with a virtual / search folder.

just moved one of your replies into the Sent folder (which is called Gesendet) and using Themenbaum it finds it there, so I guess you are mistaken

hmm, why does it work for you but not for me? Maybe it's because I use pop3; Imap isn't reliable enough. Also I do not use the Sent folder. :)

I need to do some testing...

hmm that's strange, I checked the code and it's definitely there in the overlay:

sorry, forget that one. the F9 works but only if not in a Themenbaum tab as that seems to be somehow the result of a search.

"if not in a Themenbaum tab" - I am confused :) there is a mode called "3-pane" window which is always the first tab in Thunderbird (it cannot be moved to a different position) - with that you can use F8 and F9 to toggle away folder tree (themenbaum) and preview (Vorschau). Then there are single message tabs (when you double-click an email). You also get a fresh "3-pane" tab if you open a folder in a new tab:

image

You seem to be using something else, "not 3 pane" tab with a list of emails - how do you get there? :)

FrankMittelbach commented 4 years ago

A screenshot of your folder tree and which node is selected would be super helpful. I thought you meant stuff in Sent (or another folder lower in the tree) plus your inbox. And (AFAIK) that's only possible with a virtual / search folder.

just moved one of your replies into the Sent folder (which is called Gesendet) and using Themenbaum it finds it there, so I guess you are mistaken

hmm, why does it work for you but not for me? Maybe it's because I use pop3; Imap isn't reliable enough. Also I do not use the Sent folder. :)

well yes, I use imap usually, so that may be a difference. But I don't understand why.

The Sent folder was just an example because you mentioned that it should not work.

sorry, forget that one. the F9 works but only if not in a Themenbaum tab as that seems to be somehow the result of a search.

"if not in a Themenbaum tab" - I am confused :) there is a mode called "3-pane" window which is always the first tab in Thunderbird (it cannot be moved to a different position) - with that you can use F8 and F9 to toggle away folder tree (themenbaum) and preview (Vorschau).

yes right, that is what I meant. I mistakenly tried it first in the search folder opened by Themenbaum and there the F8/F9 have no effect. But when I use it normal tabs it does. That's way I said, please forget about the F9 it was just a misunderstanding where that works and where it doesn't

You seem to be using something else, "not 3 pane" tab with a list of emails - how do you get there? :)

I use the 3 pane one and from there I get to the search ones by doing this:

Screenshot 2020-01-15 at 16 21 36

which then shows me a search tab even across accounts:

Screenshot 2020-01-15 at 16 22 13
RealRaven2000 commented 4 years ago

"if not in a Themenbaum tab" - I am confused :) there is a mode called "3-pane" window which is always the first tab in Thunderbird (it cannot be moved to a different position) - with that you can use F8 and F9 to toggle away folder tree (themenbaum) and preview (Vorschau).

yes right, that is what I meant. I mistakenly tried it first in the search folder opened by Themenbaum and there the F8/F9 have no effect. But when I use it normal tabs it does. That's way I said, please forget about the F9 it was just a misunderstanding where that works and where it doesn't

You seem to be using something else, "not 3 pane" tab with a list of emails - how do you get there? :)

I use the 3 pane one and from there I get to the search ones by doing this:

Screenshot 2020-01-15 at 16 21 36

which then shows me a search tab even across accounts

AHHH. Now I get it. Bei mir fällt der Groschen heute nur in Pfennigen. I think this is a search folder at heart. Good stuff this means I can finally start reproducing / testing the bug :) 👍👍

RealRaven2000 commented 3 years ago

Ok, I made a nice test case and a fix. One thing I was worried about was if there are mails in different folders (as I only pass one source folder to the copy service); but it seems that it works even if there are some messages in the target folder (no need to move them) most in the source folder and some in a third folder - all get moved as part of the same call with this version:

QuickFolders-wx-5.2pre20.zip

Also, the warning message ("nothing to do") will only happen if all of the mails are already in the target folder.

Test 1) mails from a search: image

2) after dragging this selection to the folder "Egard" via the quickMove button: image

As you can see, the mails from both folder "dev" and "Inbox" were successfully moved to the new location.

FrankMittelbach commented 3 years ago

need to test a bit more, but looks good and so I guess this can be closed - thanks

RealRaven2000 commented 3 years ago

PS: I usually close the issues when I officially release the new version (5.2). But it's ok. I am curently considering to backport this into the trunk branch for my Thunderbird 68 users, too.

FrankMittelbach commented 3 years ago

ok, so you do as we do in LaTeX. In that case I'm happy to leave it open ... process varies and many people do differently, but I'm also a fan to only close when it has been shipped as that seems easier for people to see if they have hit a problem which is still unresolved in the version they have on their machine.

RealRaven2000 commented 3 years ago

Implemented in Releases 5.2 and 4.19.1 (published on 22/01/2021)