Skip to content

fix(settings): order l10n bundling before static asset hashing - #21043

Merged
LZoog merged 1 commit into
mainfrom
l10n-prod-bug
Aug 14, 2026
Merged

fix(settings): order l10n bundling before static asset hashing#21043
LZoog merged 1 commit into
mainfrom
l10n-prod-bug

Conversation

@LZoog

@LZoog LZoog commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Because

  • Since v1.342.0, production has served English to every locale — the static asset manifest shipped with no main.ftl keys, so the settings app fetched no FTL at all.
  • The nx upgrade replaced a sequential build-l10n && build-static chain with sibling dependsOn entries, which carry no ordering guarantee between each other, so grunt hash-static could hash public/locales before l10n-bundle had written into it.

This pull request

  • Adds build-l10n to build-static's dependsOn, so grunt hash-static can no longer run before l10n-bundle has written main.ftl.
  • Fails hash-static when the generated manifest is missing main.ftl for any locale present on disk.

Issue that this pull request solves

Closes: FXA-14361

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on: packages/fxa-settings/package.json holds the one-line change that actually fixes the outage; Gruntfile.js holds the new guard.
  • Suggested review order: package.jsonGruntfile.js.
  • Risky or complex parts: nothing in the diff itself. Worth knowing that public/locales is gitignored, so nx's hasher cannot see those files as inputs — which is why a stale cache can hide this locally.

Screenshots (Optional)

Please attach the screenshots of the changes made in case of change in user interface.

Other information (Optional)

  • Sentry reporting for whole-bundle l10n failures was split out into feat(l10n): report whole-bundle l10n load failures to Sentry #21044 (FXA-14362), so this stays a two-file diff. The two PRs are independent and share no files.
  • Prod is currently serving English to every locale, so this likely wants a dot release rather than riding the next train.
  • History was rewritten to perform that split; the previous head was efdbd68f37.
  • Verified locally: the nx task graph now orders build-l10n ahead of build-static; a cold prime → merge → bundle → hash produces main.ftl manifest entries for all 88 locales; and the guard fails with a precise message when a locale is missing one.

baseDir={baseDir}
userLocales={userLocales}
bundles={bundles}
reportBundleError={reportBundleError}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only change in this file. The rest is prettier.

const json = await mappingsResponse.json();
return json;
if (!mappingsResponse.ok) {
throw new Error(`Received status ${mappingsResponse.status}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would throwing here cause other issues? Failing to load ftl files should still load the english strings I would think.

}

/**
* Reports a failure to load a localization bundle. Individual missing string ids

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how useful this reporter is?

@vbudhram vbudhram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really have strong feelings for the reporting part. Maybe try to get some of the tests a bit more concise and remove overlap to get diff size down.

Because:

- Since v1.342.0, production served English to every locale: the static
  asset manifest shipped with no main.ftl keys, so the app fetched no FTL.
- Sibling dependsOn entries carry no ordering guarantee, so grunt
  hash-static was free to run before l10n-bundle wrote main.ftl.

This commit:

- Adds build-l10n to build-static's dependsOn.
- Fails hash-static when the generated manifest is missing main.ftl for any
  locale present on disk.

Closes #FXA-14361
@LZoog

LZoog commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

pulled out reporting changes to #21044

@LZoog
LZoog marked this pull request as ready for review August 14, 2026 20:36
@LZoog
LZoog requested a review from a team as a code owner August 14, 2026 20:36
Copilot AI balanced review requested due to automatic review settings August 14, 2026 20:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ensures localization bundles are generated before static asset hashing and prevents incomplete locale manifests.

Changes:

  • Orders build-l10n before build-static.
  • Validates every locale has a hashed main.ftl manifest entry.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/fxa-settings/package.json Adds the required Nx build dependency.
packages/fxa-settings/Gruntfile.js Adds post-hash localization manifest validation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@LZoog
LZoog merged commit b61ceda into main Aug 14, 2026
22 checks passed
@LZoog
LZoog deleted the l10n-prod-bug branch August 14, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants