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

quickMove error in conversation view (with restriction to current mail account) #451

Closed
micz opened this issue Jan 10, 2024 · 11 comments
Closed
Assignees

Comments

@micz
Copy link

micz commented Jan 10, 2024

I'm using Thunderbird 115.6.0 and Quickfolders 6.4.1.
When I open a mail using the "Open in conversation" option, Th opens the mail conversation in a new tab.
If I select one or more mails and I try to QuickMove them I got this error in the log and no folder is shown when I type:

Uncaught (in promise) TypeError: currentFolder is null
    findFolderName chrome://quickfolders/content/quickfolders-interface.js:5317
    oncommand chrome://messenger/content/messenger.xhtml:1
    _fireCommand chrome://global/content/elements/search-textbox.js:229
    _enterSearch chrome://global/content/elements/search-textbox.js:247
    on_keypress chrome://global/content/elements/search-textbox.js:210
    handleEvent chrome://global/content/customElements.js:459
quickfolders-interface.js:5317:13

Once it showed me the folder and Thunderbid crashed when I press return to select it (sadly I have no log for this).

@RealRaven2000 RealRaven2000 self-assigned this Jan 10, 2024
@micz
Copy link
Author

micz commented Mar 18, 2024

Hi Alex,

I tried to debug this, maybe to propose a PR, but I arrived at this line (quickfolders-interface.js line 5317):

if (isLockAccount && fld.server && currentFolder.server && fld.server.key!=currentFolder.server.key) continue;

May you give some hint? A way could be to get the current server without using che currentFolder?
Thanks.

@RealRaven2000
Copy link
Owner

I think it is this:

QuickFolders.quickMove.Settings.isLockInAccount

this is set to true. It means that you can not search across all accounts, it's this quickJump setting:

image

is this option active? Try unchecking it and search again.

@micz
Copy link
Author

micz commented Mar 20, 2024

The option is active, but I need to keep it that way or searching the folder won't be useful.
Maybe there is a way to get the current folder of the selected message?

@RealRaven2000
Copy link
Owner

The option is active, but I need to keep it that way or searching the folder won't be useful. Maybe there is a way to get the current folder of the selected message?

well in that case it will just skip the account (because it isn't currently active). it will only search all folders in the account of the current folder that you are in. The selected message should be in the current account, maybe unless you are in a search folder?

So in the normal case you are looking at mails in the current account / folder (whatever account that may be) and quickJump with the restriction should allow you to move the mails to any other folder with in that account. What are you trying to do?

@micz
Copy link
Author

micz commented Mar 21, 2024

I'm trying to move a mail with Quickmove from a tab in conversation view and I get the error I posted in the first post, and no folder is showing up.
Thanks.

@RealRaven2000
Copy link
Owner

ok, I think I missed that from the heading - to open in a conversation we need to come from a search results tab / dialog at first? I will test that, obviously the emails can be from multiple locations, but the quickMove algorithm should be able to move mails that come from different folders, not sure what would happen with "only show results from current account" as it may be difficult when you have emails from different accounts. because in that case it is not clear what the "current account" should be?

Do you use the conversation view (following from a search result) often? Or is there another way to force it. I am curious about the workflow here.

@RealRaven2000
Copy link
Owner

Can you try the patched version below:

QuickFolders-mx-6.4.2pre23.zip

at least it won't stumble at that line (as there is no "current folder" there is no logical reason for making a restriction, so at least the search can continue)

New code:

        if (excludedServers.includes(fld.server.key)) continue;
	// [issue 451] there is no current folder in conversation view, so we cannot lock search to "current folder" in this case
        if (isLockInAccount &&  fld.server && currentFolder?.server && fld.server.key!=currentFolder.server?.key) continue;
	if (checkFolderFlag(fld, util.ADVANCED_FLAGS.IGNORE_QUICKJUMP, true)) continue; 

To test the version above, download the zip file, drag the file into Thunderbird Add-ons Manager, do not extract contents or if won't install.

@micz
Copy link
Author

micz commented Mar 21, 2024

Now it works, thank you!

This is the workflow: when processing the mails in the inbox, I open in conversation view an email to check the other messages and then I decide in which folder put the email, using quickMove directly from the conversation view.

@RealRaven2000
Copy link
Owner

Now it works, thank you!

This is the workflow: when processing the mails in the inbox, I open in conversation view an email to check the other messages and then I decide in which folder put the email, using quickMove directly from the conversation view. So it appears removing the

See when I tested from an arbitrary folder, I did not see the "Open message in conversation" menu item, maybe it is only in the inbox? I try to keep my inbox empty, which is done mostly by filters that's why I do not spend a lot of time in there. I also considered your suggestion of checking the account(s) of the selected mail(s) but it would get very messy - as the search algorithm currently operates independently on what is selected by quickMove. To restrict results to only show from current account would add a ton of complication do an already complex algorithm. Going to keep the new approach for the next version of QuickFolders (6.4.2 or 6.5 whichever it is going to be).

As always, leaving the issue open until release.

@RealRaven2000 RealRaven2000 changed the title QuickMove error in conversation view quickMove error in conversation view (with restriction to current mail account) Mar 21, 2024
@micz
Copy link
Author

micz commented Mar 21, 2024

In my experience you can use the "Open message in conversation" menu item when the message has been indexed.
I've used the patched version all day and I can confirm it's working. I need to be careful to choose the right folder, since it's not restricted, but it's better than going back to the folder to use quickMove or moving the mail manually.
Thank you!

RealRaven2000 added a commit that referenced this issue Mar 25, 2024
removed error when quick-moving mail from conversation (with account restriction enabled); refactored code
@RealRaven2000
Copy link
Owner

Fixed in 6.5.1 - Published 16/04/2024

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

No branches or pull requests

2 participants