Technical debt: Main-thread and lifecycle issues, and split oversized code

XMLWordPrintable

      Format

      Scale target: no change in behaviour. App start, logout, ABHA flows and beneficiary sync must not get worse at 100,000 records, scaling up to 1,000,000. Which record types count: [TBD/CLARIFICATION REQUIRED]

      Background / Context

      The app has known technical-debt issues that affect privacy, responsiveness and stability. Aadhaar and fingerprint data can appear on screen, some work runs on the main thread, screens leak memory after they close, and a few classes and methods have grown too large to test or change safely.

      Problem Statement

      • Aadhaar and fingerprint (PID) data are shown in toasts in release builds. [TBD]
      • Logout calls Thread.sleep(2000) on the main thread, so the app freezes for 2 seconds.
      • ABHA tokens are cleared when the screen rotates. CreateAbhaFragment re-submits the mapping when its view is recreated and writes the ABHA card to public Downloads on the main thread.  [TBD]
      • Resources.getFont is used below API 26, but minSdk is 25, so it can crash on Android 7.1.
      • About 18 fragments clear _binding in onDestroy instead of onDestroyView, or never clear it. Some collect Flows on the fragment scope, and SplashActivity starts animators that run forever and are never cancelled.
      • 34 files are over 800 lines. BenRepo.getBenCacheFromServerResponse is about 625 lines and DiagnosticOrderRepo.fetchBeneficiariesByStatus about 524. Ben.kt (2,520 lines) mixes the Room entity, network DTO and mapping code.

              Assignee:
              Ashutosh Gupta
              Reporter:
              Nimisha Gupta
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: