protz / Manually-Sort-Folders

An extension for Thunderbird 3.0+ that allows you to sort folders in the folder pane.
http://www.xulforum.org/go_code
Other
134 stars 24 forks source link

Folders sometimes not sorted after restarting TB #134

Closed Frank-Steiner closed 3 years ago

Frank-Steiner commented 3 years ago

Hi, on every maybe 5-6th restart, the folders are no longer sorted but reverted to alphabetical order. Going to "Tools -> Manually sort folder" and then just clicking the "Close" button of the settings window is enough to restore the ordering. Just like a listener event was missed when starting TB... This is for TB 68.12.0 with the stable 2.0.5 release.

cu, Frank

itagagaki commented 3 years ago

Hi @Frank-Steiner , I tried to reproduce it several times, but I couldn't reproduce it. It's hard to do. If you reproduce the issue, use Ctrl-Shift-I to invoke the debugger and tell us what's in Console, maybe it will help us to investigate.

Itagaki

L-Space-Traveler commented 3 years ago

Mine does the same. I'm not positive, but I believe it occurs after an entire pc shutdown and restart - just restarting the program, it seems to retain the settings. I'll need to test that more to see. I have been opening the "manually sort folders" extension and clicking "refresh folder pane" - it holds all the correct settings, they just don't seem to get applied automatically anymore when the program is opened. This is necessary for me on Linux Mint 20 (Cinnamon) running TB 68.10.0, and on Windows 10 w/TB 78.4.0.

Frank-Steiner commented 3 years ago

I had this feeling, too, but couldn't reproduce it in a quick test (currently not rebooting my two computers at all due to long-running processes). I had quite a few times when I reported it, and most of the times it was when I had logged out and logged in into the GUI again, but this was also not reproducible when I tried. That happened especially on my remote host using NX, so there was always some hours or 1-2 days between the logins. Maybe it happens if the last access to the TB profile has been a while ago... I'll try to watch this.

L-Space-Traveler commented 3 years ago

I don't know if that "last access" might refer to a new login or just on-going use - I pretty much stay logged in almost all the time, except when I restart my computer, which really isn't at regular intervals. But I'm going to start paying attention now to all of these factors and see if I can help narrow it down. I've also never tried just opening and closing the "sort folders" extension window without actually clicking "refresh" (it sounded like you said this is what you do) - I'll try that, too, next time and see if I'm doing more than I need to.

L-Space-Traveler commented 3 years ago

Well, I don't know if this will be useful or not: I just had to do a hard reboot of my system, something that I have unfortunately had to do several times over the past week or so (been having some issues w/a new system). I thought that perhaps that was the trigger, but my folders came back just as I'd left them. I restarted TB: fine again. I restarted the entire computer (properly): again, folders came back fine.

L-Space-Traveler commented 3 years ago

Well, I don't know if this will be useful or not: I just had to do a hard reboot of my system, something that I have unfortunately had to do several times over the past week or so (been having some issues w/a new system). I thought that perhaps that was the trigger, but my folders came back just as I'd left them. I restarted TB: fine again. I restarted the entire computer (properly): again, folders came back fine.

L-Space-Traveler commented 3 years ago

Again, don't know whether it's helpful: when I had to do another hard reboot tonight, not only did my folders come back unsorted, but my tabs that were open also came back out of order. Opening and closing the extension without clicking "refresh" did re-sort my folders correctly. (I didn't think to see if it would affect the tabs until after I had moved them. I'm pretty sure it doesn't, but I'll check next time.)

Frank-Steiner commented 3 years ago

Maybe you can check the console messages next time the folders are unsorted before doing anything else, to see if there are messages related to the extension.

@Itagaki: Could this perhaps be some kind of race condition when the startup takes somewhat longer or has to more stuff to do (like after a hard reboot/unclean exit of TB), so that the folder sort command is coming to early and gets overwritten by the default?

itagagaki commented 3 years ago

@Frank-Steiner Sorry, I'm not sure if that's a possibility or not.

@protz Could this issue be caused by the fix https://github.com/protz/Manually-Sort-Folders/commit/289aa6cac30d9d3b6fec20957d523957d280d900 ? I believe this fix was made to avoid the issue of exception in TB 78.0. However, in the latest version of TB 78.4.2, reverting this fix did not cause any issues. So we may need to rethink this fix.

itagagaki commented 3 years ago

Oops, TB 78.4.2 also caused an exception. I think we'll have to figure out another way to refresh pane at startup.

L-Space-Traveler commented 3 years ago

Ok - I had to go out this afternoon, and when I got home, my folders and tabs are all out of order from where I left them - but, as far as I know, the program hasn't been restarted. I haven't moved anything back, yet - specifically, what should I do to obtain any useful information about this?

itagagaki commented 3 years ago

@L-Space-Traveler : It would be helpful if you could follow the steps below.

  1. On TB, press Ctrl + Shift + I
  2. Two windows will pop up. Press OK in "Incomming Connection" window.
  3. The other window is the debug window. Select its Console tab.
  4. Select whole texts and copy it, then show us it. Like as follows.

[Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIXPCComponents_Utils.readUTF8URI]" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: resource://gre/modules/L10nRegistry.jsm :: L10nRegistry.loadSync :: line 658" data: no] L10nRegistry.jsm:658:19 Successfully loaded OpenPGP library rnp.dll from C:\Program Files\Mozilla Thunderbird\rnp.dll RNPLib.jsm:49:13 RNPLib.createInputFromPath failed for J:\Users\ita\Documents\Thunderbird\pubring.gpg - Win error 2 during operation open on file J:\Users\ita\Documents\Thunderbird\pubring.gpg (指定されたファイルが見つかりません。

) RNPLib.jsm:141:17 RNPLib.createInputFromPath failed for J:\Users\ita\Documents\Thunderbird\secring.gpg - Win error 2 during operation open on file J:\Users\ita\Documents\Thunderbird\secring.gpg (指定されたファイルが見つかりません。

) RNPLib.jsm:141:17 public keys: 0, secret keys: 0 RNPLib.jsm:264:15 [Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIXPCComponents_Utils.readUTF8URI]" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: resource://gre/modules/L10nRegistry.jsm :: L10nRegistry.loadSync :: line 658" data: no] L10nRegistry.jsm:658:19 [Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIXPCComponents_Utils.readUTF8URI]" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: resource://gre/modules/L10nRegistry.jsm :: L10nRegistry.loadSync :: line 658" data: no] L10nRegistry.jsm:658:19 [Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIXPCComponents_Utils.readUTF8URI]" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: resource://gre/modules/L10nRegistry.jsm :: L10nRegistry.loadSync :: line 658" data: no] L10nRegistry.jsm:658:19 [Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIXPCComponents_Utils.readUTF8URI]" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: resource://gre/modules/L10nRegistry.jsm :: L10nRegistry.loadSync :: line 658" data: no] L10nRegistry.jsm:658:19 1605153161592 tbsortfolders.folderPane DEBUG Init 1605153161592 tbsortfolders.folderPane DEBUG Add observer Successfully loaded OTR library libotr-5.dll from C:\Program Files\Mozilla Thunderbird\libotr-5.dll OTRLib.jsm:43:13 OverrideError: An entry font-size-label of type message is already defined in this bundle OverrideError: An entry window-close-key of type message is already defined in this bundle OverrideError: An entry startup-label of type message is already defined in this bundle OverrideError: An entry focus-search-shortcut of type message is already defined in this bundle OverrideError: An entry close-button of type message is already defined in this bundle OverrideError: An entry font-size-label of type message is already defined in this bundle OverrideError: An entry window-close-key of type message is already defined in this bundle OverrideError: An entry startup-label of type message is already defined in this bundle OverrideError: An entry focus-search-shortcut of type message is already defined in this bundle OverrideError: An entry close-button of type message is already defined in this bundle [Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIXPCComponents_Utils.readUTF8URI]" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: resource://gre/modules/L10nRegistry.jsm :: L10nRegistry.loadSync :: line 658" data: no] L10nRegistry.jsm:658:19 [Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIXPCComponents_Utils.readUTF8URI]" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: resource://gre/modules/L10nRegistry.jsm :: L10nRegistry.loadSync :: line 658" data: no] L10nRegistry.jsm:658:19 NotSupportedError: CustomElementRegistry.define: 'conversation-browser' has already been defined as a custom element conversation-browser.js:853 Empty string passed to getElementById(). browser-custom-element.js:411:22

L-Space-Traveler commented 3 years ago

