-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Bug][Experiment]: The TCP mobile experiment doesn't enable the feature #26041
[Bug][Experiment]: The TCP mobile experiment doesn't enable the feature #26041
Comments
I was able to reproduce this issue on the latest Nightly 104.0a1 (2022-07-18) build. |
@SoftVision-CosminMuntean thanks for testing, |
Could be try to test on the same channel where we are launching the experiment? An additional targeting version from the Recipe experiment page:
|
@Amejia481 thanks for looking over this issue. I have also verified with Fenix 103.1.0 and the feature is still not enabled by the experiment. I can enroll in the experiment in the treatment branch, but the feature is not enabled. However, just to be sure, the test page mentioned in Step 11 is a valid way to verify that we have TCP enabled? |
Thanks @SoftVision-CosminMuntean, for double checking, I'll continue investigating, I'll asking the nimbus team for help as I'm no sure why every time I query the nimbus API, about the TCP experiment I get the same value independently of the branch that I'm enrolled into.
Yes, it's good way. Additionally, you could verify by going to |
Marking this as S1 as it blocks further experiment testing. |
Thanks @SoftVision-CiprianMuresan, @jhugman and I we are investigating! |
Copying over James' JIRA comment here so I can reference it (Fenix JIRA is only a one-way sync):
To clarify this part:
There are many parts of the app that require the engine to be initialized ASAP. Even if we are able to disable Glean, the engine will be initialized by the next system that needs (e.g. which is probably the profiler). So concept-fetch isn't the cause of the dependency issue, but the first part of the engine that is immediately needed.
With the workaround that is mentioned above, we are then required to the tell the engine to re-evaluate it's settings for any feature we want to experiment with (in this case, we re-evaluate the tracking protection settings). |
…s ready. There are three issues here that we have uncovered while investigating this bug: 1. Settings.kt has a lazy block around `enabledTotalCookieProtection` which ends up caching the first result it evaluates. 2. The `FeatureHolder` within FxNimbus has a lazy block around it which also ends up caching the first result it evaluates. 3. Nimbus is not ready to return a result for an engine experiment when we need it early on in the dependency tree initialization. There are multiple systems that require engine to be initialized for them to work (e.g. Glean, Profiler, concept-fetch). In our TCP, experiment, we need to apply these engine settings during the engine initialization. So when we try and evaluate Nimbus that early on, it has not had time to initialize itself correctly or even use the engine's concept-fetch client to return the correct experiment result. This bug is made worse because of the first two caching bugs where we are always holding onto a cached value of the wrong result. Our temporary solution is to: 1. Remove the `lazy` around `Settings.enabledTotalCookieProtection`. 2. Set the `FxNimbus.api` value right after we are done initializing `FxNimbus` and `NimbusApi` so that all future queries to FxNimbus will be made against a real instance of `NimbusApi`. This is a short-term fix for the `FeatureHolder` caching bug. 3. Set a new TrackingProtectionPolicy that will evaluate Nimbus now that it is in the correct state when receive the `NimbusInterface.Observer.onUpdatesApplied`. Co-authored-by: jhugman
…s ready. There are three issues here that we have uncovered while investigating this bug: 1. Settings.kt has a lazy block around `enabledTotalCookieProtection` which ends up caching the first result it evaluates. 2. The `FeatureHolder` within FxNimbus caches the incorrectly evaluated value and returns this value hence forth. 3. Nimbus is not ready to return a result for an engine experiment when we need it early on in the dependency tree initialization. There are multiple systems that require engine to be initialized for them to work (e.g. Glean, Profiler, concept-fetch). In our TCP, experiment, we need to apply these engine settings during the engine initialization. So when we try and evaluate Nimbus that early on, it has not had time to initialize itself correctly or even use the engine's concept-fetch client to return the correct experiment result. This bug is made worse because of the first two caching bugs where we are always holding onto a cached value of the wrong result. Our temporary solution is to: 1. Remove the `lazy` around `Settings.enabledTotalCookieProtection`. 2. Set the `FxNimbus.api` value right after we are done initializing `FxNimbus` and `NimbusApi` so that all future queries to FxNimbus will be made against a real instance of `NimbusApi`. This is a short-term fix for the `FeatureHolder` caching bug. 3. Set a new TrackingProtectionPolicy that will evaluate Nimbus now that it is in the correct state when receive the `NimbusInterface.Observer.onUpdatesApplied`. Co-authored-by: jhugman <[email protected]>
…he engine There are three issues here that we have uncovered while investigating this bug: 1. Settings.kt has a lazy block around `enabledTotalCookieProtection` which ends up caching the first result it evaluates. 2. Nimbus is not ready to return a result for an engine experiment when we need it early on in the dependency tree initialization. 3. The `FeatureHolder` within FxNimbus caches the incorrectly evaluated value and returns this value hence forth. There are multiple systems that require the engine to be initialized for them to work (e.g. Glean, Profiler, concept-fetch). In our TCP, experiment, we need to apply these engine settings during the engine initialization. So when we try and evaluate Nimbus that early on, it has not had time to initialize itself correctly or even use the engine's concept-fetch client to return the correct experiment result. This bug is made worse because of the two other caching bugs where we are always holding onto a cached value of the wrong result. During investigation, we have identified that the BrowserStore was eagerly initialized (which initialized the engine as well via the `EngineMiddleware`) by trying to sending startup metrics from values in the store. By moving Nimbus to be initialized as early on as possible, we're able to guarantee now that our queries to get the feature branch for any engine experiment will provide us with the correct values from Nimbus. It's important to note that moving these calls to gather startup metrics are still happening as soon as possible, and are now more likely to be accurate in the future, if we collect metrics from the engine settings that the user has. In a debug build, we were also seeing a circular dependencies because of the StrictModeManager initializing the engine when trying to access the profiler - this call was also removed because it was originally added a preventative measure that is no longer required. In this change, we have also moved Glean initialization and wallpaper fetching into the `setupInMainProcessOnly` method to keep the original consistency of what is being initialized in the main process and when. This change does not affect the order of initialization in any way, however the inconsistency added a small amount of confusion during investigation, which is worth cleaning up in this patch as well. Co-authored-by: jhugman <[email protected]> Co-authored-by: Christian Sadilek <[email protected]>
…he engine There are three issues here that we have uncovered while investigating this bug: 1. Settings.kt has a lazy block around `enabledTotalCookieProtection` which ends up caching the first result it evaluates. 2. Nimbus is not ready to return a result for an engine experiment when we need it early on in the dependency tree initialization. 3. The `FeatureHolder` within FxNimbus caches the incorrectly evaluated value and returns this value hence forth. There are multiple systems that require the engine to be initialized for them to work (e.g. Glean, Profiler, concept-fetch). In our TCP, experiment, we need to apply these engine settings during the engine initialization. So when we try and evaluate Nimbus that early on, it has not had time to initialize itself correctly or even use the engine's concept-fetch client to return the correct experiment result. This bug is made worse because of the two other caching bugs where we are always holding onto a cached value of the wrong result. During investigation, we have identified that the BrowserStore was eagerly initialized (which initialized the engine as well via the `EngineMiddleware`) by trying to sending startup metrics from values in the store. By moving Nimbus to be initialized as early on as possible, we're able to guarantee now that our queries to get the feature branch for any engine experiment will provide us with the correct values from Nimbus. It's important to note that moving these calls to gather startup metrics are still happening as soon as possible, and are now more likely to be accurate in the future, if we collect metrics from the engine settings that the user has. In a debug build, we were also seeing a circular dependencies because of the StrictModeManager initializing the engine when trying to access the profiler - this call was also removed because it was originally added a preventative measure that is no longer required. In this change, we have also moved Glean initialization and wallpaper fetching into the `setupInMainProcessOnly` method to keep the original consistency of what is being initialized in the main process and when. This change does not affect the order of initialization in any way, however the inconsistency added a small amount of confusion during investigation, which is worth cleaning up in this patch as well. Co-authored-by: jhugman <[email protected]> Co-authored-by: Christian Sadilek <[email protected]>
…bus SDK is initialized There are three issues here that we have uncovered while investigating this bug: 1. Settings.kt has a lazy block around `enabledTotalCookieProtection` which ends up caching the first result it evaluates. 3. The `FeatureHolder` within FxNimbus caches the incorrectly evaluated value and returns this value hence forth. 4. Nimbus is not ready to return a result for an engine experiment when we need it early on in the dependency tree initialization. There are multiple systems that require engine to be initialized for them to work (e.g. Glean, Profiler, concept-fetch). In our TCP, experiment, we need to apply these engine settings during the engine initialization. So when we try and evaluate Nimbus that early on, it has not had time to initialize itself correctly or even use the engine's concept-fetch client to return the correct experiment result. This bug is made worse because of the first two caching bugs where we are always holding onto a cached value of the wrong result. Our temporary solution is to: 1. Remove the `lazy` around `Settings.enabledTotalCookieProtection`. 2. Set the `FxNimbus.api` value right after we are done initializing `FxNimbus` and `NimbusApi` so that all future queries to FxNimbus will be made against a real instance of `NimbusApi`. This is a short-term fix for the `FeatureHolder` caching bug. 3. Set a new TrackingProtectionPolicy that will evaluate Nimbus now that it is in the correct state when receive the `NimbusInterface.Observer.onUpdatesApplied`. Co-authored-by: jhugman <[email protected]> Co-authored-by: Christian Sadilek <[email protected]>
As part of mozilla-mobile/fenix#26041, we need to ensure we have at least version 93.6.0 of the plugin downloaded. The reason we are not using a newer version, even though they are available, is to reduce the complexity of things that go into the next AC release in order to get the Fenix experiment launched.
As part of mozilla-mobile/fenix#26041, we need to ensure we have at least version 93.6.0 of the plugin downloaded. The reason we are not using a newer version, even though they are available, is to reduce the complexity of things that go into the next AC release in order to get the Fenix experiment launched.
@SoftVision-CosminMuntean could you retest this experiment using the latest nightly 105 build (available in a few hours from when this comment was written)? |
@jonalmeida We have retested this issue on the latest Nightly 105.0a1 build and we are successfully enrolled in the experiment and also the TCP feature is enabled if enrolling in the "tcp-on" branch. We have verified this on Google 2 XL with Android 11, Samsung S9 with Android 11, and Motorola Moto G(10) with Android 11. |
As part of mozilla-mobile/fenix#26041, we need to ensure we have at least version 93.6.0 of the plugin downloaded. The reason we are not using a newer version, even though they are available, is to reduce the complexity of things that go into the next AC release in order to get the Fenix experiment launched. (cherry picked from commit 95c0400)
Thank you! |
…tialized There are three issues here that we have uncovered while investigating this bug: 1. Settings.kt has a lazy block around `enabledTotalCookieProtection` which ends up caching the first result it evaluates. 3. The `FeatureHolder` within FxNimbus caches the incorrectly evaluated value and returns this value hence forth. 4. Nimbus is not ready to return a result for an engine experiment when we need it early on in the dependency tree initialization. There are multiple systems that require engine to be initialized for them to work (e.g. Glean, Profiler, concept-fetch). In our TCP, experiment, we need to apply these engine settings during the engine initialization. So when we try and evaluate Nimbus that early on, it has not had time to initialize itself correctly or even use the engine's concept-fetch client to return the correct experiment result. This bug is made worse because of the first two caching bugs where we are always holding onto a cached value of the wrong result. Our temporary solution is to: 1. Remove the `lazy` around `Settings.enabledTotalCookieProtection`. 2. Set the `FxNimbus.api` value right after we are done initializing `FxNimbus` and `NimbusApi` so that all future queries to FxNimbus will be made against a real instance of `NimbusApi`. This is a short-term fix for the `FeatureHolder` caching bug. 3. Set a new TrackingProtectionPolicy that will evaluate Nimbus now that it is in the correct state when receive the `NimbusInterface.Observer.onUpdatesApplied`. Co-authored-by: jhugman <[email protected]> Co-authored-by: Christian Sadilek <[email protected]> (cherry picked from commit f03ee91)
This workaround was temporary and is not needed with the Nimbus groovy plugin updates in Android Components.
This workaround was temporary and is not needed with the Nimbus groovy plugin updates in Android Components.
Apologiese @SoftVision-CosminMuntean, we had to land one more patch for this fix. Could you please verify that the experiment is still working in nightly? |
…tialized There are three issues here that we have uncovered while investigating this bug: 1. Settings.kt has a lazy block around `enabledTotalCookieProtection` which ends up caching the first result it evaluates. 3. The `FeatureHolder` within FxNimbus caches the incorrectly evaluated value and returns this value hence forth. 4. Nimbus is not ready to return a result for an engine experiment when we need it early on in the dependency tree initialization. There are multiple systems that require engine to be initialized for them to work (e.g. Glean, Profiler, concept-fetch). In our TCP, experiment, we need to apply these engine settings during the engine initialization. So when we try and evaluate Nimbus that early on, it has not had time to initialize itself correctly or even use the engine's concept-fetch client to return the correct experiment result. This bug is made worse because of the first two caching bugs where we are always holding onto a cached value of the wrong result. Our temporary solution is to: 1. Remove the `lazy` around `Settings.enabledTotalCookieProtection`. 2. Set the `FxNimbus.api` value right after we are done initializing `FxNimbus` and `NimbusApi` so that all future queries to FxNimbus will be made against a real instance of `NimbusApi`. This is a short-term fix for the `FeatureHolder` caching bug. 3. Set a new TrackingProtectionPolicy that will evaluate Nimbus now that it is in the correct state when receive the `NimbusInterface.Observer.onUpdatesApplied`. Co-authored-by: jhugman <[email protected]> Co-authored-by: Christian Sadilek <[email protected]> (cherry picked from commit f03ee91)
This workaround was temporary and is not needed with the Nimbus groovy plugin updates in Android Components.
@jonalmeida no problem! We have retested the experiment on the latest Nightly 105.0a1 build and also on the new Beta 104.0b6.
We have verified this on Google 2 XL with Android 11 and Samsung S9 with Android 11. |
@cpeterso @athomasmoz FYI: we've landed the patches in Nightly and 104. After the next 104 release, we can start the experiment. |
Awesome. 104 will be released next week on 2022-08-23. We can try to launch the TCP experiment soon after. |
As part of mozilla-mobile/fenix#26041, we need to ensure we have at least version 93.6.0 of the plugin downloaded. The reason we are not using a newer version, even though they are available, is to reduce the complexity of things that go into the next AC release in order to get the Fenix experiment launched.
Steps to reproduce
Expected behaviour
Actual behaviour
Device name
Google Pixel 2XL, Samsung s9
Android version
Android 11, Android 10
Firefox release type
Firefox Nightly
Firefox version
103.0a1 and 104.0a4
Device logs
No response
Additional information
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: