Skip to content
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

Issue/11799 show announcement on app upgrade #11804

Merged
merged 12 commits into from
May 6, 2020

Conversation

khaykov
Copy link
Member

@khaykov khaykov commented May 2, 2020

Fixes #11799

This PR adds logic for displaying feature announcements on the app upgrade.

We decided to show announcements independent of app version - eg. if you are on v4 of the app, and there is an announcement in v5, you will see even if you skip v5 and upgrade straight to v6 or v7 (until we remove or replace announcement manually).

To test (using wasabi build):

  • If you install this branch on top of develop - the announcement should be displayed when app starts.
  • If you perform the fresh installation, an announcement will not be displayed.
  • To trigger an announcement bump the versionCode number and restart the app.
  • Make sure the announcement is not shown in vanilla version.

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented May 2, 2020

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented May 2, 2020

You can test the changes on this Pull Request by downloading the APK here.

@oguzkocer
Copy link
Contributor

Hi there! 14.8 is being frozen, so this PR is being bumped to 14.9. If these changes have to be shipped with 14.8, please target release/14.8 and cc me in the PR so I can cut a new beta release. Also if you can keep the release dates in mind and bump the PRs & issues you are working on before the code freeze date, we'd really appreciate it.

Extra notes:
@khaykov There are a couple issues I want to note in this PR:

  • Can you make sure to add a reviewer for the PR when you create it?
  • Since this PR is opened on a Saturday before a code freeze, we expect one of 2 things to happen. Either ping platform9 and tell us that this PR needs to be included in the upcoming code freeze, in which case it really should have a reviewer and a notice that it's urgent. Or, target the next milestone. In the current state of the PR, it's not clear what the intention for the PR is, so we have to assume that it's OK to bump to the next release. Hope that makes sense!

Let me know if you have any questions!

@oguzkocer oguzkocer modified the milestones: 14.8, 14.9 May 4, 2020
@khaykov
Copy link
Member Author

khaykov commented May 4, 2020

@oguzkocer Got it! Sorry, I totally missed that the code freeze is right around the corner for 14.8.

@khaykov khaykov requested a review from develric May 4, 2020 17:22
Copy link
Contributor

@develric develric left a comment

Choose a reason for hiding this comment

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

Hi klym, I went into the code and left one comment about using list of announcements (not feeling strong about it so let me know wdyt). I was going into testing, but unless I'm doing something wrong for me the call to WordPress > initAnalytics (that updates the last versionCode with AppPrefs.setLastAppVersionCode(versionCode);) is called before the WPMainActivity > initViewModel > start (that makes the check on the versionCode); let me know if I'm missing something, thanks 😊

return BuildConfig.VERSION_CODE
}

fun isFeatureAnnouncementEnabled(): Boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are introducing the wrapper, wdyt if we use it in AppSettingsFragment.java Line 172 also?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added the check to AppSettingsFragment in upcoming PR :)

@@ -27,7 +27,11 @@ class FeatureAnnouncementProvider @Inject constructor() {
)
)

fun getLatestFeatureAnnouncement(): FeatureAnnouncement {
fun getLatestFeatureAnnouncement(): FeatureAnnouncement? {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure it's worth nor how much work it can be (so feel free to just say you will never consider doing 😊), but since we are possibly considering expanding the announcements one day to include some of the previous one and to avoid this (sometimes tricky) nullable, maybe we could consider to use a list of FeatureAnnouncement (eventually ordered by app version code or being empty)...wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added the getFeatureAnnouncements(): List<FeatureAnnouncement> method in upcoming PR, but it's not really solving the nullability of the announcement, it just moves the check upstream.

@khaykov
Copy link
Member Author

khaykov commented May 5, 2020

Updated the logic around app versions. Hope I didn't mess up anything this time :)

The announcement should not be shown:

  • Fresh app install.
  • Updating from develop branch to this one without version code change.
  • If the announcement with the same version has been already shown.

The announcement should be shown:

  • When upgrading app (even when you skip some versions) and the announcement was not shown before.

Copy link
Contributor

@develric develric left a comment

Choose a reason for hiding this comment

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

Hi @khaykov 👋! Thanks for the changes, works really well now 👍! LGTM :shipit:

@develric develric merged commit 3f5f061 into develop May 6, 2020
@khaykov khaykov deleted the issue/11799-show-announcement-on-app-upgrade branch June 26, 2020 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

What's new - show feature announcement on app upgrade
3 participants