Fluent should debug assert (MOZ_ASSERT) for strings where replaced variables are not provided
Categories
(Core :: Internationalization: Localization, enhancement, P3)
Tracking
()
People
(Reporter: Gijs, Assigned: gregtatum)
References
Details
Attachments
(4 files)
See bug 1684190 for context.
When data-l10n-id
, setAttributes
, or formatValues
or similar is used with a fluent message that includes a $variable
, and the data-l10n-args
and/or args part of the API call does not include that variable (Note: different from just setting it to ""
) then fluent should assert on debug builds, and/or in automation for opt builds, so we catch missing variable issues like the one in bug 1684190 immediately.
Comment 1•4 years ago
|
||
I agree.
In bug 1613705 with the move to Rust I'm improving our errors wrangling from Fluent to surface, and will add ability to crash in automation at least.
Updated•4 years ago
|
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 2•2 years ago
|
||
What would it take to fix this / get this prioritized?
Comment 3•2 years ago
|
||
Erik, do you think this could/should be fixed by adding an appropriate debug_assert!
to fluent-rs, or should we handle this at a higher level?
Comment 4•2 years ago
|
||
I think it would make sense to add debug_assert!
calls upstream, but I want to double check with people like Zibi who originally designed Fluent-rs and may have a better idea of how that may affect other users.
I've opened an issue of it on GitHub.
https://github.com/projectfluent/fluent-rs/issues/265
I'm leaving this NI open to make sure I follow up on this.
Assignee | ||
Comment 5•2 years ago
|
||
Zibi mentioned this: https://searchfox.org/mozilla-central/rev/3c194fa1d6f339036d2ec9516bd310c6ad612859/intl/l10n/Localization.h#45
I haven't looked at the specific bindings myself in our codebase, but it seems like it should be handled in our own usage of fluent-rs rather than in upstream.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 6•2 years ago
|
||
Assignee | ||
Comment 7•2 years ago
|
||
I don't think these are actual bugs, as these are crashing due to
missing dynamic data. I felt it was fine to add empty strings here.
Depends on D161996
Updated•2 years ago
|
Comment 9•2 years ago
|
||
Backed out for causing Xpcshell failures at test_l10nCache.js.
Backout link: https://hg.mozilla.org/integration/autoland/rev/1e556c93a8c89b148ab70183ed37dc9e6c97d97e
Failure log: https://treeherder.mozilla.org/logviewer?job_id=397235068&repo=autoland&lineNumber=3646
Assignee | ||
Comment 10•2 years ago
|
||
Depends on D162336
Assignee | ||
Updated•2 years ago
|
Comment 11•2 years ago
|
||
And this is also perma: https://treeherder.mozilla.org/logviewer?job_id=397245653&repo=autoland
Assignee | ||
Comment 12•2 years ago
|
||
Also toolkit/components/antitracking/test/browser/browser_urlQueryStringStripping_pbmode.js
Which is bug 1801716
Assignee | ||
Comment 13•2 years ago
|
||
Depends on D162597
Comment 14•2 years ago
|
||
Comment 15•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7b60e053cb45
https://hg.mozilla.org/mozilla-central/rev/2ce6ad4ea83c
https://hg.mozilla.org/mozilla-central/rev/f69ffa081b91
https://hg.mozilla.org/mozilla-central/rev/8e10d2d72d9b
Updated•2 years ago
|
Reporter | ||
Updated•2 years ago
|
Updated•2 years ago
|
Description
•