I dug into this and found that the regression is here: Bug 1870327 https://phabricator.services.mozilla.com/D201282 --- This is where I refactored the way that the language lists are built to be in the shared class [here](https://searchfox.org/mozilla-central/rev/5df192b9edee971a1ab06ff9ef688d92c21a92c1/browser/components/translations/content/TranslationsPanelShared.sys.mjs#58-83). The new code stores the initialized state based on the panel's element ID. So, when `full-page-translations-panel` gets its language lists initialized, that gets put into the map. This appears to break when someone opens up a new window, not just a private window. I looked into adding the PID to the map as a differentiator, but that's not aggressive enough: all the windows still have the same parent process. I then look into adding the `innerWindowId` as a differentiator, but that is too aggressive: even new tabs get a different `innerWindowId`. It's not really clear to me at the moment why the `FullPageTranslationsPanel` class, which is a singleton class, seems to be losing information when the `TranslationsPanelShared`, which is just a class with static members and functions, is retaining information within the same process. I'm going to keep looking into this.
Bug 1889697 Comment 2 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
I dug into this and found that the regression is here: Bug 1870327 https://phabricator.services.mozilla.com/D201282 --- This is where I refactored the way that the language lists are built to be in the shared class [here](https://searchfox.org/mozilla-central/rev/5df192b9edee971a1ab06ff9ef688d92c21a92c1/browser/components/translations/content/TranslationsPanelShared.sys.mjs#58-83). The new code stores the initialized state based on the panel's element ID. So, when `full-page-translations-panel` gets its language lists initialized, that gets put into the map as `"initialized"`. This appears to break when someone opens up a new window, not just a private window. I looked into adding the PID to the map as a differentiator, but that's not aggressive enough: all the windows still have the same parent process. I then look into adding the `innerWindowId` as a differentiator, but that is too aggressive: even new tabs get a different `innerWindowId`. It's not really clear to me at the moment why the `FullPageTranslationsPanel` class, which is a singleton class, seems to be losing information when the `TranslationsPanelShared`, which is just a class with static members and functions, is retaining information within the same process. I'm going to keep looking into this.
I dug into this and found that the regression is here: Bug 1870327 https://phabricator.services.mozilla.com/D201282 --- This is where I refactored the way that the language lists are built to be in the shared class [here](https://searchfox.org/mozilla-central/rev/5df192b9edee971a1ab06ff9ef688d92c21a92c1/browser/components/translations/content/TranslationsPanelShared.sys.mjs#58-83). The new code stores the initialized state based on the panel's element ID. So, when `full-page-translations-panel` gets its language lists initialized, that gets put into the map as `"initialized"`. This appears to break when someone opens up a new window after translating, not just a private window. I looked into adding the PID to the map as a differentiator, but that's not aggressive enough: all the windows still have the same parent process. I then look into adding the `innerWindowId` as a differentiator, but that is too aggressive: even new tabs get a different `innerWindowId`. It's not really clear to me at the moment why the `FullPageTranslationsPanel` class, which is a singleton class, seems to be losing information when the `TranslationsPanelShared`, which is just a class with static members and functions, is retaining information within the same process. I'm going to keep looking into this.
I dug into this and found that the regression is here: Bug 1870327 https://phabricator.services.mozilla.com/D201282 --- This is where I refactored the way that the language lists are built to be in the shared class [here](https://searchfox.org/mozilla-central/rev/5df192b9edee971a1ab06ff9ef688d92c21a92c1/browser/components/translations/content/TranslationsPanelShared.sys.mjs#58-83). The new code stores the initialized state based on the panel's element ID. So, when `full-page-translations-panel` gets its language lists initialized, that gets put into the map as `"initialized"`. This appears to break when someone opens up a new window after translating, not just a private window. I looked into adding the PID to the map as a differentiator, but that's not aggressive enough: all the windows still have the same parent process. I then looked into adding the `innerWindowId` as a differentiator, but that is too aggressive: even new tabs get a different `innerWindowId`. It's not really clear to me at the moment why the `FullPageTranslationsPanel` class, which is a singleton class, seems to be losing information when the `TranslationsPanelShared`, which is just a class with static members and functions, is retaining information within the same process. I'm going to keep looking into this.
I dug into this and found that the regression is here: Bug 1870327 https://phabricator.services.mozilla.com/D201282 --- This is where I refactored the way that the language lists are built to be in the shared class [here](https://searchfox.org/mozilla-central/rev/5df192b9edee971a1ab06ff9ef688d92c21a92c1/browser/components/translations/content/TranslationsPanelShared.sys.mjs#58-83). The new code stores the initialized state based on the panel's element ID. So, when `full-page-translations-panel` gets its language lists initialized, that gets put into the map as `"initialized"`. This appears to break when someone opens up a new window after translating, not just a private window. I looked into adding the PID to the map as a differentiator, but that's not aggressive enough: all the windows still have the same parent process. I then looked into adding the `innerWindowId` as a differentiator, but that is too aggressive: even new tabs get a different `innerWindowId`. It's not really clear to me at the moment why the `FullPageTranslationsPanel` class, which is a singleton class, seems to be losing information when the `TranslationsPanelShared` class, which is just a class with static members and functions, is retaining information within the same process. I'm going to keep looking into this.