Skip to content

Conversation

@malmstein
Copy link
Contributor

Task/Issue URL: https://app.asana.com/0/488551667048375/1171986548569356

Description:
The Sticky Search Experiment has now finished, it's time cleanup and remove all the experiment code.

Steps to test this PR:

  1. Open the app
  2. Navigate to Setting
  3. Check that Sticky Search setting is no longer present

@subsymbolic subsymbolic self-assigned this Apr 22, 2020
@marcosholgado
Copy link
Contributor

I seem to remember getting translations for some notifications experiment... could it be this one? I've not checked but maybe there are some unused strings in untranslated that need removing :)

@malmstein
Copy link
Contributor Author

Those were not translated but thanks for the reminder!

Copy link
Contributor

@subsymbolic subsymbolic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this, I always enjoy a good cleanup PR. Looks good a few final old remnants of Sticky Search to clear.


@Test
fun whenPrivacyNotificationClearDataAndSearchPromptCanShowThenBothAreScheduled() = runBlocking<Unit> {
fun whenPrivacyNotificationClearDataCanShowThenBothAreScheduled() = runBlocking<Unit> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These test names were changed in the PR you're reverting here and since they are no longer accurate we should put the back to how they were:

  • What is happening: both notification can be shown and then the scheduler scheduled one of them
  • What the test name is saying: both notification can be show (correct) and both are being scheduled (incorrect only one is scheduled)

Happy to pair on this, just ping me on zoom if you would like to.

Timber.i("User changed search notification setting, is now enabled: $enabled")
settingsDataStore.searchNotificationEnabled = enabled
if (enabled){
notificationScheduler.launchStickySearchNotification()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the private val notificationScheduler: AndroidNotificationScheduler from this class now that it is no longer used. Also clean up imports afterwards as you'll have an unused import.

}
}

private fun isSearchNotificationFeatureEnabled(variant: Variant): Boolean {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can delete the import com.duckduckgo.app.statistics.Variant import now too


CHANGE_APP_ICON_OPENED("m_ic"),

QUICK_SEARCH_PROMPT_NOTIFICATION_SHOWN("m_qs_pn_s"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might have done this already, but just in case, can you delete any Grafana references too?


private fun showSearchNotification(enabled: Boolean) {
if (enabled) {
searchNotificationToggle.show()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete the import com.duckduckgo.app.global.view.show and import com.duckduckgo.app.global.view.gone imports too


@Test
fun whenPrivacyNotificationAndClearNotificationCannotShowButSearchPromptCanShowThenNotificationScheduled() = runBlocking<Unit> {
fun whenPrivacyNotificationAndClearNotificationCannotShowThenNotificationScheduled() = runBlocking<Unit> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean whenPrivacyNotificationAndClearNotificationCannotShowThenNoNotificationScheduled?

Copy link
Contributor

@subsymbolic subsymbolic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@malmstein malmstein merged commit 8ba6e4b into develop Apr 27, 2020
@malmstein malmstein deleted the feature/david/remove_sticky_search branch April 27, 2020 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants