TranslationsEngine fails to load due to "setTimeout is not defined"
Categories
(Firefox :: Translations, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox-esr128 | --- | unaffected |
firefox135 | --- | unaffected |
firefox136 | --- | unaffected |
firefox137 | --- | fixed |
People
(Reporter: tgnff242, Assigned: nordzilla)
References
(Regression)
Details
(Keywords: nightly-community, regression)
Attachments
(1 file)
Steps to reproduce:
Try to translate any page. Language isn't important.
Actual results:
The translation fails with the displayed error being: "There was a problem translating. Please try again."
Expected results:
Regressed by Bug 1942128.
Comment 2•14 days ago
|
||
:nika, since you are the author of the regressor, bug 1942128, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Assignee | ||
Comment 3•14 days ago
•
|
||
It does look like Translations is currently broken in Nightly, unfortunately.
I investigated this a bit, and it appears to be the use of setTimeout()
for the TranslationsEngine cache timers.
Error Log
Translations: The engine failed to load for translating "es -> en". Removing it from the cache.
ReferenceError: setTimeout is not defined
keepAlive chrome://global/content/translations/translations-engine.sys.mjs:332
isReady chrome://global/content/translations/translations-engine.sys.mjs:396
TranslationsEngine** chrome://global/content/translations/translations-engine.sys.mjs:375
create chrome://global/content/translations/translations-engine.sys.mjs:260
Note
This didn't fail our integration or end-to-end tests in CI because we manually manage the lifetimes of the engines in the test cleanup functions to ensure the state of the engine cache is deterministic and consistent between test cases, but in production they are managed by a keep-alive timeout here.
I'm marking this as S2 P1, matching the following description:
S2: (Serious) Major functionality/product severely impaired or a high impact issue and a satisfactory workaround does not exist
This is only in Nightly right now, but we should get this fixed ASAP, since it appears to be broken on all platforms.
:nika, I am leaving your NI open because I am not sure how you patch affected this behavior, or if it is intended that setTimeout()
should no longer be available within the inference process. I'm interested to hear your input.
Assignee | ||
Updated•14 days ago
|
Assignee | ||
Updated•14 days ago
|
Assignee | ||
Updated•14 days ago
|
Assignee | ||
Updated•14 days ago
|
Comment 4•13 days ago
|
||
(In reply to Erik Nordin [:nordzilla] from comment #3)
:nika, I am leaving your NI open because I am not sure how you patch affected this behavior, or if it is intended that
setTimeout()
should no longer be available within the inference process. I'm interested to hear your input.
This is happening because the translations-engine.sys.mjs
file is now actually being loaded as a sys.mjs
file, rather than as a module loaded in a content window. In the system js module scope there is no function named setTimeout
, meaning that this call fails, but it wasn't caught in automation because of the Cu.isInAutomation
check disabling this codepath in tests.
The easiest solution here is probably to import the js setTimeout
implementation from "resource://gre/modules/Timer.sys.mjs"
.
I'm guessing that perhaps I should've removed the /* eslint-env browser */
annotation from the top of the file as well, and perhaps that would've caught it, but I'm not familiar with how our eslint setup works.
Assignee | ||
Updated•13 days ago
|
Assignee | ||
Comment 5•13 days ago
|
||
Fixes an issue where translations-engine.sys.mjs was not properly
importing the setTimeout and clearTimeout functions from Timer.sys.mjs
Assignee | ||
Updated•10 days ago
|
Description
•