-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Change FxNimbus/Nimbus startup sequence #25266
Change FxNimbus/Nimbus startup sequence #25266
Conversation
components.analytics.experiments.register(object : NimbusInterface.Observer { | ||
override fun onUpdatesApplied(updated: List<EnrolledExperiment>) { | ||
restore() | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it Ok if we added as part of the existing onUpdatesApplied?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I combined the two observers into one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏽
} | ||
|
||
private fun setupMessaging() { | ||
if (!FeatureFlags.messagingFeature) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jhugman is it OK to remove the Settings.isExperimentationEnabled
check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you're already checking isExperimentationEnabled
in the HomeFragment
, in which case I don't know what the desired behaviour is (if the user flips the studies switch, should they start seeing messages immediately, or on the next startup?).
This is a bit strange, but I added back in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested manually and it works expected.
I would prefer if we could reuse the existing event listener, instead of introducing a new one, I also tested this alternative and it worked as expected too.
c36d989
to
a627077
Compare
FxNimbus.api = NimbusDisabled(testContext) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does removing this do exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The api
property is no longer public; this is no longer the way we want to initialize the FxNimbus object.
This is a reup of the #25089 and #25234.
The problem seemed to be two fold:
MessagingAction.Restore
was being called from theonExperimentsFetched
observer method.This caused the message not to be ready for the first display of the home screen, which was caught by the performance test.
The fix is to move the restore action to be dispatched explicitly after the nimbus SDK is ready.
Pull Request checklist
To download an APK when reviewing a PR: