kewisch / quickmove-extension

Quick Folder Move Add-on for Thunderbird
88 stars 26 forks source link

Uncaught Exception - Folders not listed #180

Open jkbrinso opened 1 month ago

jkbrinso commented 1 month ago

When attempting to use QuickMove the following message appears in the debug console:

Uncaught (in promise) TypeError: folder is undefined getSortKey moz-extension://cf9e7303-e924-4851-9bc1-6aa39312ba0f/common/foldernode.js:81 sorter moz-extension://cf9e7303-e924-4851-9bc1-6aa39312ba0f/common/foldernode.js:101 walk moz-extension://cf9e7303-e924-4851-9bc1-6aa39312ba0f/common/foldernode.js:35 walk moz-extension://cf9e7303-e924-4851-9bc1-6aa39312ba0f/common/foldernode.js:39 folders moz-extension://cf9e7303-e924-4851-9bc1-6aa39312ba0f/popup/popup.js:90 load moz-extension://cf9e7303-e924-4851-9bc1-6aa39312ba0f/popup/popup.js:90 async* moz-extension://cf9e7303-e924-4851-9bc1-6aa39312ba0f/popup/popup.js:194 foldernode.js:81:5

It had been working OK, but the problem appeared within the last few weeks. I am able to pull up the Quick Move dialog with the shortcut key or clicking the Quick Move button. The dialog has buttons for Move, Copy, Goto, and Tag, followed by two blank text fields that I can type in but which do not do anything noticeable.

The problem occurs regardless of whether, in the settings, I choose "Recent Folders", "All folder", or "Specific Folders." The error also appears in the console when I am on the settings window, and the space under the Recent, All, and Specific folders options is blank.

I am using:

There was an issue with Owl and Exchange Folders and Quick Move a while back, but that issue was resolved and things were working fine.

Thanks!

jkbrinso commented 1 month ago

Update: I can confirm that when Owl is disabled, Quick Move works again. So it obviously has something to do with the Exchange folders.

kewisch commented 4 weeks ago

Not the first owl-related issue I've seen, unfortuantely. I'm not sure when I'll get to this since I don't have an owl to reproduce, but it might be easy to figure out without. Can you confirm you are using quick folder move 2.9.2 ?

jkbrinso commented 3 weeks ago

Not the first owl-related issue I've seen, unfortuantely. I'm not sure when I'll get to this since I don't have an owl to reproduce, but it might be easy to figure out without. Can you confirm you are using quick folder move 2.9.2 ?

Yes, version 2.9.2. I appreciate your time working on this very much, as your extension has been very useful. If you need me to do or try anything to help you track it down, I would be glad to. I am not a javascript guy, but I will do my best.

rigow commented 3 weeks ago

TB 128.3.3esr with QM 2.9.2 it cannot find certain folders. On opening Quick Move displays certain folders, but not others. The quick move selection dialog shows 20 of over a hundred folders. When filtering (dynamic by typing the first letters) the desired folder does not appear. I have no error message in the TB error console.

kewisch commented 1 week ago

@rigow are you getting the same exception as here? Otherwise this might be a different issue. Though please check if the folders you are searching for are marked archive folders or some other set of folders excluded.

@jkbrinso Do you maybe have a way to get me test access to an exchange server? I don't have one so it is hard to figure out what to do.

Here is a version that has some more logging. It doesn't try to work around the error yet, because those items being null should not happen and I'd rather find the root cause.

Look out for log messages with "NULL FOLDER ENCOUNTERED" which should appear near the exception. Also look out for "ADD NODE" or "SET ACCOUNT ITEM" where it says null at the end.

quick_folder_move-2.9.3pre.zip

jkbrinso commented 5 days ago

@kewisch Thanks so much for spending some time on this.

I cannot give you test access.

I installed the pre-release version provided and looked at the console. Here is what I see:

Note: I do not have any other accounts or folders that I am aware of that are not successfully processed. It looks like it is successfully ADD NODEing all the folders I actually have.

Here is a dump of the last few entries in the console:

SET ACCOUNT ITEM Object { id: "account2", name: "Local Folders", type: "none", rootFolder: {…}, identities: [], folders: (3) […] } foldernode.js:167:13

ADD NODE /Trash ->
Object { id: "account2://Trash", name: "Trash", path: "/Trash", specialUse: (1) […], isFavorite: false, isRoot: false, isTag: false, isUnified: false, isVirtual: false, accountId: "account2", … } foldernode.js:119:13

ADD NODE /Unsent Messages ->
Object { id: "account2://Unsent Messages", name: "Outbox", path: "/Unsent Messages", specialUse: (1) […], isFavorite: false, isRoot: false, isTag: false, isUnified: false, isVirtual: false, accountId: "account2", … } foldernode.js:119:13

ADD NODE /Temp ->
Object { id: "account2://Temp", name: "Temp", path: "/Temp", specialUse: [], isFavorite: false, isRoot: false, isTag: false, isUnified: false, isVirtual: false, accountId: "account2", … } foldernode.js:119:13

NULL FOLDER ENCOUNTERED Object { parent: {…}, skipArchive: true, _children: {…} } Object { parent: {…}, skipArchive: true, _children: {…}, item: {…} } foldernode.js:106:15

Uncaught (in promise) TypeError: folder is undefined getSortKey moz-extension://3a493275-ef89-4c14-972a-e9b1cbb00de1/common/foldernode.js:82 sorter moz-extension://3a493275-ef89-4c14-972a-e9b1cbb00de1/common/foldernode.js:109 walk moz-extension://3a493275-ef89-4c14-972a-e9b1cbb00de1/common/foldernode.js:35 walk moz-extension://3a493275-ef89-4c14-972a-e9b1cbb00de1/common/foldernode.js:39 folders moz-extension://3a493275-ef89-4c14-972a-e9b1cbb00de1/popup/popup.js:93 load moz-extension://3a493275-ef89-4c14-972a-e9b1cbb00de1/popup/popup.js:93 async* moz-extension://3a493275-ef89-4c14-972a-e9b1cbb00de1/popup/popup.js:197 foldernode.js:82:5

Promise rejected after context unloaded: Actor 'Conduits' destroyed before query 'RuntimeMessage' was resolved popup.js:165 unload moz-extension://3a493275-ef89-4c14-972a-e9b1cbb00de1/popup/popup.js:165

kewisch commented 3 days ago

NULL FOLDER ENCOUNTERED Object { parent: {…}, skipArchive: true, _children: {…} } Object { parent: {…}, skipArchive: true, _children: {…}, item: {…} } foldernode.js:106:15

If in the second Object row you expand the item, which folder is that? And if the Object in the first folder has _children, can you infer which folder that should be? Normally that first row should also have an item property, so trying to see why it didn't get one.

Also can you go through the whole ADD NODE list and see if there is one with a null at the end? I really don't see a code path where item is not set, but it seems there must be one.

jkbrinso commented 2 days ago

Maybe this is the result of me being clueless, "item:{...}" does not expand. It looks like it would, but clicking on it does nothing. Right-clicking on it brings up context menu choices, none of which are expand or any variation thereof. I can "copy all messages" and paste them into a text editor, but when I do that, it's still just curly braces and dots.

I went through the ADD NODE list and I could not find one with "null" at the end. I also did a text search for null on the entire body of messages, and the only time the word "null" appears is in the message "NULL FOLDER ENCOUNTERED" referenced above in this thread. Here are some typical entries, and basically they all look like this:

ADD NODE /Inbox ->
Object { id: "account4://Inbox", name: "Inbox", path: "/Inbox", specialUse: (2) […], isFavorite: false, isRoot: false, isTag: false, isUnified: false, isVirtual: false, accountId: "account4", … }

ADD NODE /Inbox/Todo ->
Object { id: "account4://Inbox/Todo", name: "Todo", path: "/Inbox/Todo", specialUse: [], isFavorite: false, isRoot: false, isTag: false, isUnified: false, isVirtual: false, accountId: "account4", … }

The "..." at the end appears as an underscore in the browser toolbox "_", not as "...", but that could be my 45 year old eyes starting to go.

I also looked through all the ADD NODE entries to see if anything looked amiss, and the only thing that appears even slightly amiss (but not unexpected) is that the id of longer folder names is truncated with a code.

Thanks again for your efforts to resolve this.

kewisch commented 2 days ago

No, the expansion thing is likely a bug in Thunderbird, or simply because the console can't access that context any more once the popup closes. I might need to expand the logging a bit, will get back to you.

kewisch commented 1 day ago

quick_folder_move-2.9.3pre.zip

Moar debugging. It should now tell you the parent item with the path as well as some info about the children so you can identify the folder that is failing. Let me know which folder this is (I don't care about the name unless it has uncommon characters, but type and other things might be useful). If you are planning to fix it by potentially deleting an unneeded folder please hold up, I'd like to verify a fix before we lose the reproducible situation :)