RealRaven2000 / QuickFolders

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

Cannot use quickMove to move folders to across accounts anymore (Imap to Local) #237

Open RealRaven2000 opened 2 years ago

RealRaven2000 commented 2 years ago

Apparently from some version of Thunderbird 91 it is not possible to move folders across accounts (e..g from an Imap account to Local)

image

This appears to be dues to changes in the service nsIMsgCopyService function copyFolder()

I presume there must be another internal functiom to do this (possibly without using the service anymore)

RealRaven2000 commented 2 years ago

I will ask the Core Development team next week whether this is something they may have removed, or just stop supporting. My hunch is that they won't undo this change, so my plan is to reimplement using the new folders API:

https://webextension-api.thunderbird.net/en/91/folders.html#move-sourcefolder-destination

challenges: The new code needs to go through the background script. I am currently using the legacy structure nsIMsgFolder I will have to find a way of converting to the new API format type MailFolder. I will ask @jobisoft on tomorrow's Add-on developers call.

RealRaven2000 commented 2 years ago

Relevant conversion step:

https://webextension-api.thunderbird.net/en/91/how-to/experiments.html#using-folder-and-message-types

RealRaven2000 commented 2 years ago

Looks like this problem will also affect the API method - internally it uses the same service. I found this out on the weekly Add-on developers call so I am hoping that @jobisoft can investigate this and maybe create a patch. Hopefully we will see some activity and maybe a bug on bugzilla.mozilla.org to reference from here. If it takes a little longer, should I make a dedicated error message, something like:

"It looks like this function is currently defect, you could copy the folder instead (hold down Ctrl while dragging the folder to the quickMove button) and delete it once you're satisfied that all data has been copied?"

I know this is rather inconvenient, but the only workaround I can thing of currently.

rbhall52 commented 2 years ago

What I have planned to do, if there is no extension that does this, is to create an extension that creates the present folder name in Local folders, then move all messages in the folder that I want to move to Local folders, then delete that folder that now has no messages in it. I'm not trying anything exotic or complicated, just trying to make it easier to move a folder. And I would not try to move a folder that has not been created by the user.

RealRaven2000 commented 2 years ago

What I have planned to do, if there is no extension that does this, is to create an extension that creates the present folder name in Local folders, then move all messages in the folder that I want to move to Local folders, then delete that folder that now has no messages in it. I'm not trying anything exotic or complicated, just trying to make it easier to move a folder. And I would not try to move a folder that has not been created by the user.

Which would be nice in theory, except for the "then move .... and then delete" because you need to know when the moving is done. That's the hard bit. A lot of this stuff now runs asynchronously and is not guaranteed to tell you when it is finished.

jobisoft commented 2 years ago

For the copy to local folder, this is save. The WebExtension copy Promise fulfills once the operation is complete. The copy to IMAP is not so simple. The copy Promise fullfills once the first part is done (send to server, copied locally) but the server could reject the copy operation later (maybe you were offline during the operation, or the server was busy) and than the local copy is removed (to stay in sync with the server). That will happen after you deleted the source message. I am thinking about an option to fulfill the promise only if the server sende the ack.

RealRaven2000 commented 2 years ago

For the copy to local folder, this is save. The WebExtension copy Promise fulfills once the operation is complete. The copy to IMAP is not so simple. The copy Promise fullfills once the first part is done (send to server, copied locally) but the server could reject the copy operation later (maybe you were offline during the operation, or the server was busy) and than the local copy is removed (to stay in sync with the server). That will happen after you deleted the source message. I am thinking about an option to fulfill the promise only if the server sende the ack.

If it can be done via a wx method I would like to implement it that way. I believe we may started some work on converting either mail or folder moving to wx, but I think we hit some road block, then postponed and I never touched it since then.