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

Fix #4833, #4834, #4835, #4838, #1050, #4519, #4522, #4837, #4836, #4855, #4856: Assorted alpha MR6 fixes #4846

Merged
merged 45 commits into from
Mar 10, 2023

Conversation

BenHenning
Copy link
Sponsor Member

@BenHenning BenHenning commented Jan 19, 2023

Explanation

Fixes #4833
Fixes #4834
Fixes #4835
Fixes #4838
Fixes #1050
Fixes #4519
Fixes #4522
Fixes #4837
Fixes #4836
Fixes #4855
Fixes #4856

This PR introduces a variety of fixes and user quality-of-life improvements in preparation for the start of the upcoming multi-week user research project in Kenya. This PR covers 9 different issues in one shot to keep the PR management simpler due to the time sensitive nature of these changes, so it's on the larger side. Please note that:

  • These changes have been released to a user study specific release track since the research project is currently ongoing.
  • Many of these changes will impact users outside of the study, as detailed below.

The specifics of the PR will be split across the different issues being addressed, in categories below.

Improvements to solutions

#4833 needed to be addressed because the previous terminology ("reveal") has been found to be confusing to learners who might not yet have a strong grasp on English. This string update will, unfortunately, not be translated for the upcoming study (though the study predominantly uses English). This change affects all users of the app.

#1050 is a long-standing issue wherein solution answers would only show up correctly if they were either text or a fraction. This PR fixes the issue by introducing generic answer support, expanding it to include: numeric input, numeric expression, algebraic expression, algebraic equation, and ratio expression. The only missing interaction that web supports is drag & drop, but this has been found to not be needed for the current shipped list of topics (as now enforced by an update to the content import pipeline) and introducing support for it would nontrivially increase the complexity of that side of the PR. This is something that, like other interactions, will be added in the future once needed. This fix will affect all users of the app.

Improvements to voiceover telemetry

#4834 was addressed by introducing a new event to track explicit voiceover pauses (i.e. those that require clicking the 'pause' button and not the ones that are automatic, such as autoplay ending or the user navigating away from the lesson player). Because of the nature of the 'play voiceover' event (that it is logged both for clicking the 'play' button and when expanding the audio bar due to autoplay), it's possible for the play & pause event counts to not be equal. The intent behind these events is to track explicit user actions, not the occurrences of voiceovers playing/not playing. This event will be logged for all users, though sensitive identifiers will only be logged if the user study feature is enabled.

#4835 was addressed by updating both the existing 'play voiceover' and new 'pause vocieover' events to include the lesson player-reported language code (that is, the language code originating from Oppia web). We may change this to be something more strongly ensured (since Oppia Android is a bit more careful in its language code management due to Android complexities), but the code should be generally usable as-is for data purposes as it's implemented. This change will affect telemetry for all users of the app.

Improvements to concept card availability

#4519 and #4522 were addressed by adding support for opening concept cards both in concept cards themselves, and from hints. As of this PR, just about all cases of lesson HTML rendering should now include support for linkifying and opening concept card references. Since both hints and concept cards are dialogs, the behavior is that the newly opened concept card dialog "stacks" on top of the existing, open dialog (i.e. closing the concept card will show the original dialog from which it was opened). This change affects all users of the app.

Miscellaneous language improvements

#4837 was addressed to clean up a variety of extraneous spaces & newlines that were unintentionally added by translators for Swahili strings. These have a direct user benefit but are otherwise innocuous, non-semantic changes. This fix technically affects all users of the app, but only those who use the Swahili translations will actually interact with the changed strings.

Study-specific improvements

#4838 was addressed by introducing a new link in the profile edit flow for administrators to access the previously developer-only flow for manually marking certain chapters as completed. This newly exposed mechanism allows study facilitators to set up profiles so that learners can begin at a specific point (which is particularly helpful if the data on the device ever needs to be reset, such as in the case where the administrator forgot their PIN). This change will only affect user study administrators as it's locked both behind the admin account and the learner study flag. The functionality will be available on production-optimized builds (that is, it won't be restricted to developer-only build flavors of the app).

#4836 was addressed by introducing a floating button within the lesson player for lesson cards whose content have available Swahili translations to quickly switch the content language between English and Swahili. This doesn't change app strings, only content strings, and only temporarily for the lifetime of that specific play session (that is, if they exit the lesson & return immediately they will still be in the switched language until the app itself restarts). This button only appears if the study feature is enabled and has been enabled for that user by the administrator profile (via a new setting on the "Edit Profile" screen). This button also has its own new event to track its usage.

A "share IDs" button was added to make it easier to share the device & learner IDs by collating the IDs into a single blob of text that can be shared to any app that accepts text intents. This is meant to help reduce potential error by study coordinators.

Content display improvements

#4855 was addressed by changing a lot of how custom LI/OL tags are handled. Specifically, Android will automatically shift the leading span of cascading bullets/numbers, but the previous implementation was using the wrong value for each nested span's parent's leading margin (which is needed to adjust what leading margin to use for the child span). This was fixed by introducing more thorough tracking (which also included a bit of robustness in ensuring larger numbers can be aligned correctly). This doesn't quite match HTML rendering, but it's much closer. Bullet lists were also updated to use squares in addition to filled and open circles (for parity with web HTML), and now uses sizes & spacing that are a bit cleaner to see.

There's still more work to improve edge cases for bullet list rendering (see #4859).

#4856 was addressed by introducing a separate SVG "render size" that, unlike the intrinsic size, is based on the image filename. Since the image filename is given in pixels, there needs to be a translation to dp to ensure consistent viewing across devices. This computation has been implemented with three calculation passes:

  1. Convert the image's target pixel size to "Oppia independent pixels" by using @seanlip's monitor display density as the basis.
  2. Convert "Oppia independent pixels" into Android density-independent pixels.
  3. Adjust the final value using a scalar (since the physical size of an image on @seanlip's display is too large for a small mobile screen, so all images are consistently further scaled down).

There's still more work to improve image rendering (see #4093).

General technical details

Design choices & other details of note:

  • The chapter completion flow was updated to support configuring a confirmation dialog (since the action is permanent). This confirmation only shows for the admin edit profile flow (the developer options menu version still does not show a confirmation).
  • The hints & solution data flow was completely redone in the app layer since much of what it was doing before isn't actually necessary with HelpIndex as it greatly reduces the complexity of managing UI-side hint state. Since solutions were being updated, anyway, this unrelated complexity has been reduced (and other issues like directly constructing an injectable view model were addressed).
  • Solution titles were previously set to their content ID (similar to hints before this was recently fixed), so this was addressed by using a new "Solution" string.
  • Displayed solution answers didn't correctly differentiate between exclusive & example answers. This has been corrected in text (along with how the app generally concatenates the text as the previous approach wasn't very RTL friendly).
  • Generalizing solutions was done by leveraging an InteractionObject for Solution's correct_answer field. No migration is being done here since assets are replaced across releases.
  • There are a lot of changes to both json and textproto assets to accommodate the new correct_answer structure, among other various changes. A few of these were done manually, but most were generated (including new Swahili translations to allow local testing of the in-lesson language switch button).
  • A bug was noticed & fixed wherein states with only a solution (and no hints) would never show the solution.
  • Due to the concatenation strategy for solution correct answer text (see a few points above), the horizontal textual alignment was a bit off. The new approach addresses this (though LaTeX is still a bit off, but it's generally off everywhere in the app).
  • To make the new in-lesson switch language button a bit more consistent and aesthetically pleasing, this PR repurposes the "Start over" button that currently shows on the checkpoint continue screen by making it a generic "secondary button" style (with corresponding colors) and using that both for the start over button and this new secondary button. Per the screenshots below, this seems to work well. The secondary button may also be used elsewhere in the app in the future.
  • Note that some of the work of this PR originates from Fix #4519, #4522: Add concept card link support to hints and concept cards #4529, so it can be considered a replacement for that PR.
  • Only the first test topic was updated to include Swahili translations to help decrease the size of the PR (plus, it's convenient to have non-Swahili lessons to verify cases when the switch button does not show up).
  • The PR fixes an incidental issue with the hints & solution dialog whereby clicking any part of an expanded hint/solution card would collapse it (rather than just the header or collapse icon). This would make clicking links more difficult, and is just generally a likely unexpected behavior from users.
  • The new event log & language code property have been manually verified as logging correctly using the developer Firebase project with debug view enabled.
  • A new event was added to track when users leave revision cards.
  • A bug was found & fixed that led to tab switches in the topic activity not having their corresponding events properly logged.
  • All events have been updated to now include app string, content string, and voiceover languages per-profile for that event (which led to a fairly large amount of complexity around providing access to those languages at a low level like AnalyticsController).
  • A bug was found & fixed around session ID management: previously, the session ID was supposed to be reset upon a new lesson being started but it actually wasn't behaving this way. Per the new needs of analytics, this behavior was changed & fixed to reset upon profile login (so that behaviors for a single user session can be properly correlated).

Noteworthy test & exemption changes:

  • StateRetrieverTest is largely not updated since all of the JSON changes in this PR only affect local development (all Bazel tests & production builds use textproto or binary proto versions of lessons). The tests locally passing plus some basic local ad hoc testing is considered sufficient for the JSON loading pipeline as it will, eventually, go away in favor of textproto (once Gradle is removed since textproto -> binary proto conversion is not easily implemented in the Gradle build environment).
  • Some of the question test suites weren't updated since questions aren't currently enabled, and much of the question pipeline is already covered under state fragment tests. It's likely that the testing matrix for questions will need to be largely refined once they're ready to be enabled, so some of this work was skipped in favor of expediency.
  • Some tests in StateFragmentTest & StateFragmentLocalTest are disabled and can't easily be verified because they would only pass on Espresso and Bazel (due to Robolectric having limitations in language resource handling & Gradle builds not supporting the app's language configurations). Since Espresso tests do not yet work in Bazel, these tests will be verified later (though they have been manually verified as part of development).
  • A bunch of KDoc validity exemptions were removed since those classes are now, as of this PR, fully documented.
  • The test_file_exemptions updates are due to HintsViewModel being split into two new view models, and the general convention on the team to not directly test view models.

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

For UI-specific PRs only

Screenshots showing some of the new functionality

Scenario LTR LTR LTR LTR RTL RTL RTL RTL
Handset Handset Tablet Tablet Handset Handset Tablet Tablet
Portrait Landscape Portrait Landscape Portrait Landscape Portrait Landscape
Fractions solution (exclusive) image image Skipped until requested Skipped until requested image image Skipped until requested Skipped until requested
Numeric solution (exclusive) image image Skipped until requested Skipped until requested image image Skipped until requested Skipped until requested
Ratio solution (not exclusive) image image Skipped until requested Skipped until requested image image Skipped until requested Skipped until requested
Text solution (exclusive) image image Skipped until requested Skipped until requested image image Skipped until requested Skipped until requested
Numeric expression solution (not exclusive) image image Skipped until requested Skipped until requested image image Skipped until requested Skipped until requested
Algebraic expression solution (not exclusive) image image Skipped until requested Skipped until requested image image Skipped until requested Skipped until requested
Math equation solution (not exclusive) image image Skipped until requested Skipped until requested image image Skipped until requested Skipped until requested
Switch English to Swahili image image Skipped until requested Skipped until requested image image Skipped until requested Skipped until requested
Switch Swahili to English image image Skipped until requested Skipped until requested image image Skipped until requested Skipped until requested
Mark chapters as completed (in profile edit) image image image image image image Skipped until requested Skipped until requested

A couple things to note:

  • Switching from English to Swahili & back is a bit awkward in the RTL screenshots (partly because the RTL layout is maintained despite switching the content language). This isn't actually a realistic scenario to occur, but it's technically possible so demonstrating it above still makes sense. There are no plans to refine this flow.
  • The landscape screenshots for the profile edit screens clearly show a broken "Profile Deletion" button placement. This is unfortunately an issue already on develop, and "Profile Deletion" button is misaligned in landscape on a phone #4852 has been filed to track this.

Videos demonstrating different changed/new flows

Scenario Video demonstration
Switch language in-lesson https://user-images.githubusercontent.com/12983742/213829720-075cbb64-cc5a-4a08-ab3b-f6d123650fac.mp4
Mark chapters completed https://user-images.githubusercontent.com/12983742/213829850-e0e157c1-520b-4ff1-86f8-470eb8c37536.mp4
Open concept card from hints & other concept cards https://user-images.githubusercontent.com/12983742/213829894-28228cf9-4c0a-4eca-a617-325676b8d538.mp4
Accessibility flow for solutions (fractions, numeric, ratios, text) https://user-images.githubusercontent.com/12983742/213830378-a56235c2-bc78-4c1f-9248-9531ae0f024d.mp4
Accessibility flow for solutions (numeric expressions, algebraic expressions, math equations) https://user-images.githubusercontent.com/12983742/213830403-b964485b-9b49-43b8-9dfd-35f904c0974e.mp4

Espresso test results

The following tests have been modified as a result of this PR:

  • MarkChaptersCompletedActivityTest
  • MarkChaptersCompletedFragmentTest
  • ExplorationActivityTest
  • StateFragmentTest
  • ProfileEditFragmentTest
  • StoryFragmentTest
  • NavigationDrawerActivityDebugTest
  • ConceptCardFragmentTest

I have not run the Espresso tests for these suites. I ran into some issues getting the suites to kick off locally, and I won't have time to investigate this for a bit due to other competing priorities. Reviewers: please let me know if you would like these run and I will prioritize accordingly (I'm leaning toward not running them since many of the Espresso tests are already failing on develop, and we have no viable way to keep them passing until we can run them in CI).

This fixes a bunch of Swahili string bugs by stripping out unnecessary
prefixed whitespace.

This also introduces a fast language switch bar between English and
Swahili. It's not currently tested or gated behind a platform flag, but
both of these will be changed if the team decides to proceed with this
solution.
This adds support for opening concept cards from hints, solutions, and
other concept cards.
Conflicts:
	app/src/main/java/org/oppia/android/app/player/state/StateFragmentPresenter.kt
	app/src/main/res/layout/state_fragment.xml
	app/src/main/res/values-sw/strings.xml
	app/src/main/res/values/untranslated_strings.xml
Fixes:
- Removed extra spacing around a few Swahili strings (all should now be
fixed).
- Replaced 'reveal' English wording with 'show'.
- Added a new event for logging voiceover pausing.
- Updated the play/pause voiceover events to include language codes.

Documentation and/or tests may not yet be completed.
Conflicts:
	app/src/main/java/org/oppia/android/app/hintsandsolution/HintsAndSolutionDialogFragmentPresenter.kt
	app/src/main/java/org/oppia/android/app/player/exploration/ExplorationActivity.kt
	app/src/main/java/org/oppia/android/app/topic/conceptcard/ConceptCardFragmentPresenter.kt
	domain/src/main/assets/test_exp_id_2.json
	domain/src/main/assets/test_exp_id_2.textproto
With the learner study parameter enabled, admins can now force-complete
lessons on a per-profile basis for all profiles in the app. This
leverages the existing developer-only options menu so this isn't
something we would want to incorporate in the long-term without more
refinement (none of the UI strings are even translated).
This also adds Swahili translations for test topic 0. Some style changes
including support for a secondary button type. Updated the in-lesson
language switcher to use this style & to be gated behind the learner
study platform parameter.

And, fixes hint & solution header expanding to be the whole header and
not the whole card.
This also includes a rebuild of much of the hint/solution data flow
since the previous version had a lot of unnecessary complexity. It also
redefines the internal representation for solution answers (which makes
them type-safe during data retrieval time).
(The intent of this issue is being tracked separately and will be
addressed on this branch in a follow-up commit).
Conflicts:
	app/src/main/res/drawable/secondary_button_background.xml
	app/src/main/res/layout/state_fragment.xml
	app/src/main/res/values/component_colors.xml
	app/src/main/res/values/styles.xml
This includes:
- Post-merge fixes
- A change to make the switch lang button container transparent so that
the continue & submit buttons are still clickable through it
- A fix to work around a databinding bug that can sometimes cause a
crash that would be 100% reproducible for a specific build of the app
(since it's a bytecode-level issue)
Also, clean up component_colors.xml (noticed during PR self-review) and
miscellaneous other code health adjustments.
Copy link
Sponsor Member Author

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Finished a first pass full self-review.

app/src/main/AndroidManifest.xml Outdated Show resolved Hide resolved
model/src/main/proto/oppia_logger.proto Outdated Show resolved Hide resolved
Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

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

Thanks @BenHenning, took a pass and commented on what I could.

Copy link
Sponsor Member Author

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Finished a second self-review. Didn't notice anything worth fixing this time around.

- Fixes a test broken in Gradle.
- Repurposes a now unused color for the new secondary button style.
- Fixes landscape support in profile_edit_fragment for the new modify
progress flow.
@BenHenning BenHenning changed the base branch from develop to adjust-version-codes-based-on-flavors March 1, 2023 00:22
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Mar 1, 2023
@BenHenning BenHenning changed the title Fix #4833, #4834, #4835, #4838, #1050, #4519, #4522, #4837, #4836: Assorted alpha MR6 fixes Fix #4833, #4834, #4835, #4838, #1050, #4519, #4522, #4837, #4836: Assorted alpha MR6 fixes [Blocked: #4851] Mar 1, 2023
@oppiabot
Copy link

oppiabot bot commented Mar 8, 2023

Hi @BenHenning, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Mar 8, 2023
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Mar 10, 2023
Base automatically changed from adjust-version-codes-based-on-flavors to develop March 10, 2023 07:04
@BenHenning BenHenning changed the title Fix #4833, #4834, #4835, #4838, #1050, #4519, #4522, #4837, #4836: Assorted alpha MR6 fixes [Blocked: #4851] Fix #4833, #4834, #4835, #4838, #1050, #4519, #4522, #4837, #4836: Assorted alpha MR6 fixes Mar 10, 2023
@BenHenning BenHenning changed the title Fix #4833, #4834, #4835, #4838, #1050, #4519, #4522, #4837, #4836: Assorted alpha MR6 fixes Fix #4833, #4834, #4835, #4838, #1050, #4519, #4522, #4837, #4836, #4855, #4856: Assorted alpha MR6 fixes Mar 10, 2023
@BenHenning
Copy link
Sponsor Member Author

PTAL @seanlip for the final follow-up changes (as explained in the latest changes to the PR description in 2 recent edits). I've self-reviewed this code, and recently worked through multiple areas (for analytics and the learner study screen) as part of #4896.

@MohitGupta121 PTAL as well since I think you have open conversation threads (please verify & mark them as resolved if you're happy with the latest changes).

@BenHenning BenHenning enabled auto-merge (squash) March 10, 2023 07:40
Copy link
Member

@MohitGupta121 MohitGupta121 left a comment

Choose a reason for hiding this comment

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

@BenHenning LGTM,
I think I not see "mark resolved" in conversations due to permission issue. So you can mark them as resolved.
Thanks.

@MohitGupta121 MohitGupta121 removed their assignment Mar 10, 2023
@oppiabot
Copy link

oppiabot bot commented Mar 10, 2023

Hi @BenHenning, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks!

@BenHenning
Copy link
Sponsor Member Author

No problem, thanks @MohitGupta121!

@seanlip since this is set to auto-merge, I'm going to wait to resolve @MohitGupta121's comments until after you approve (or, you're welcome to resolve them after approving if you'd like to merge the PR).

@BenHenning BenHenning merged commit 0290ef8 into develop Mar 10, 2023
@BenHenning BenHenning deleted the assorted-alpha-mr6-fixes branch March 10, 2023 08:39
@seanlip
Copy link
Member

seanlip commented Mar 10, 2023

Whoops, I didn't realize resolving the comments would result in the PR getting merged.

That said, I'm fine with merging. I read through the comment updates but I didn't look at the code carefully, and the edited description looks fine to me. Thanks!

BenHenning added a commit that referenced this pull request Mar 10, 2023
## Explanation
Fixes #4897

### Overview of changes

This PR follows up from the changes introduced in #4846 by adding new
functionality to help improve event reliability investigations, as well
as telemetry diagnostics for research project facilitators that need to
ensure events have been successfully uploaded for processing. To help
with this, the following features have been introduced:
- A new "force upload" button that immediately uploads any pending
cached events.
- Event counts to show both the number of events waiting to be uploaded
& the events that are successfully uploaded.
- An improvement on the 'share' button to include a Base64 deflated
binary representation of the entire event log store on the device.

Leading up to, and during, development, a number of theoretical issues
were encountered that were also fixed in case they are playing a role in
some of the ongoing concerns around Firebase event delivery reliability:
- The sync status reported on the learner analytics screen can be wrong
in some cases, leading to the assumption that events have been uploaded
when they may not have been.
- Events can, in some cases, be lost from previous app instances if they
haven't been uploaded yet and, in other cases, duplicated. The former is
much more likely to happen in practice, particularly with the
connectivity patterns being used in the research project.

### Technical specifics

- ``FakeSyncStatusManager`` was renamed to ``TestSyncStatusManager``
since it's actually augmenting the production implementation of
``SyncStatusManager``, not replacing it.
- Events are now being cached indefinitely if the learner study feature
is enabled. This allows for some robustness improvements (see below),
and the ability to share the events themselves if the team suspects
events are not arriving to Firebase.
- The issue of sync status being incorrect came from an unreliable means
of reporting sync status during different event scenarios. Specifically,
if the ``LogUploadWorker`` doesn't kick off and there's network
connectivity, a new event being logged could trigger the sync status to
become "data uploaded" even though there are still pending events. The
new solution is to leverage the now-tracked uploaded events to determine
whether there are still events yet waiting to upload. In this way, the
sync status should always be the most up-to-date information with one
caveat: network connectivity changes won't reflect until a new log is
requested (this is a limitation in how the app tracks network
connectivity, and it didn't seem very important to fix it).
- The issue of possible event duplication comes from
``PersistentCacheStore`` using ``mergeFrom`` with the *current* cached
state and the on-disk proto being loaded. I originally thought that all
pathways to loading the proto from disk could only execute once, but
there's at least one pathway where it's possible to chain multiple calls
into the cache store such that the load happens twice (and both results
end up being merged together, hence the event duplication). This has
been fixed by never reloading the cache store if it's already been
loaded which should always be correct.
- The issue if possible events being lost comes from
``AnalyticsController`` previously not priming the event log cache. This
means that if a new event is logged before the cache is read (e.g. early
events like "open profile screen" can race against ``LogUploadWorker``
kicking off on app startup) then the cache will be completely reset and,
once written, will overwrite any events currently cached on disk. This
has been fixed by ensuring that the event log cache has been primed
before any interactions with it (read or write) occur.

Note that all of the above has been thoroughly tested through automated
testing to ensure that these issues have been properly fixed, and stay
that way in the long-term.

### Test notes & exemptions

- In order to simplify testing ``SyncStatusManagerImpl`` and
``TestSyncStatusManager``, they ought to both pass a common test suite
specific to ``SyncStatusManager`` itself. This has been done by
introducing a ``SyncStatusManagerTestBase`` class that's inherited by
both implementation test suites so that they inherit common API tests.
This pattern is used in one other location in the codebase currently:
https://github.com/oppia/oppia-android/blob/0290ef8037f798d8ba2721441612a80dec4a1f1a/testing/src/test/java/org/oppia/android/testing/threading/TestCoroutineDispatcherTestBase.kt#L33
- ``CircularProgressIndicatorAdaptersTestActivity`` has been exempted
for an a11y label for the same reason as all other test activities: it
technically doesn't need one.
- ``TestSyncStatusManagerTest`` has been allow-listed to use
parameterized tests since it's aggressively verifying many different
force/override sync status cases. Making sure that the test utility
works correctly is extremely important to avoid false failures/passes of
dependent tests (which are, in turn, guarding against regressions for
the core issues covered by this PR, among other event system behaviors).
- ``SyncStatusManagerTestBase`` has been exempted from requiring KDocs
since it's technically a test suite, so KDocs aren't required.
- A number of classes have been exempted from having new test suites as
per existing conventions and requirements: ``ControlButtonsViewModel``
(renamed from ``ShareIdsViewModel``),
``CircularProgressIndicatorAdaptersTestActivity`` (simple test
activities don't require their own tests),
``CircularProgressIndicatorAdaptersTestViewModel`` (view models aren't
tested directly), ``SyncStatusManagerTestBase`` (the test base is more
or less a test suite itself, so it doesn't make sense for it to have
tests as well).
- ``TestSyncStatusManagerTest`` has been disabled in Gradle since it
depends on ``SyncStatusManagerTestBase`` which is part of a different
module. To make this work, the test base would have to be moved to
src/main of the testing module which isn't a very clean approach. The
current setup works fine with Bazel, and longer term this will get
cleaner by moving testing utilities like ``TestSyncStatusManager`` to be
near their corresponding production implementations (we just can't do
this today because of Gradle limitations).
- Due to the asynchronous and data race nature of some of the issues
discovered during test writing, changed & added tests were sometimes
found to be flaky (and, in some cases, very rarely, e.g. 1/50). To
ensure that all of the new & changed tests are stable, I made sure to
run all 8 affected test suites 128 times to ensure stability. Here are
the results of that run ([buildbuddy
link](https://app.buildbuddy.io/invocation/5da310e1-3cc9-451b-a1d0-951a3322c8d7)):

![128xruns_followup_mr6_fixes](https://user-images.githubusercontent.com/12983742/224290120-5bb2991d-59c1-421a-8b73-e05838734253.png)


## Essential Checklist
<!-- Please tick the relevant boxes by putting an "x" in them. -->
- [x] The PR title and explanation each start with "Fix #bugnum: " (If
this PR fixes part of an issue, prefix the title with "Fix part of
#bugnum: ...".)
- [x] Any changes to
[scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets)
files have their rationale included in the PR explanation.
- [x] The PR follows the [style
guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide).
- [x] The PR does not contain any unnecessary code changes from Android
Studio
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)).
- [x] The PR is made from a branch that's **not** called "develop" and
is up-to-date with "develop".
- [x] The PR is **assigned** to the appropriate reviewers
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)).

## For UI-specific PRs only

Following is a video demonstrating the new functionality introduced in
this PR:


https://user-images.githubusercontent.com/12983742/224289397-73c5e3a7-4f7a-4116-8e71-3316e30fa9d7.mp4

Note that affected UI tests that could run on Espresso were **not**
verified in this PR similar for the reasons listed in #4846
(specifically, the ongoing issue of Espresso tests being time consuming
to investigate, often broken, and this PR being high priority).

Localization & accessibility changes aren't relevant for this change,
and any tablet-specific issues aren't important since the affected
screen is only expected to be accessed on handset devices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment