jobisoft / quicktext

An extension for Thunderbird that lets you create templates that can be easily inserted into your own emails.
Mozilla Public License 2.0
184 stars 52 forks source link

Template that stopped working with Thunderbird Supernova Version 115.2.2 #379

Closed informas closed 11 months ago

informas commented 11 months ago

Until a few days ago, I had the following template working, the purpose of which was that when forwarding an email, I could add (at the beginning of the email) certain data from the original email.

[[SCRIPT=RemoveRecipients|all]]
[[SCRIPT=AddRecipients|to|myemail@mydomain.com]]

Received From:
[[ORGHEADER=received|\n\n]]

Desde:
[[ORGHEADER=from|\n]]

To:
TO:[[ORGHEADER=to]]
CC:[[ORGHEADER=cc]]
BCC:[[ORGHEADER=cco]]

To (by GetRecipients):
[[SCRIPT=GetRecipients]]

Subject:
[[ORGHEADER=subject|\n]]

Date: [[ORGHEADER=date]]

After updating Thunderbird Version 115.2.2 (Supernova) it stopped working for me.

Now when I selects the template from the QuickText menu, the first time I invoke it, only the "To" field is filled with the indicated value, but nothing is written in the body of the email.

If I call it a second time it inserts the template but with most of the data in blank.

It is as if the "GetRecipients" Script had not worked or the values for ORGHEADER were not assigned.

The only data that fills in the template on the second attempt is the "To" field, supposedly assigned on the first attempt.

And what is inserted in the body of the email is.

Received From:

From:

To:
TO:
DC:
CCO:

To (by GetRecipients):
To: myemail@mydomain.com

Subject:

Date:

Is this a bug or incompatibility with the new version of Thunderbird? Any suggestions on how to solve the problem?

Thanks in advance.

vbowden commented 11 months ago

I now have this issue also after updating to Supernova. It's only happening on templates I've built on HTML.

Heliophob commented 11 months ago

Hello,

My scripts also no longer work after the update. This should, for example, get a number from the subject line:

var subject = this.mQuicktext.get_orgheader(["subject"]); var pattern = /TID#([0-9]{6})/i;
var tid = pattern.exec(subject); if (!tid)
var pattern = /TID#([0-9]{5})/i;
var tid = pattern.exec(subject); if (!tid)
return ""; // gibt nichts zurück else return tid[1]; // gibt die TID zurück

### I get this error when running: In Ihrem Quicktext-Skript ist ein Fehler aufgetreten: TID TypeError: messenger.messageServiceFromURI is not a function Zeile 609: undefined

jobisoft commented 11 months ago

messenger.messageServiceFromURI no longer exists in Thunderbird core. You have to update your script to be compatible with TB115.

Source code is here: https://searchfox.org/comm-central/source/

Looks like it is MailServices.messageServiceFromURI now.

jobisoft commented 11 months ago

I stand corrected, this is in fact a bug in Quicktext. I wrongly assumed the incompatible code was part of your script, sorry.

mejo- commented 11 months ago

I have the same issue with Quicktext in Thunderbird 115.

jobisoft commented 11 months ago

quicktext_5_12.zip Can you check if this version fixes the issue?

Heliophob commented 11 months ago

thank you for your quick support!

Unfortunately, only the error message is suppressed but the scripts (such as reading the subject line, like mine) are still not possible.

mejo- commented 11 months ago

Thanks @jobisoft! For me the same as @Heliophob reported. The error is fixed, but the scripts still don't work anymore. But probably another bug.

I see these logs in the console instead when trying to run the script in question:

[W] unreachable code after return statement [wzQuicktextVar.jsm:644:2](chrome://quicktext/content/modules/wzQuicktextVar.jsm)
[W] unreachable code after return statement [wzQuicktextVar.jsm:608:2](chrome://quicktext/content/modules/wzQuicktextVar.jsm)
[W] unreachable code after return statement [wzQuicktextVar.jsm:644:2](chrome://quicktext/content/modules/wzQuicktextVar.jsm)
[E] NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN: Cannot modify properties of a WrappedNative [wzQuicktextVar.jsm:44](chrome://quicktext/content/modules/wzQuicktextVar.jsm)
    onStartRequest chrome://quicktext/content/modules/wzQuicktextVar.jsm:44
    preprocess_org chrome://quicktext/content/modules/wzQuicktextVar.jsm:1221
    process_orgheader chrome://quicktext/content/modules/wzQuicktextVar.jsm:1167
    get_orgheader chrome://quicktext/content/modules/wzQuicktextVar.jsm:469
    parseText chrome://quicktext/content/modules/wzQuicktextVar.jsm:186
    parse chrome://quicktext/content/modules/wzQuicktextVar.jsm:127
    AsyncFunctionNext self-hosted:852
    (Async: async)
    insertBody chrome://quicktext/content/quicktext.js:511
    insertTemplate chrome://quicktext/content/quicktext.js:351
    AsyncFunctionNext self-hosted:852
    (Async: async)
    windowKeyPress chrome://quicktext/content/quicktext.js:656
    load chrome://quicktext/content/quicktext.js:40
Heliophob commented 11 months ago

I see the following error in the console:

NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN: Cannot modify properties of a WrappedNative wzQuicktextVar.jsm:44 No chrome package registered for chrome://cardbook/content/cardbookRepository.js CURSOR LOG failedSearchAttempts : 1 quicktext.js:609:15

jobisoft commented 11 months ago

Does this work? quicktext_5_14.zip

I had to replace some ancient code with new stuff which may produce different return values for orgatt and orgheader. If it works, please test it for me in depth.

mejo- commented 11 months ago

Wow, the 5.14 version indeed fixes all issues for me. The scripts I have in place all work as expected again. Thanks a lot for the quick fix @jobisoft!

Heliophob commented 11 months ago

Unfortunately the update doesn't help in my case. There is the following error in the console:

No chrome package registered for chrome://cardbook/content/cardbookRepository.js CURSOR LOG failedSearchAttempts : 1 quicktext.js:609:15

[OS = Ubuntu 22.04.3 LTS]

informas commented 11 months ago

Also for me the new version of Quicktext, 5.14 from 10/08/2023 now works correctly. At least with Thunderbird version 115.2.2 64-bit Thank you very much @jobisoft

mejo- commented 11 months ago

@jobisoft do you plan to release version 5.14 to the addon store anytime soon?

jobisoft commented 11 months ago

It is: https://addons.thunderbird.net/addon/quicktext/versions/

vbowden commented 11 months ago

Thanks so much, John! It works perfectly as before. I LOVE this add-on!

Heliophob commented 11 months ago

Is my error still in progress or should I create my own thread?

jobisoft commented 11 months ago

Is my error still in progress or should I create my own thread?

Your error is probably related to CardBook. I assume the error goes away if you disable that extension. I think its author changed an interface which Quicktext was using.

Yes, please create a new issue for that specific error.