Skip to content

Drag'n'drop issue in TB 85 beta #96

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

Closed
alexweirig opened this issue Jan 7, 2021 · 10 comments
Closed

Drag'n'drop issue in TB 85 beta #96

alexweirig opened this issue Jan 7, 2021 · 10 comments

Comments

@alexweirig
Copy link

Hello,

I've installed QuickFolders 5.1 (December 13, 2020) in TB 85 (currently beta 3).

QF is showing up correctly, menus are working etc but I don't do a drag'n'drop of a message e.g. in my inbox into a folder in the quickfolder bar.
Moving the message into the folder in the folders pane works fine.

Thanks

Alex

@RealRaven2000
Copy link
Owner

RealRaven2000 commented Jan 7, 2021

Thanks for flagging this. I haven't got time to test with the latest betas just yet, and it may be a wasted time effort if we do not know whether experiments will be allowed in ESR88. If you can, post a console log anyway.

  1. open JS error console (through Ctrl+Shift+J or tools / dev tools / erropr console)
  2. reset contents
    image
  3. do the drag+drop
  4. right-click in the console output and select "Export visible Messages to / Clipboard" (or file)
    image
    hopefully you will see an exception or a warning amongst the messages there

For additional info you can enable QF debug mode in QuickFolders Settings / advanced (bottom left) - this will add more context to the error

PS: flagged as regression for Tb88 as that's the target for the next ESR. So until then (September / October 2021) my main focus is on keeping the Add-on working with 78.* (the current ESR period). That's why I can never guarantee that betas may be working - they are for the core developers experimenting / trying out stuff... I can't even know whether the next ESR will allow Add-ons to do Drag+Drop listeners, as there are no APIs at the moment. It's all low level hacky stuff.

@alexweirig
Copy link
Author

alexweirig commented Jan 7, 2021

Hi, thank you very much for your quick answer.

I had to upgrade to a later version of TB because the GA version is totally unusable in macOS since scrolling in the folders is awfully slow and just jumping around.

There is indeed an exception shown (without debug mode):

toolbarDragObserver:DnD 5 quickfolders.js:982:12
QuickFolders 14:19:33.359  [21524619 ms]	 
Exception in QuickFolders.Util.moveMessages, step 7:
[Exception... "Cannot convert JavaScript object into an array arg 1 [nsIMsgCopyService.CopyMessages]"  nsresult: "0x80570023 (NS_ERROR_XPC_CANT_CONVERT_OBJECT_TO_ARRAY)"  location: "JS frame :: chrome://quickfolders/content/quickfolders-util.js :: moveMessages :: line 845"  data: no]
An iframe which has both allow-top-navigation and allow-top-navigation-by-user-activation for its sandbox attribute will permit top navigations. INBOX>356429
GEThttps://github.com/notifications/beacon/AA5SJFID2V5E46LW7LECDYDSYWN6TA5CNFSM4VYSRNX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFUILO4I.gif
[HTTP/1.1 304 Not Modified 165ms]

Some cookies are misusing the recommended “SameSite“ attribute 2

With debug mode in QF enabled:

An iframe which has both allow-top-navigation and allow-top-navigation-by-user-activation for its sandbox attribute will permit top navigations. INBOX>356432
toolbarDragObserver:DnD 3 quickfolders.js:982:12
QuickFolders 14:24:41.114  [16299 ms]	 
Exception in QuickFolders.Util.moveMessages, step 7:
[Exception... "Cannot convert JavaScript object into an array arg 1 [nsIMsgCopyService.CopyMessages]"  nsresult: "0x80570023 (NS_ERROR_XPC_CANT_CONVERT_OBJECT_TO_ARRAY)"  location: "JS frame :: chrome://quickfolders/content/quickfolders-util.js :: moveMessages :: line 845"  data: no]
QuickFolders 14:24:41.114  [0 ms]	 
buttonDragObserver.drop DropTarget = toolbarbutton0  Target Folder:Enseignants

Hope this helps

Alex

@RealRaven2000
Copy link
Owner

Exception in QuickFolders.Util.moveMessages, step 7:
[Exception... "Cannot convert JavaScript object into an array arg 1 [nsIMsgCopyService.CopyMessages]"  nsresult: "0x80570023 (NS_ERROR_XPC_CANT_CONVERT_OBJECT_TO_ARRAY)"  location: "JS frame :: chrome://quickfolders/content/quickfolders-util.js :: moveMessages :: line 845"  data: no]

Looke like they changed the interface nsIMsgCopyService - it's likely that Add-ons will not get direct access to that in web extensions, so we gotta look for a way to do it with an API function. This may or may not yet exist.

I will investigate in how far I could replace usage with this one:
https://thunderbird-webextensions.readthedocs.io/en/78/messages.html#copy-messageids-destination

  • that would be my first excursion into using proper API programming; out of many 10,000s of lines of native code, guess one has to start somewhere.

@alexweirig
Copy link
Author

Sorry for that.

If you need somebody to test, let me know.

@RealRaven2000
Copy link
Owner

So I did some morfe research, the change set for 85.0a1 changes the call parameter for CopyMessages from
nsIArray to Array<nsIMsgDBHdr> :
https://hg.mozilla.org/comm-central/file/fe318ec033d4/mail/config/version.txt

The only feasible way to code around it at the moment is by checking the Thunderbird version number and building the array differently for the newer case. (maybe from 85.* forward)

@RealRaven2000
Copy link
Owner

In the light of my last comment, here is a version which just fixes the one single thing (copying messages) but I think there are quite a few problems with localisation (I see a ton of error messages related to nsIStringBundle.GetStringFromName)

QuickFolders-wx-5.2pre19.zip

so if you are using the English version you're probably not so much affected. God knows what else may be broken in Tb85 though!

@alexweirig
Copy link
Author

Hi,

drag'n'drop works again. I'll keep an eye on the version if I see other problems.

But thank you so much for the quick release of this fixed version.

Watch your paypal account.

@RealRaven2000
Copy link
Owner

RealRaven2000 commented Jan 14, 2021

drag'n'drop works again. I'll keep an eye on the version if I see other problems.

But thank you so much for the quick release of this fixed version.

Watch your paypal account.

Good news - thanks, I got your donation! Should probably have looked in detail a little earlier, the folks at tb-addon-developers were helpful in finding when the Thunderbird Core patch happened. And let me return to my old method of "check the Application Version before you try something". Very likely I am gonna have to copy this to my Add-ons quickFilters and maybe SmartTemplates, so some added value there. Might even put the maxver for my Add-ons up to 85.* generally, so I catch this stuff early on and don't have so much fallout in September/ October!

@RealRaven2000
Copy link
Owner

Fixed in Release 5.2 (published on 22/01/2021)

@alexweirig
Copy link
Author

Thank you, everything looks great so far.

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

No branches or pull requests

2 participants