SelectTranslationsPanel cached docLangTag is not correctly updated between panel opens
Categories
(Firefox :: Translations, defect, P2)
Tracking
()
People
(Reporter: nordzilla, Assigned: nordzilla)
References
Details
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
Description
In Bug 1899354 I attempted to fix an issue with the languageInfo
cache not updating correctly between page loads, however I fixed only half the problem.
While investigating Bug 1903044 it became clear that the cache will need to be invalidated between each panel open, otherwise the incorrect document language tag will be reported to telemetry.
Steps to reproduce
- Ensure that
toolkit.telemetry.translations.logLevel
is set toDebug
. - Open the Browser Console and filter on
TranslationsTelemetry
. - Open a page in a new tab, e.g. https://fr.wikipedia.org.
- Open a page in a different language in another tab, e.g. https://es.wikipedia.org.
- Select text and open the SelectTranslationsPanel on the Spanish page.
- Switch to the French-page tab.
- Select text and open the SelectTranslationsPanel on the French page.
Expected Behavior
The docLangTag
attribute for the onOpen
event and onTranslate
event shows fr
for the French-page telemetry submission.
Actual Behavior
The docLangTag
attribute for the onOpen
event and onTranslate
event shows es
for the French-page telemetry submission, reading old the value from the cache.
Steps to implement
- Ensure that the languageInfo cache is invalidated with each open of the panel.
Tests to implement
- Write a telemetry test that ensures the correct document language tag is reported with multiple tabs open.
Assignee | ||
Comment 1•6 months ago
|
||
Ensures that the SelectTranslationsPanel languageInfo cache
is refreshed every time the panel would be opened. This prevents
a case where the incorrect (previous) document language tag
is reported to telemetry in some cases.
Comment 3•6 months ago
|
||
bugherder |
Assignee | ||
Comment 4•6 months ago
|
||
Ensures that the SelectTranslationsPanel languageInfo cache
is refreshed every time the panel would be opened. This prevents
a case where the incorrect (previous) document language tag
is reported to telemetry in some cases.
Original Revision: https://phabricator.services.mozilla.com/D214011
Updated•6 months ago
|
Comment 5•6 months ago
|
||
beta Uplift Approval Request
- User impact if declined: The Select Translations Panel will occasionally report the incorrect detected document language tag to telemetry
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: yes
- Steps to reproduce for manual QE testing: STR are included in the bug description.
- Risk associated with taking this patch: Very low
- Explanation of risk level: This patch affects only the Select Translations Panel and is well covered by pre-existing and new automated tests
- String changes made/needed: None
- Is Android affected?: no
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Comment 7•5 months ago
|
||
I can reproduce this issue in Nightly v129.0a1 from 2024-06-17 and verify the fix in Nightly v129.0a1 from 2024-06-20 and Beta v128.0b5. The docLangTag shows the expected language when using the steps in comment 0. Tested in Windows10, MacOS11 and Ubuntu22. Thanks!
Description
•