createTag does not accept - and _ in key
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(thunderbird_esr115 fixed, thunderbird119 wontfix)
People
(Reporter: jhh, Assigned: john)
Details
Attachments
(1 file)
|
48 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-esr115+
|
Details | Review |
Steps to reproduce:
I tried to create a new tag using messenger.messages.createTag(key,tag,color) with key="a_tag-thing" and tag "A Tag-Thing" (and color = "#000000").
Actual results:
I get the following error:
Error: Type error for parameter key (String "a_tag-thing" must match /^[$a-zA-Z0-9]+$/) for messages.createTag.
Expected results:
When creating the same tag using the "Manage Tags..." it actually does get assigned the internal key "a_tag-thing". So the Webextensions API appears to be more strict than what is used internally.
In this case this is (somewhat) of a problem, because an extension cannot create tags (with messenger.messages.createTag()) using the same key encoding as "Manage tags..." would do when the same complex tag containing spaces or hyphens is added. This creates compatibility issues when importing Xbox files with tag information stored in X-Mozilla-Keys created using messenger.messages.createTag() in a new profile where tags are added using "Manage tags...".
Updated•2 years ago
|
| Assignee | ||
Comment 1•2 years ago
•
|
||
Thanks for your report. I will investigate the situation.
| Assignee | ||
Comment 2•2 years ago
|
||
The internal limitation seems to be coming from here:
https://searchfox.org/comm-central/rev/5da82e895f27d3c6a8bf8567340c08a3dde6362b/mailnews/base/src/nsMsgTagService.cpp#211
We should be able to clone that into the API
| Assignee | ||
Comment 3•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/0601e96e3d00
Adjust tags API to support keys also supported by Thunderbird itself. r=mkmelin
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 5•2 years ago
|
||
Comment on attachment 9355136 [details]
Bug 1844747 - Adjust tags API to support keys also supported by Thunderbird itself. r=darktrojan
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined: Not all tags can be accessed/modified thru the API
Testing completed (on c-c, etc.): Full Beta cycle
Risk to taking this patch (and alternatives if risky): Adjusting the pattern match and adding a test. Applies cleanly, should not cause issues.
Comment 6•2 years ago
|
||
Comment on attachment 9355136 [details]
Bug 1844747 - Adjust tags API to support keys also supported by Thunderbird itself. r=darktrojan
[Triage Comment]
Approved for esr115
Comment 7•2 years ago
|
||
| bugherder uplift | ||
Thunderbird 115.5.0:
https://hg.mozilla.org/releases/comm-esr115/rev/01bfd5c74b43
Description
•