RealRaven2000 / quickFilters

Thunderbird Add-on: quickFilters
http://quickfilters.quickfolders.org/
Other
46 stars 11 forks source link

Assistant not opening when using context menu to create filter from message (in local folder) #235

Closed thrust26 closed 2 months ago

thrust26 commented 4 months ago

When I right click on a mail, I get the option to create a filter from that mail. But the dialog does not open anymore.

Old filters are still working, but creating new ones doesn't work anymore. I think this started with 6.3.

RealRaven2000 commented 4 months ago

Are there other Add-ons running as well? Can you please create a debug log to see if there are errors or warnings:

text only console logs are much better and easier to read than screenshots!!

thrust26 commented 4 months ago

Thanks for the quickReply 😏 , I should have asked much earlier.

In quickFilters settings, step 3 doesn't work. Nothing happens with a right click.

BTW: I started to wonder, if quickFilters has changed. I never had quickFolders installed before, it worked without.

No other extensions than quickFilters and QuickFolder (installed a few minutes ago). (BTW: Why is one starting with a lower case 'q' and the other one not?)

So far, when trying to create a filter based on a message I get:


Object { commandItem: {…}, tabId: 1, windowId: 5, messages: {…} }
qFilters-utils.js:762:12
Uncaught (in promise) TypeError: MailServices.accounts.getAccount(...) is null
    folderPathToURI chrome://messenger/content/parent/ext-mail.js:2073
    get chrome://messenger/content/parent/ext-mail.js:2183
    onMenuItemCommand chrome://quickfilters/content/quickFilters.js:936
ext-mail.js:2073:38```
RealRaven2000 commented 4 months ago

So far, when trying to create a filter based on a message I get:

Object { commandItem: {…}, tabId: 1, windowId: 5, messages: {…} }
qFilters-utils.js:762:12
Uncaught (in promise) TypeError: MailServices.accounts.getAccount(...) is null
    folderPathToURI chrome://messenger/content/parent/ext-mail.js:2073
    get chrome://messenger/content/parent/ext-mail.js:2183
    onMenuItemCommand chrome://quickfilters/content/quickFilters.js:936
ext-mail.js:2073:38```

Make sure you have the latest version of Thunderbird installed - that's 115.8.0. it seems one of the Thunderbird APIs fails (ext-mail.js, line 2183) - so this points to a bug in the API or something broken in your profile. I will have to dig in the source code of Thunderbird to tell you more, but this is highly dependant on your version of Thunderbird...

RealRaven2000 commented 4 months ago

https://searchfox.org/comm-esr115/source/mail/components/extensions/parent/ext-mail.js#2182

This is function FolderManager.get() failing, we need to find out why. Apparently the function is only called if the foplder is virtual (a search folder?) - not sure if we can create filters in search folders but I will find out. What we really need is the original folder (account) where the email originated from.

Below is a test version with more diagnostic data, make sure to enable debug mode:

image

Here is the version:

quickFilters-wx-6.3.1pre10.zip

I found that when I try to use it from a search folder I find the following line

quickFilters Fallback to using the  virtual folder
- this may lead to problems determining where to create the filters 
Object { folder: XPCWrappedNative_NoHelper }

Straight after testing I can create a variable "temp0" via right click: image

with the following properties: image

quickFilters-wx-6.3.1pre10.zip


To install version above download zip file and drag the file into Thunderbird Add-ons Manager (do not extract contents, it won't install like that)

my guess is that generating a filter through the new API right-click menu from a virtual folder is currently a gap in the Add-on. But the quickFilters is designed to determine a target folder (and a search folder is no target, because you cannot deliberately add files to a search folder. What is in the search folder gets determined by the parameters of the search and emails will pop up there automatically).

So the question is, what do you expect the new filter to do? Where should it move the emails based on the new filter??

thrust26 commented 4 months ago

Make sure you have the latest version of Thunderbird installed - that's 115.8.0. it seems one of the Thunderbird APIs fails (ext-mail.js, line 2183) - so this points to a bug in the API or something broken in your profile. I will have to dig in the source code of Thunderbird to tell you more, but this is highly dependant on your version of Thunderbird...

I am using 115.8.0 (32-Bit).

thrust26 commented 4 months ago

The pre Version already fixed my problem. 😄

The affected folders are local folders, no search folders.

So the question is, what do you expect the new filter to do? Where should it move the emails based on the new filter??

I usually move one mail into the local target folder and then create a filter based on it.

thrust26 commented 4 months ago

The problem is, I do not get any errors anymore:

BTW: Before the fix, the assistant did not want to open at all. Not only from the context menu.

quickFilters message context menu 
Object { menuItemId: "createFromMailContext", parentMenuItemId: 3, viewType: undefined, editable: false, pageUrl: undefined, selectedMessages: {…}, displayedFolder: {…}, modifiers: [], button: 0 }

Object { id: 1, index: 0, windowId: 5, highlighted: true, active: true, status: "complete", width: 1027, height: 534, cookieStoreId: "firefox-default", spaceId: 1, … }
qFi-background.js:425:17
quickFilters listener_doCommand() 
Object { commandItem: {…}, tabId: 1, windowId: 5, messages: {…} }
qFilters-utils.js:764:12
quickFilters listener_doCommand() 
Object { commandItem: {…}, tabId: 1, windowId: 5, messages: {…} }
qFilters-utils.js:764:12
quickFilters  13:16:32.853  [24437 ms]   
 calling WindowListener.extension.folderManager.get(undefined,undefined)
quickFilters Fallback to using the  virtual folder
- this may lead to problems determining where to create the filters 
Object { folder: XPCWrappedNative_NoHelper }
qFilters-utils.js:764:12
quickFilters  13:16:32.861  [8 ms]   
 calling WindowListener.extension.folderManager.get(undefined,undefined)
quickFilters Fallback to using the  virtual folder
- this may lead to problems determining where to create the filters 
Object { folder: XPCWrappedNative_NoHelper }
qFilters-utils.js:764:12
quickFilters  quickFilters.Init()  
        Assistant active: false
        BrowserInfo: [object Object]
      qFilters-utils.js:764:12
quickFilters  [logTime init]
 remove replyto item from template list...
quickFilters  13:16:33.48  [0 ms]   
 selectTemplateFromListTimer()
RealRaven2000 commented 4 months ago

The affected folders are local folders, no search folders.

So the question is, what do you expect the new filter to do? Where should it move the emails based on the new filter??

I usually move one mail into the local target folder and then create a filter based on it.

Ok, I am still trying to also treat the absolute edge case: a search folder that is stored in local folders and has a result from a message that is stored in a local folder. By the way, (when you used the previous version of quickFilters) this also have affected dragging emails to a local folder with assistant enabled?

See: #218 (which I wasn't able to reproduce on my system)

thrust26 commented 4 months ago

Ok, I am still trying to also treat the absolute edge case: a search folder that is stored in local folders and has a result from a message that is stored in a local folder. By the way, (when you used the previous version of quickFilters) this also have affected dragging emails to a local folder with assistant enabled?

See: #218 (which I wasn't able to reproduce on my system)

Yes. I cannot remember that this ever worked for me (could be wrong here).

RealRaven2000 commented 4 months ago

OK, new test version:

quickFilters-wx-6.3.1pre13.zip

this will determine the original source folder (when the message has no account key stored) via default identities of your mail boxes, doing the following steps:

iterate all accounts and remember emails for default identites. try to match recipients of the message (if it finds one of your emails in there, it will assume it comes from the mailbox) if no matching recipient is found, try to match the sender (if it matches with one of the default identities, it assumes it was sent from that account, so this is the new source folder).

Only if all of the above steps fail (still possible if an email alias was used) the whole filter creation may still fail. but it's already a lot more robust:

quickFilters-wx-6.3.1pre13.zip

it still fails when the current folder (where the user clicks create filter from message) is a search folder, which I am going to tackle next.


To install version above download zip file and drag the file into Thunderbird Add-ons Manager (do not extract contents, it won't install like that)

thrust26 commented 4 months ago

What do you want me to do with that version?

RealRaven2000 commented 4 months ago

What do you want me to do with that version?

if you could install it, (zip file into Tb Addons Manager) see if the assistant opens. If it doesn't you could make an error log, see instructions here: https://quickfilters.quickfolders.org/bugs.html

thrust26 commented 4 months ago

It opens. Anything else I should try?

RealRaven2000 commented 4 months ago

It opens. Anything else I should try?

cool, that's alright, so it appears that the last version fixed it, I will ship a new version soon. Will close out the relevant issues once it is officially released at ATN.

RealRaven2000 commented 2 months ago

Fixed in 6.4 - Published 11/04/2024