Closed Bug 1594707 Opened 5 years ago Closed 5 years ago

The messages query fails with "aFolder is null" for folders whose paths contain parentheses

Categories

(Thunderbird :: Add-Ons: Extensions API, defect)

defect
Not set
normal

Tracking

(thunderbird_esr6871+ fixed, thunderbird71 fixed, thunderbird72 fixed)

RESOLVED FIXED
Thunderbird 72.0
Tracking Status
thunderbird_esr68 71+ fixed
thunderbird71 --- fixed
thunderbird72 --- fixed

People

(Reporter: mihaicodrean, Assigned: darktrojan)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0

Steps to reproduce:

Used the WebExtensions "messages.query" API on a folder whose path contains parentheses, e.g. "My Folder (2)".

Actual results:

aFolder is null datastore.js:2214
_mapFolder resource:///modules/gloda/datastore.js:2214
toParamAndValue resource:///modules/gloda/gloda.js:1329
_convertToDBValuesAndGroupByAttributeID resource:///modules/gloda/datastore.js:3469
next self-hosted:1105
queryFromQuery resource:///modules/gloda/datastore.js:3689
getCollection resource:///modules/gloda/query.js:115
collectionArray chrome://messenger/content/parent/ext-messages.js:194
query chrome://messenger/content/parent/ext-messages.js:193
query self-hosted:869
result resource://gre/modules/ExtensionParent.jsm:1114
withPendingBrowser resource://gre/modules/ExtensionParent.jsm:725
result resource://gre/modules/ExtensionParent.jsm:1114
callAndLog resource://gre/modules/ExtensionParent.jsm:1073
call resource://gre/modules/ExtensionParent.jsm:1113
AsyncFunctionNext self-hosted:689

Expected results:

The search should have worked, just as it does with other folders, like "My Folder".

Flags: needinfo?(geoff)

This is basically bug 1588391 all over again. The folder's URI has encoded brackets, decodeURIComponent decodes the brackets, but encodeURIComponent doesn't encode them, because it isn't RFC 3986 compliant (according to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent anyway).

Flags: needinfo?(geoff)
Assignee: nobody → geoff
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #9107770 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9107770 [details] [diff] [review] 1594707-encode-characters-1.diff Review of attachment 9107770 [details] [diff] [review]: ----------------------------------------------------------------- Looks alright to me, r=mkmelin
Attachment #9107770 - Flags: review?(mkmelin+mozilla) → review+

Geoff, please request uplift as needed.

Attachment #9107770 - Flags: approval-comm-esr68?
Attachment #9107770 - Flags: approval-comm-beta?

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/46a75a66d88d
In WebExtensions folder lookup, encode characters !'()* which aren't handled by encodeURIComponent. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 72.0
Attachment #9107770 - Flags: approval-comm-beta? → approval-comm-beta+
Attachment #9107770 - Flags: approval-comm-esr68? → approval-comm-esr68+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: