Closed Bug 1547801 Opened 9 months ago Closed 9 months ago

Bookmarks with the Russian tag name are incorrectly displayed in the Library

Categories

(Firefox :: Bookmarks & History, defect, P2)

61 Branch
x86
Windows 7
defect
Points:
2

Tracking

()

RESOLVED FIXED
Firefox 68
Iteration:
68.4 - Apr 29 - May 12
Tracking Status
firefox-esr60 --- unaffected
firefox66 --- wontfix
firefox67 --- wontfix
firefox68 --- fixed

People

(Reporter: kayperwood, Assigned: standard8)

References

(Regression, )

Details

(Keywords: regression)

Attachments

(2 files)

Attached image 1.png

User Agent: Mozilla/5.0 (Windows NT 6.1; rv:61.0) Gecko/20100101 Firefox/61.0

Steps to reproduce:

I don't know when it started, but the first time I discovered this problem a year ago. My system language is Russian, I use the English version of the browsers - Firefox Quantum and Firefox Developer Edition. The problem with tags is observed in all versions of the browser that I checked this weekend, ranging from 61 to 66.

Actual results:

If the first letter of the tag in Russian is lowercase, the bookmark displayed. If the tag in Russian starts with a large letter, the bookmark is not displayed.

Expected results:

Tags that have a Latin name don't have this problem.

https://support.mozilla.org/ru/questions/1257346#answer-1216906

Comment on attachment 9061465 [details]
1.png

Example
Component: Untriaged → Bookmarks & History
OS: Unspecified → Windows 7
Hardware: Unspecified → x86

Thank you for the report. I've just checked and it does appear to be a regression - looks like bug 1421664 caused it.

Status: UNCONFIRMED → NEW
Has Regression Range: --- → yes
Has STR: --- → yes
Ever confirmed: true
Priority: -- → P2
Regressed by: 1421664

MAybe the same cause as Bug 1449939, probably strictly related.

See Also: → 1449939

In the sql logs I noticed:

[Parent 4388: Main Thread]: D/mozStorage TRACE_STMT on 0x1256b77a0: 'SELECT b.fk, h.url, b.title AS page_title, h.rev_host, h.visit_count, h.last_visit_date, null, b.id, b.dateAdded, b.lastModified, b.parent, null AS tags , h.frecency, h.hidden, h.guid,null, null, null, b.guid, b.position, b.type, b.fk FROM moz_bookmarks b JOIN moz_places h ON b.fk = h.id WHERE NOT EXISTS (SELECT id FROM moz_bookmarks WHERE id = b.parent AND parent = 4) AND NOT h.url_hash BETWEEN hash('place', 'prefix_lo') AND hash('place', 'prefix_hi')  AND ( h.id  IN (SELECT bms.fk FROM moz_bookmarks bms JOIN moz_bookmarks tags ON bms.parent = tags.id WHERE tags.parent =  4  AND lower(tags.title) IN (  'Птицы'  )  GROUP BY bms.fk HAVING count(*) >=  1  ) ) ORDER BY 3 COLLATE NOCASE ASC'

Specifically AND lower(tags.title) IN ( 'Птицы' )

So we're comparing a lower case tag title with the upper case form.

I took a look at the code surrounding this, and found we're converting from utf-16 to utf-8 and then converting into lower case.

The function definitions around ToLowerCase for nsACString imply they only handle ascii. Hence, I'm just about to attach a patch to do the lower case transition first, and then convert to utf-8. This seems to fix the issue.

Assignee: nobody → standard8
Status: NEW → ASSIGNED
Points: --- → 2

Just to note, I think given this has been in for a while already, and we're getting late-ish for 67, we can wontfix it there and include it in 68.

(In reply to Mark Banner (:standard8) from comment #7)

Just to note, I think given this has been in for a while already, and we're getting late-ish for 67, we can wontfix it there and include it in 68.

Thank you!

Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/139a838ca42f
Correctly handle case-insensitive matching in tag queries for international strings. r=mak
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
Flags: in-testsuite+
Iteration: --- → 68.4 - Apr 29 - May 12
You need to log in before you can comment on or make changes to this bug.