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

Project introduction #4

Closed
5 tasks done
BenHenning opened this issue Aug 1, 2019 · 0 comments
Closed
5 tasks done

Project introduction #4

BenHenning opened this issue Aug 1, 2019 · 0 comments
Assignees
Labels
Priority: Essential This work item must be completed for its milestone. Z-ibt Temporary label for Ben to keep track of issues he's triaged.

Comments

@BenHenning
Copy link
Member

BenHenning commented Aug 1, 2019

The initial Android Studio project structure should be introduced with each of the 5 modules described in the technical design document, with some interactions between them. These modules comprise of:

  • App module: this contains the frontend Android code & UIs
  • Data-specification module: this contains protos to be used in other modules as the domain model
  • Domain module: this contains business logic to be consumed by the app module
  • Data source module: this contains code that interacts with the disk and Oppia's backends to provide data needed by the domain module; to be consumed by the domain module
  • Utility module: this contains reusable UI utility components, and the data source mechanism that's used to share data between the data source and domain modules
@BenHenning BenHenning self-assigned this Aug 1, 2019
@BenHenning BenHenning added the Priority: Essential This work item must be completed for its milestone. label Aug 1, 2019
@BenHenning BenHenning added this to the Proof of concept milestone Aug 1, 2019
BenHenning added a commit that referenced this issue Aug 23, 2019
* Migrate ListenableFuture to a Kotlin coroutine, and split HomeActivity
into both an activity and a fragment.

* Introduce the domain and testsupport modules.

The domain module includes a user app history controller that provides
instances of a new AsyncResult interface that's meant to be a potential
bridge between Kotlin coroutines and LiveData. The exact design of how
this should work needs to be determined as part of #6.

This also includes a new testsupport module that's required due to
robolectric/robolectric#4736. This is supporting a
new test for the app history controller that leverages an AndroidX
activity scenario to test the live data.

Note that the test does not yet work since there's a race condition
between the LiveData's coroutines completing and the test continuing to
verify the state of the activity. This needs to be resolved, likely by
waiting for test visual elements to change based on the LiveData result.

Additional tests need to be added for other new components, and some
slight cleaning up may be necessary.

* Fix binary build: testsupport should only be depended on for tests, not
for production configurations.

* Further attempts to try and test the asynchronous behavior of the new
LiveData + kotlin coroutine system.

This introduces a custom LiveData to mediate between Kotlin coroutines
in a way that allows tests to actually ensure the coroutines resolve
quickly, and ensure lifecycle safety through standard LiveData
mechanisms.

However, this doesn't actually fix the underlying tests (which have been
changed in a number of ways in this commit in an effort to try and get
them to pass). The kotlinx coroutine deps were downgraded to work around
a NoSuchMethodError (see
Kotlin/kotlinx.coroutines#1331). After
introducing a runBlockingTest structure and updating the user app
histoyr controller to use the test context, the operations seem to work
correctly. However, one job is hanging which is causing the test to
still fail (it appears to be deadlocked--no known amount of time allows
it to resolve).

This new NotifiableAsyncLiveData also appears to break the production
behavior, as well. The LiveData result is no longer being observed by
the data binding transformation function, so it seems the coroutines
aren't being executed, aren't completing, or something is deadlocking
somewhere. Further investigation is needed.

* Fix the app not properly binding to the live data by ensuring the data
binder had the view model set properly. Fix resource binding issues in
Robolectric tests by ensuring binary resources are provided to
Robolectric. Fix the controller tests not working by introducing a
temporary, custom CoroutineLiveData that ensures no long-living jobs
continue running after the live data is completed.

* Clean up tests (we no longer need a testsupport module for this module
introduction).

* Add test for AsyncResult. Set code style for Groovy files & clean up all
build gradle files. Add missing newlines at end of various files.

* Reformat top-level build.gradle file, as well.

* Address review comments: replace name-based TODOs with issues.

* Address review comments: add EOF new lines.
@rt4914 rt4914 closed this as completed in bda2f7c Sep 3, 2019
BenHenning added a commit that referenced this issue Sep 3, 2019
JishnuGoyal referenced this issue in JishnuGoyal/oppia-android Sep 8, 2022
…alised-names

Profiles cant have internationalised names
@BenHenning BenHenning added the Z-ibt Temporary label for Ben to keep track of issues he's triaged. label Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Essential This work item must be completed for its milestone. Z-ibt Temporary label for Ben to keep track of issues he's triaged.
Development

No branches or pull requests

1 participant