WebExtensions: Loading packed extension from /home/karena/.thunderbird/8umkjrig.default/extensions/quickfolders@curious.be.xpi ext-legacy.js:157 WebExtensions: Loading packed extension from /usr/lib/thunderbird/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}.xpi ext-legacy.js:157 Ignoring unrecognized chrome manifest directive 'overlay'. chrome.manifest:31 Ignoring unrecognized chrome manifest directive 'overlay'. chrome.manifest:32 Ignoring unrecognized chrome manifest directive 'overlay'. chrome.manifest:33 Ignoring unrecognized chrome manifest directive 'overlay'. chrome.manifest:34 Ignoring unrecognized chrome manifest directive 'overlay'. chrome.manifest:35 Ignoring unrecognized chrome manifest directive 'overlay'. chrome.manifest:36 Ignoring unrecognized chrome manifest directive 'overlay'. chrome.manifest:37 Ignoring unrecognized chrome manifest directive 'overlay'. chrome.manifest:38 Ignoring unrecognized chrome manifest directive 'overlay'. chrome.manifest:39 Ignoring unrecognized chrome manifest directive 'overlay'. chrome.manifest:40 Ignoring unrecognized chrome manifest directive 'style'. chrome.manifest:53 Ignoring unrecognized chrome manifest directive 'style'. chrome.manifest:54 Ignoring unrecognized chrome manifest directive 'style'. chrome.manifest:55 Ignoring unrecognized chrome manifest directive 'style'. chrome.manifest:56 Ignoring unrecognized chrome manifest directive 'style'. chrome.manifest:57 Ignoring unrecognized chrome manifest directive 'style'. chrome.manifest:58 Ignoring unrecognized chrome manifest directive 'style'. chrome.manifest:59 Ignoring unrecognized chrome manifest directive 'style'. chrome.manifest:60 Ignoring unrecognized chrome manifest directive 'style'. chrome.manifest:61 WebExtensions: Loading add-on preferences from /home/karena/.thunderbird/8umkjrig.default/extensions/quickfolders@curious.be.xpi ext-legacy.js:190 WebExtensions: Firing profile-after-change listeners for quickfolders@curious.be ext-legacy.js:194 1605129742144 tbsortfolders.folderPane DEBUG Init 1605129742144 tbsortfolders.folderPane DEBUG Add observer WebExtensions: Loading add-on preferences from /usr/lib/thunderbird/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}.xpi ext-legacy.js:190 WebExtensions: Firing profile-after-change listeners for {e2fda1a4-762b-4020-b5ad-a41df1933103} ext-legacy.js:194 Use of Mutation Events is deprecated. Use MutationObserver instead. calendar-views.js:97:9 DebuggeeWouldRun: debuggee `resource://devtools/shared/base-loader.js:383' would run builtin-modules.js:221:11

itagagaki commented 3 years ago

@L-Space-Traveler Thanks for the log. Hmm, I don't see any problems with this log. Maybe we developers/contributors need to rethink how to refresh the pane at startup.

L-Space-Traveler commented 3 years ago

Would it be useful for me to refresh the folders and re-post the log?

itagagaki commented 3 years ago

@L-Space-Traveler No, you don't have to. Thank you.

Frank-Steiner commented 3 years ago

Now I got the problem, too, after just exiting and restarting TB cleanly. Console shows nothing but

1605527238495 tbsortfolders.folderPane DEBUG Init 1605527238495 tbsortfolders.folderPane DEBUG Add observer

Opening the config window for folders sort didn't change it, closing it without any settings restored the order. It was interesting that many debug messages appeared when opening the config window, but when I closed it and the order was restored there was no new message about activating or refreshing. Maybe that was done after opening and the GUI was just blocked by the config window so the refresh wasn't visible...

itagagaki commented 3 years ago

I made a fix that might solve this issue. @protz Please handle the pull request from me.

protz commented 3 years ago

Could anyone on this thread try out #136 and figure out whether it helps?

Frank-Steiner commented 3 years ago

Sorry, forgot to report back. I haven't seen the problem again after applying it in December, so, yes, I guess it helps!

itagagaki commented 3 years ago

@Frank-Steiner That's good to know! Thanks!

itagagaki commented 3 years ago

It seems to have been solved in #136 , so I've merged this in. Therefore, the next release will include this fix. Thank you all for your reports. I will close this issue.