Week 22: GSoC With OpenMRS — 2022

Amr Salah
4 min readNov 11, 2022

--

Hi everyone!

Finally, this week is the last week for the Android Client Project in GSoC 2022! It has really been an exciting experience to be working on it in this community ❤

This week, we have more work that has been done than usual, I have:

  1. Integrated Hilt Dependency Injection library into the rest of the project. I’ve used Hilt since the start of the project this summer as it is an objective, but now I’ve used it in the project for the rest of classes that is better to be injected with it. Now this objective is completed! Additionally, there were lots of memory leaks in the app — that is discovered by LeakCanary library — that are resolved now by using singleton injections for the repository, logger, and database classes. No more memory leaks or app crashing due to stack overflow anymore!
  2. As a part of the previous point, I have converted BaseRepository from Java to Kotlin.
  3. As a part of the previous point, I have fixed a bug with UpdatePatientWorker being triggered with Result.retry() multiple times. When we try to update a patient while being offline and then going back online, there is a toast that says that the patient is updated. This toast was being shown multiple times. Now, this issue is fixed and updating the patient is done once.

PR:

4. Fixed app crash when trying to download a patient from the server and quickly navigate out of the lastviewedpatients screen.

5. As a part of the previous point, I’ve changed Add Patients menu item in Synced Patients screen to Download Patients to better understand that this button navigates them to lastviewedpatients (and download patients from the server) screen, not locally. Some people had already misunderstood this screen before (and I was one of them), hope now everything gets clearer.

6. As a part of the previous point, I’ve added a Toast message that appears to the user when lastviewedpatients screen starts. With no patients viewed at first, the user may falsely think that there is no patient list to search from. Instead, now the toast tells the user to use the search button to search for patients.

PR:

7. Fixed failing tests of FormResourceRoomDAOTest:

8. Fixed failing tests of ProviderRoomDAOTest:

9. Fixed failing tests of PatientBirthdateValidatorWatcherTest:

Two of these tests were already failing before the start of project, however, the CI in the project’s GitHub repo has not ever discovered them. I’ve fixed these tests, and will report this CI problem to be resolved later.

10. Fixed app crash after login two consecutive times. When trying to login in the app one time, it succeeds without any problems. But if we logout and try to login a second time, it succeeds but crashes the app. This issue is fixed now.

PR:

11. Cleaned obsolete MVP classes and move androidTest classes to the proper package. This last commit is for polishing the project; it’s concerned about removing the old MVP classes and code that are not going to be used anymore.

That’s it for this final coding week! Next, I am going to prepare my final submissions for GSoC 2022. Thank you for your reading. It was a nice experience to be a part of this community and project! ❤

Have a great day!

--

--