Closed Bug 1588199 Opened 5 years ago Closed 5 years ago

Missing remote strings breaks recommendations even though local localized string exists

Categories

(Firefox :: Messaging System, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 71
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

view-source:https://firefox-settings-attachments.cdn.mozilla.net/main-workspace/ms-language-packs/dd95d70b-0772-4c84-9593-517ccb01eb26.ftl

However es-CL Nightly 71.0a1 20191011093010 does have those strings available from resource:///localization/es-CL/browser/newtab/asrouter.ftl

Blocks: 1564187

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?

https://searchfox.org/mozilla-central/rev/c8933daeb71df02566407eff88904ee981a7bcdd/browser/components/newtab/lib/CFRPageActions.jsm#141-150

(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.

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.

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.

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.

Will put up a hotfix for this once https://phabricator.services.mozilla.com/D49010 lands.

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
Pushed by najiang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8781f5f50d45
Load local fluent file for ASRouter as fallback r=Pike,Mardak
Flags: needinfo?(najiang)
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71
Assignee: nobody → najiang

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?

Flags: needinfo?(najiang)

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.

Flags: needinfo?(najiang)

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.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: