-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MBL-658] Replace Real Optimizely Client With Mock #1810
Conversation
[ | ||
OptimizelyFeature.commentFlaggingEnabled.rawValue: false, | ||
OptimizelyFeature.consentManagementDialogEnabled.rawValue: false, | ||
OptimizelyFeature.facebookConversionsAPI.rawValue: false, |
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.
Yes we can remove this one since the CAPI code is gated behind the user's consent preferences instead of this flag
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.
Looks like we just need to update some optimizely tests to reflect the removal of the conversions flag. Good to go after that.
Ran through the Developer QA steps and everything was working as expected π
Thanks for quick and thorough review on this! I just have to fix the tests and we'll merge |
π² What
To address our deadline of shipping the removal of Optimizely by April 17, here is a tiddy solution that should hold us over until we implement our next feature flagging tool. Probably Firebase Remote Config.
This document goes into more detail about the hows and whys.
π€ Why
Removing Optimizely saves us an expensive subscription that can be replaced for free by more useful tools like Firebase Remote Config.
π How
MockOptimizelyClient
is actually a 1-1 replacement of the core functionality of the realOptimizely
client.In fact we pass around a
OptimizelyClientType
which is a protocol that is mapped to the functions used inOptimizely
. we pass it around via ourAppEnvironment.current.optimizelyClient
singleton variable.MockOptimizelyClient
conforms to this protocol.So in the sake of saving the time to remove each individual flag throughout our app, why not hardcode those values as they are now on
Optimizely
dashboard?We don't need to worry about older versions either, because as that document goes into more detail, even if the configuration of the real Optimizely SDK fails, we handle all experiments as a
control
case and all features as afalse
case. So at worst features that were enabled for versions 5.4.0 (project story tab), 5.5.0 (stripe payment settings) and 5.6.0 (stripe payment sheet) stop working until users update to this version 5.7.0. No crashes should occur because we handle the errors in our use cases.Updating those users is probably going to be a campaign with in-app notifications down the line.
The thing to note is this
MockOptimizelyClient
is good enough that it covers of the entire scope of work for this ticket. So none of the subtickets need to be done until we actually have Remote Config setup to create that feature/experiment.Aside: To get a sense of our active daily users for each version, check our app analytics in the document above.
β Acceptance criteria
β° Developer QA
Step 1. Record the optimizely variable values after launching this pr in a build. Hint: use breakpoints
Experiments
DiscoveryViewModel
activateNativeProjectCardsExperiment
β> .controlOptimizelyExperiment
nativeProjectCardsExperimentVariant
β> .controlAppDelegateViewModel
shouldSeeCategoryPersonalization
β> .controlAppDelegateViewModel
shouldGoToLandingPage
β> .controlDiscoveryPageViewModel
shouldShowPersonalization
β> .controlFeatures
AppDelegateViewModel
featureConsentManagementDialogEnabled
β> falseProjectPamphletMainCellViewModel
featureProjectPageStoryTabEnabled
β> trueProjectNavigationSelectorViewModel
featureProjectPageStoryTabEnabled
β> trueCommentCellViewModel
featureCommentFlaggingIsEnabled
β> falsePledgePaymentMethodsViewModel
featurePaymentSheetEnabled
β> truePaymentMethodsFooterView
featureSettingsPaymentSheetEnabled
β> trueAppDelegateViewModel
featureConsentManagementDialog
β> falseOptimizelyFeatureFlagToolsViewModel
comment flagging
isEnabled fromServer == false,isEnabledFromUserDefaults
nilconsent management
isEnabledfromServer == false,isEnabledFromUserDefaults
nilconversions_api
isEnabledFromServer
== false,isEnabledFromUserDefaults
nilfacebook deprecation
isEnabledFromServer
== false,isEnabledfromuserDefaults
nilpayment sheet
isEnabledFromServer
== true,isEnabledFromUserDefaults
nilproject story tab
isEnabledFromServer
== true,isEnabledFromUserDetauls
nilsettings payment sheet
isEnabledFromServer
== true,isEnabledFromUserDefaults
nilUntested experiments:
native_onboarding_series_new_backers
Untested features:
ios_facebook_deprecation
,ios_facebook_conversions_api
Step 2. Ensure UserDefaults is being activated through Beta tools
[Experiments are not stored in UserDefaults]
Instructions: a) turn on/off feature through Optimizely Feature Flags. b) kill app, donβt delete, relaunch through XCode c) ensure feature is being displayed as expected.
To record values, you might need to set breakpoints. Should be opposite values of what's recorded above.
CommentCellViewModel
featureCommentFlaggingIsEnabled
β> trueAppDelegateViewModel
featureConsentManagementDialogEnabled
β> truePledgePaymentMethodsViewModel
featurePaymentSheetEnabled
β> falseProjectPamphletMainCellViewModel
featureProjectPageStoryTabEnabled
β> falseProjectNavigationSelectorViewModel
featureProjectPageStoryTabEnabled
β> falsePaymentMethodsFooterView
featureSettingsPaymentSheetEnabled
β> trueUntested experiments:
native_onboarding_series_new_backers
β> requires new users.Untested features:
ios_facebook_deprecation
,ios_facebook_conversions_api
β> requires facebook login, unusedStep 3. Repeat for Step 1 for version of app with
Optimizely
and check that variables are being set the same way as this pr buildCaveat:
Things are still named around
Optimizely
so we should update that once we have our new feature flagging tool set up.#βQuestions/Future Work