Missing remote strings breaks recommendations even though local localized string exists
Categories
(Firefox :: Messaging System, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox71 | --- | verified |
People
(Reporter: Mardak, Assigned: nanj)
References
Details
Attachments
(2 files)
Clicking on the "Recommendación` button doesn't open the doorhanger and browser console shows:
[fluent] Missing translations in es-CL: cfr-doorhanger-sync-logins-header. Localization.jsm:202:13
TypeError: localeStrings is undefined
CFRPageActions.jsm:351:24
CFRPageActions.jsm is trying to get a formatted message's attribute, but the string doesn't exist in remote settings and throws an exception when trying to access.
ms-language-packs is currently missing these two recently translated es-CL strings:
cfr-doorhanger-sync-logins-header = Nunca pierdas una contraseña nuevamente
cfr-doorhanger-sync-logins-body = Guarda de forma segura y sincroniza tus contraseñas en todos tus dispositivos
However es-CL Nightly 71.0a1 20191011093010 does have those strings available from resource:///localization/es-CL/browser/newtab/asrouter.ftl
Reporter | ||
Comment 1•5 years ago
|
||
Is this because there's a resourceIds.slice(1)
to skip the packaged asrouter.ftl? If instead it did generateBundles with the full list of ftl then addResource(remote), it would at least use the other as a fallback?
Assignee | ||
Comment 2•5 years ago
•
|
||
(In reply to Ed Lee :Mardak from comment #1)
Is this because there's a
resourceIds.slice(1)
to skip the packaged asrouter.ftl? If instead it did generateBundles with the full list of ftl then addResource(remote), it would at least use the other as a fallback?
Correct, resourceIds.slice(1)
will skip the local ftl if the remote one presents. This assumes that the remote one is always fresher than the local one, which was not the case in this case.
Comment 3•5 years ago
|
||
I think the problem is that https://searchfox.org/mozilla-central/rev/c8933daeb71df02566407eff88904ee981a7bcdd/browser/components/newtab/lib/CFRPageActions.jsm#153-155 is in an else
clause, instead of just being next in line.
Thus the generated bundles are either RS or built-in, instead of one after the other.
Seems I didn't catch that in the review, sorry.
Assignee | ||
Comment 4•5 years ago
|
||
Nah, that was an issue in my design, I chose the either-or strategy over the one-after with a flawed assumption (remote is always fresher than local). Perhaps letting remote overwrite the local one is more reasonable here.
I have published the missing fluent files to RS, which should fix this for now. A code change is still needed in order to fix this permanently.
Reporter | ||
Comment 5•5 years ago
|
||
Just tested Pike's suggestion from comment 3 and locally deleted the header entry from obj/tmp/profile-default/settings/main/ms-language-packs/asrouter.ftl
(after Firefox starts but before devtools Show-ing a CFR) and the recommendation does work with the resource:// packaged header and remote provided body.
Assignee | ||
Comment 6•5 years ago
|
||
Will put up a hotfix for this once https://phabricator.services.mozilla.com/D49010 lands.
Assignee | ||
Comment 7•5 years ago
|
||
This changes the either-or semantics to one-after between the local and remote fluent files for ASRouter.
Pushed by najiang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d7a217f1ebee Load local fluent file for ASRouter as fallback r=Pike,Mardak
Comment 9•5 years ago
|
||
Backed out changeset d7a217f1ebee (bug 1588199) for Browser-chrome failures in rowser/components/newtab/test/browser/browser_asrouter_cfr.js. CLOSED TREE
Log:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=271286820&repo=autoland&lineNumber=3541
Backout:
https://hg.mozilla.org/integration/autoland/rev/589ef7e139bde33e2343645cbf7b94d01f1475d4
Comment 10•5 years ago
|
||
Pushed by najiang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8781f5f50d45 Load local fluent file for ASRouter as fallback r=Pike,Mardak
Assignee | ||
Updated•5 years ago
|
Comment 11•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Comment 13•5 years ago
|
||
I was trying to reproduce this issue on a Nightly build from the date this was filed (Build ID: 20191011093010, es-CL locale) and I had no luck in reproducing it.
I am seeing some errors related to missing translation ([fluent] Missing translations in es-CL: search-one-offs-context-set-as-default-private. Localization.jsm:202:13), but I am not seeing the specific error described in this bug ([fluent] Missing translations in es-CL: cfr-doorhanger-sync-logins-header. Localization.jsm:202:13
TypeError: localeStrings is undefined
CFRPageActions.jsm:351:24).
@Nan, was this fixed on the server side and is this expected?
Assignee | ||
Comment 14•5 years ago
|
||
was this fixed on the server side and is this expected?
Yes, we've fixed it both on the client and server sides. The missing strings for that locale have been added to the server, also, the attached patch allows the client to use the local string if the remote one is missing. I think that's why you couldn't reproduce it, my apologies for the confusion.
Comment 15•5 years ago
|
||
Thanks for the clarification, Nan.
I have verified this issue on Firefox Beta 71.0 es-CL locale (Build ID:20191125204040) and Latest Firefox Nightly 72.0a1 es-CL locale (Build ID: 20191128094109) on Windows 10 x64, Mac 10.14.6 and Arch Linux 3.34.1.
The [fluent] Missing translations in es-CL: cfr-doorhanger-sync-logins-header. Localization.jsm:202:13 TypeError: localeStrings is undefined CFRPageActions.jsm:351:24
is not displayed in the browser console and the "Recommendation" doorhanger is displayed when clicking on the "Recommendation" button.
Description
•