Skip to content

Conversation

@marcosholgado
Copy link
Contributor

@marcosholgado marcosholgado commented Jun 12, 2020

Task/Issue URL: https://app.asana.com/0/72649045549333/1177259750357651
Tech Design URL: See https://app.asana.com/0/72649045549333/1177259750357651
CC:

Description:
Introducing a new flow for users after onboarding to encourage the use of in-browser apps.

Before installing the app from this branch
Go to CtaViewModel line 212/213 and change it to val days = TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis() - timestampKey.timestamp) and change the value from 2 to 1 so it triggers after 1 minute.

Go to AndroidNotificationScheduler line 70/71 and change it to TimeUnit.SECONDS and change the value to 20 so the notification will trigger after 20 seconds instead of 1 day.

Go to UseOurAppMigrationManager and change the weight of defaultMigration to 0.0 and useOurAppMigration to 1.0

Steps to test this PR:

Update from previous version and pixels

  1. Install the app from develop.
  2. See all the Onboarding CTAs.
  3. Go to cnn.com and dismiss the cta.
  4. Go to SERP and dismiss the cta.
  5. Go to instagram.com and dismiss the cta.
  6. Open a new tab and make a search.
  7. Now you should be a established user.
  8. Install and launch the app from this branch.
  9. Keep the app opened to avoid the bug where notifications are not scheduled properly.
  10. You should see "Scheduling unique notification" in the logcat.
  11. Wait 20 seconds (or whatever time you set in AndroidNotificationScheduler).
  12. A notification should show up.
  13. Pixel mnot_s_uoa should be sent (notification seen)
  14. Tap the notification.
  15. Pixel mnot_l_uoa should be sent (notification launched)
  16. Home screen should show and the keyboard hidden showing a new cta.
  17. Pixel m_uoa_d should be sent (use our app dialog seen)
  18. Tap on "Add Facebook Shortcut".
  19. Pixel m_uoa_d_ok should be sent (use our app ok button pressed)
  20. Pixel m_uoa_van should be sent (use our app site visited after notification seen)
  21. The add to home screen dialog should show and user be taken to facebook.com.
  22. Click on Add.
  23. Pixel m_uoa_s_a should be sent. (use our app shortcut added)
  24. A toast message saying the shortcut was added should show (message can vary depending on the device).
  25. A new shortcut with a high-res facebook icon should be created.
  26. You now have a minute to use the app, going to facebook should not trigger any new cta at this point.
  27. Go to facebook before a minute has passed, cta should not be seen.
  28. Close the facebook tab and navigate to facebook again.
  29. Pixel m_uoa_vas should be sent (use our app site visited after adding shortcut).
  30. After a minute (or whatever time you set in CtaViewModel the next time you navigate to Facebook (page has to load) you should see a new Cta.
  31. Pixel m_uoa_dd should be sent (use our app delete dialog seen)
  32. Close the facebook tab and open facebook again in a new tab.
  33. Pixel m_uoa_vad should be sent (use our app site visited after delete cta).

Pixel when visiting use our app URL

  1. From the previous state where you already have a shortcut and have already seen the delete CTA
  2. Close all the tabs with facebook opened.
  3. Use the shortcut to open Facebook.
  4. Pixel m_uoa_vad should be sent (use our app site visited after delete cta).
  5. Log in and navigate in Facebook.
  6. Pixel m_uoa_vad should not be sent again.
  7. Open a new tab and go to Facebook
  8. Pixel m_uoa_vad should be sent (use our app site visited after delete cta).
  9. Navigating in facebook in this tab should not send the pixel again.

Keyboard shown when ignoring cta

  1. Install the app from develop.
  2. See all the Onboarding CTAs.
  3. Go to cnn.com and dismiss the cta.
  4. Go to SERP and dismiss the cta.
  5. Go to instagram.com and dismiss the cta.
  6. Open a new tab and make a search.
  7. Now you should be a established user.
  8. Install and launch the app from this branch.
  9. Keep the app opened to avoid the bug where notifications are not scheduled properly.
  10. You should see "Scheduling unique notification" in the logcat.
  11. Wait 20 seconds (or whatever time you set in AndroidNotificationScheduler).
  12. A notification should show up.
  13. Tap the notification.
  14. Home screen should show and the keyboard should be hidden.
  15. Click in Not Now.
  16. Cta should dismiss and the keyboard shown.

Shortcut opens existing tab if url matches

  1. Launch the app and go to cnn.com
  2. Click the menu and select Add to Home (this will create a shortcut to edition.cnn.com
  3. Click Add
  4. Take note of how many tabs you currently have and close the app.
  5. Using the new shortcut launch the app.
  6. It should reuse the same tab that was previously opened.
  7. Close the tab and create a new one.
  8. Close the app and launch it again using the shortcut.
  9. The app should now create a new tab for editorial.cnn.com
  10. On cnn.com navigate to another cnn webpage by clicking on any article link and close the app.
  11. Launch the app using the shortcut, it should create a new tab taking you to editorial.cnn.com without reusing the previous tab.

Update from previous version hide tips

  1. Install the app from develop.
  2. Go to cnn.com and dismiss the cta.
  3. Click Hide and Hide Tips Forever.
  4. Now you should be a established user.
  5. Install and launch the app from this branch.
  6. Keep the app opened to avoid the bug where notifications are not scheduled properly.
  7. You should not see "Scheduling unique notification" in the logcat.
  8. After 20 seconds or so you should not get the initial notification.

Update from previous version and no established

  1. Install the app from develop.
  2. Install and launch the app from this branch.
  3. Keep the app opened to avoid the bug where notifications are not scheduled properly.
  4. You should not see "Scheduling unique notification" in the logcat.
  5. After 20 seconds or so you should not get the initial notification.
  6. Go to cnn.com
  7. A cta should show since you should still be in the onboarding stage.

Update from previous version but not able to see the experience

  1. Install the app from develop.
  2. See all the Onboarding CTAs.
  3. Go to cnn.com and dismiss the cta.
  4. Go to SERP and dismiss the cta.
  5. Go to instagram.com and dismiss the cta.
  6. Open a new tab and make a search.
  7. Now you should be a established user.
  8. Before installing from the branch change the weights to be defaultMigration to 1.0 and useOurAppMigration to 0.0
  9. Install and launch the app from this branch.
  10. Keep the app opened to avoid the bug where notifications are not scheduled properly.
  11. You should not see "Scheduling unique notification" in the logcat.
  12. After 20 seconds or so you should not get the initial notification.

NEW TESTS
Make sure the weight of useOurAppMigration is 1.0 and the default to 0.0

Update from previous version as established and language not english

  1. Change the language of your phone to Spanish
  2. Install the app from develop.
  3. See all the Onboarding CTAs.
  4. Go to cnn.com and dismiss the cta.
  5. Go to SERP and dismiss the cta.
  6. Go to instagram.com and dismiss the cta.
  7. Open a new tab and make a search.
  8. Now you should be a established user.
  9. Install and launch the app from this branch.
  10. Keep the app opened to avoid the bug where notifications are not scheduled properly.
  11. You should not see "Scheduling unique notification" in the logcat.
  12. After 20 seconds or so you should not get the initial notification.

Creating a shortcut before seeing cta doesn't sent incorrect pixel

  1. Install the app
  2. Create a shortcut to http://m.facebook.com
  3. Pixel m_sho_a should be sent instead of m_sho_uoa_a
  4. Launch the shortcut.
  5. Pixel m_sho_o should be sent instead of m_sho_uoa_o

Internal references:

Software Engineering Expectations
Technical Design Template
0

…marcos/in_app_fb_usage_flow

� Conflicts:
�	app/src/main/java/com/duckduckgo/app/di/DaggerWorkerFactory.kt
�	app/src/main/java/com/duckduckgo/app/di/NotificationModule.kt
�	app/src/main/java/com/duckduckgo/app/notification/AndroidNotificationScheduler.kt
�	app/src/main/java/com/duckduckgo/app/notification/NotificationHandlerService.kt
�	app/src/main/java/com/duckduckgo/app/notification/NotificationRegistrar.kt
�	app/src/main/java/com/duckduckgo/app/statistics/VariantManager.kt
�	app/src/main/res/values/string-untranslated.xml
…ew stage to the logic after onboarding depending on shortcut capabilities.
… github.com:duckduckgo/Android into feature/marcos/in_app_fb_usage_flow
… github.com:duckduckgo/Android into feature/marcos/in_app_fb_usage_flow

� Conflicts:
�	app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt
… github.com:duckduckgo/Android into feature/marcos/in_app_fb_usage_flow

� Conflicts:
�	app/src/androidTest/java/com/duckduckgo/app/browser/BrowserTabViewModelTest.kt
@marcosholgado marcosholgado marked this pull request as ready for review June 25, 2020 16:39
@cmonfortep cmonfortep self-requested a review June 29, 2020 14:12
Copy link
Contributor

@cmonfortep cmonfortep left a comment

Choose a reason for hiding this comment

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

Small feedback related to testing:
Shortcut opens existing tab if url matches works following the steps in the description, but using the home screen icon created inside the FB flow opens a new time each time.

I will continue testing and reviewing the PR, no blocker.

…marcos/in_app_fb_usage_flow

� Conflicts:
�	app/src/androidTest/java/com/duckduckgo/app/browser/BrowserTabViewModelTest.kt
�	app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt
�	app/src/main/java/com/duckduckgo/app/statistics/pixels/Pixel.kt
�	app/src/main/res/values/string-untranslated.xml
Copy link
Contributor

@cmonfortep cmonfortep left a comment

Choose a reason for hiding this comment

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

Thanks @marcosholgado

Code reviewed, sending you some comments which 80% are about naming and 20% myself thinking out loud 🙏

I didn't do a deep QA because some parts are still missing. But I went through all the test steps from the description and everything went well (except for opening multiple tabs when clicking the home screen icon).

@marcosholgado marcosholgado requested a review from cmonfortep July 1, 2020 12:46
Copy link
Contributor

@cmonfortep cmonfortep left a comment

Choose a reason for hiding this comment

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

Code wise is great! I will proceed with testing later today

Copy link
Contributor

@cmonfortep cmonfortep left a comment

Choose a reason for hiding this comment

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

Testing results:
All tests worked as described 👍

Just two questions related to some extra behaviors I've seen:

  • I dismissed by mistake the Add Facebook Shortcut Dialog. So I added the shortcut manually via overflow menu. It triggered the pixel m_uoa_s_a, is that expected?
  • Related to that, I was testing "Update from previous version and no established", so the user is not included in the experience, and if I add the FB shorcut, a pixel is also sent. Don't know if we expect to receive pixels from users that are not part of the "experiment".
  • While testing the first case, I had a tab with FB open. Then I received the first notification, I clicked on it, and m_uoa_van was sent. According to the description, that pixel is supposed to be triggered when I tap on "Add Facebook Shortcut" (which also happened). I don't think is very important, but better to tell about that.

Let me know if everything is fine. If all good and no more changes are needed, I will approve PR.

@marcosholgado
Copy link
Contributor Author

@cmonfortep thanks for the review. I've added a couple new tests in the description at the bottom of it off the back of what we talked about earlier today.

Copy link
Contributor

@cmonfortep cmonfortep left a comment

Choose a reason for hiding this comment

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

💥 Thre's a crash when opening the home screen icon because accessing database from the main thread.

In any case, I continued testing after changing the code (the same I proposed you in the comment) and it works. So we are close to finish this 👍

@marcosholgado marcosholgado requested a review from cmonfortep July 3, 2020 06:20
Copy link
Contributor

@cmonfortep cmonfortep left a comment

Choose a reason for hiding this comment

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

LGTM 👍 ☀️

@marcosholgado marcosholgado merged commit be8442e into develop Jul 3, 2020
@marcosholgado marcosholgado deleted the feature/marcos/in_app_fb_usage_flow branch July 3, 2020 10:03
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.

2 participants