Closed Bug 1789589 Opened 5 months ago Closed 5 months ago

FileLink not inserting links when filename includes Unicode characters

Categories

(Thunderbird :: FileLink, defect)

defect

Tracking

(thunderbird_esr102? fixed)

RESOLVED FIXED
106 Branch
Tracking Status
thunderbird_esr102 ? fixed

People

(Reporter: tdulcet, Assigned: TbSync)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(3 files)

Attached image image.png

This bug was first reported to me in a review of my "FileLink provider for Send" add-on. That review was obviously meant for Geoff's "FileLink provider for Dropbox" add-on, but this issue is a Thunderbird regression, so it affects all FileLink add-ons.

The person in the review said they were unable to link files when the filename contains "Polish characters such as ż ą ę". I am able to confirm this regression with both the latest Thunderbird Beta and Daily. It works fine with Thunderbird 91. My add-on successfully uploads the file and returns the link to TB, but it is never added to the e-mail. Instead, I get the attached popup with a rather unhelpful error message and this potentially related error in the error console:

TypeError: PrecompiledScript.executeInGlobal: Argument 1 is not an object. ExtensionContent.jsm:580:25

This may be related to Bug 1786758.

Blocks: tb102found
Keywords: regression

Perhaps from bug 1669829.

Good day!

I have same error in portable version with big size file (i think more than 5 or 10mb). Small file (less 5mb) is work well!

It's uploading but link not insert into message body and error like image in report.
I try it with any FileLink providers.

ps. sorry for my english =)

Attached image image.png

(In reply to Ping Chen (:rnons) from comment #1)

Perhaps from bug 1669829.

Bug 1643729 and Bug 1670791 also included some significant FileLink changes.

I attached a screenshot of the only console error I see in the latest Thunderbird Daily 106 after attempting to link a file with Unicode characters in the filename.

(In reply to Alexander from comment #2)

I have same error in portable version with big size file (i think more than 5 or 10mb). Small file (less 5mb) is work well!

I am not seeing this, as neither small (less than 5 MB) nor bigger files (greater than 25 MB) work for me when the filename includes Unicode characters. Files with all ASCII characters in the filename seem to work as expected regardless of size.

Assignee: nobody → john
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → 106 Branch

Pushed by alessandro@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/62defccbffff
Convert cloudFileUpload to binary string before using btoa(). r=aleca

Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED

Drive-by comment:
https://hg.mozilla.org/comm-central/rev/62defccbffff#l1.18 let binaryString = String.fromCharCode(...utf8Bytes);

Note: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax
Quote: When using spread syntax for function calls, be aware of the possibility of exceeding the JavaScript engine's argument length limit.

Typical use is:
https://searchfox.org/comm-central/search?q=String.fromCharCode.apply%28&path=&case=false&regexp=false

I think apply has the same problem of argument length limit. There is MailStringUtils.jsm.

See Also: → 1790566

It has now been a few weeks since this regression fix was pushed to TB Daily, so can it please be uplifted to TB 102? It is of course a rather serious regression that breaks all FileLink add-ons for many international users.

Comment on attachment 9293910 [details]
Bug 1789589 - Convert cloudFileUpload to binary string before using btoa(). r=#thunderbird-reviewers

[Approval Request Comment]
Regression caused by (bug #):
User impact if declined: Filelink entries are not added to the email, if their filenames include unicode chars.
Testing completed (on c-c, etc.): On BETA for 1 month.
Risk to taking this patch (and alternatives if risky): Simple patch, should be fine.

Attachment #9293910 - Flags: approval-comm-esr102?

Comment on attachment 9293910 [details]
Bug 1789589 - Convert cloudFileUpload to binary string before using btoa(). r=#thunderbird-reviewers

[Triage Comment]
Approved for esr102

Attachment #9293910 - Flags: approval-comm-esr102? → approval-comm-esr102+
You need to log in before you can comment on or make changes to this bug.