Closed Bug 1733707 Opened 3 years ago Closed 3 years ago

Pile of "Attempt to override an existing message: "downloads-window", "downloads-*" from browser/downloads.ftl in the browser console when opening the library window

Categories

(Firefox :: Bookmarks & History, defect)

Desktop
All
defect

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox-esr91 --- wontfix
firefox92 --- wontfix
firefox93 --- wontfix
firefox94 --- fixed

People

(Reporter: Gijs, Assigned: zbraniecki)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

STR:

  1. open Firefox
  2. open browser console
  3. open library (ctrl/cmd-shift-o in the main browser window)

Full list:

Attempt to override an existing message: "downloads-window". browser/downloads.ftl
Attempt to override an existing message: "downloads-panel". browser/downloads.ftl
Attempt to override an existing message: "downloads-panel-list". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-pause". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-resume". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-cancel". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-cancel-panel". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-show-menuitem". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-show-menuitem-mac". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-use-system-default". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-always-use-system-default". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-show-button". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-show-panel". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-show-description". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-show-downloads". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-retry". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-retry-panel". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-go-to-download-page". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-copy-download-link". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-remove-from-history". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-clear-list". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-clear-downloads". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-unblock". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-remove-file". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-remove-file-panel". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-choose-unblock". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-choose-unblock-panel". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-choose-open". browser/downloads.ftl
Attempt to override an existing message: "downloads-cmd-choose-open-panel". browser/downloads.ftl
Attempt to override an existing message: "downloads-show-more-information". browser/downloads.ftl
Attempt to override an existing message: "downloads-open-file". browser/downloads.ftl
Attempt to override an existing message: "downloading-file-opens-in-hours-and-minutes". browser/downloads.ftl
Attempt to override an existing message: "downloading-file-opens-in-minutes". browser/downloads.ftl
Attempt to override an existing message: "downloading-file-opens-in-minutes-and-seconds". browser/downloads.ftl
Attempt to override an existing message: "downloading-file-opens-in-seconds". browser/downloads.ftl
Attempt to override an existing message: "downloading-file-opens-in-some-time". browser/downloads.ftl
Attempt to override an existing message: "downloads-retry-download". browser/downloads.ftl
Attempt to override an existing message: "downloads-cancel-download". browser/downloads.ftl
Attempt to override an existing message: "downloads-history". browser/downloads.ftl
Attempt to override an existing message: "downloads-details". browser/downloads.ftl
Attempt to override an existing message: "downloads-clear-downloads-button". browser/downloads.ftl
Attempt to override an existing message: "downloads-list-empty". browser/downloads.ftl
Attempt to override an existing message: "downloads-panel-empty". browser/downloads.ftl

(from mid-mozregression, might look slightly different on current Nightly)

It's not clear to me what is causing these messages, or why they haven't broken anything on infra, or how to fix it, because frankly the messages are not very descriptive. (What is doing the attempt/overriding? Why is it an error? It just points to a file, no line number, and doesn't indicate where the conflict is or how to resolve it.)

Zibi, this broke with your changes in bug 1613705 (regression window), can you clarify what is going on here?

Flags: needinfo?(zbraniecki)
Has Regression Range: --- → yes
Has STR: --- → yes

Taking to investigate.

Assignee: nobody → zbraniecki
Status: NEW → ASSIGNED
Flags: needinfo?(zbraniecki)
Regressed by: 1608202
No longer regressed by: 1613705
Attachment #9244031 - Attachment description: WIP: Bug 1733707 - Do not load downloads.ftl multiple times. → Bug 1733707 - Do not load downloads.ftl multiple times.

This has actually been introduced by bug 1608202 and bug 1613705 just improved our reporting.

The root cause is that Fluent doesn't want you to accidentally override FTL messages in a single context, so we explicitly disallow that unless allowOverrides is used by things like RemoteL10n.

In bug 1608202 browser/downloads.ftl has been added to the include file: https://searchfox.org/mozilla-central/rev/c3d7964c593e0bedabea2fea0b35ba243cf9e696/browser/components/downloads/content/downloadsContextMenu.inc.xhtml#7-9

while also to the header of both documents that include it - https://searchfox.org/mozilla-central/search?q=downloadsContextMenu.inc.xhtml&path=

In result it has been referenced twice.

It's not clear to me what is causing these messages, or why they haven't broken anything on infra, or how to fix it, because frankly the messages are not very descriptive. (What is doing the attempt/overriding? Why is it an error? It just points to a file, no line number, and doesn't indicate where the conflict is or how to resolve it.)

I'm wondering what would be the best DX here. Maybe a message like:

An attempt in document `places.xhtml` localization context to override existing message `downloads-cmd-remove-from-history` from `browser/downloads.ftl`.

The reason it has not been reported any further is that it is "ok" - as in, we recover and swallow the warning. Maybe we should throw in automation?
As for file/line-number we'd need to extract this information from HTML Parser or Content Sink because this has been triggered by declarative code.

For now I'm fixing the duplication. If you can suggest what message would be helpful, we can spin off an enhancement bug to track that work.

Pushed by zbraniecki@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5aff4972820e Do not load downloads.ftl multiple times. r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch

(In reply to Zibi Braniecki [:zbraniecki][:gandalf] from comment #3)

It's not clear to me what is causing these messages, or why they haven't broken anything on infra, or how to fix it, because frankly the messages are not very descriptive. (What is doing the attempt/overriding? Why is it an error? It just points to a file, no line number, and doesn't indicate where the conflict is or how to resolve it.)

I'm wondering what would be the best DX here. Maybe a message like:

Well, at least we should make these errors turn tests orange on infra. We had this in the past, I believe - can we have a follow-up for that? I'm not sure if this is the only fluent error that doesn't break things, or if the change to the rust implementation has meant we've lost coverage for other errors (e.g. non-existing fluent messages being referenced from markup or calls to l10n.setAttributes) too.

An attempt in document `places.xhtml` localization context to override existing message `downloads-cmd-remove-from-history` from `browser/downloads.ftl`.

In terms of the messaging, it feels like we should have 2 different errors for the 2 different problems:

  1. document X included FTL file Y more than once. This should be caught at that level, not at the duplicate message level.
  2. FTL file X and FTL file Y both declare message Z, which should reference both FTL files and the message ID (and, I guess, the document that is sourcing both FTL files - but I'm pretty sure we have linting that should catch this before we ever land this type of thing in-tree).

I don't know if this + the automation errors needs 2 or 3 bugs - up to you.

Flags: needinfo?(zbraniecki)

Did you want to uplift this to ESR91?

Flags: needinfo?(zbraniecki)
See Also: → 1755216
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: