[Crashlytics][2.4] VolunteerActivity.getBinding NullPointerException still crashing in 2.3 (370 events / 214 users in 30 days)

XMLWordPrintable

      Summary

      VolunteerActivity.getBinding NPE (VolunteerActivity.kt:124) is still crashing in release 2.3 and is the crash with the widest user impact in the last 30 days. Fix is required in 2.4.

      Background / Context

      • Source: Firebase Crashlytics, project stoptb-8e404, app org.piramalswasthya.stoptb, 30-day crash view (Oct 12 – Nov 10, 2026).
      • Existing ticket: STOP-779 (RCA-05, fix version 2.5) covers the same root cause group. This ticket tracks the fix for 2.4 because the crash persists across releases from 1.1.4 to 2.3.
      • Crashlytics tags this issue "Repetitive crashes". It has 3 variants.

      Problem Statement

      The app crashes with a NullPointerException when the view binding is accessed in VolunteerActivity after the view has been destroyed.

      Current Behaviour (Actual)

      • Crash: java.lang.NullPointerException in VolunteerActivity.getBinding (VolunteerActivity.kt:124).
      • 370 events / 214 users in 30 days (highest user count of all open crash issues; top OOM issue affects 44 users).
      • Affected versions: 1.1.4 – 2.3.
      • Draft RCA (RCA-05, "Probable Root Cause", not reproduced on device): VolunteerActivity.startCampHubReconnect posts runOnUiThread { refreshCampHubOfflineBanner() }

        from an IO coroutine; _binding is nulled in onDestroy, so the UI update can run after the view is destroyed. Code inspected on branch release-2.2.3 only.

      Expected Behaviour / Requirement

      • VolunteerActivity does not crash when async work completes after the activity view is destroyed.
      • UI updates are skipped (or the work is cancelled) once the view no longer exists.

      User Story

      As a volunteer using the app, I want the app to stay open while the Camp Hub reconnect runs in the background, so that I do not lose my session or work.

      Acceptance Criteria

      • Given the Camp Hub reconnect is running, When the activity is destroyed (rotation, back, backgrounding), Then the app does not crash.
      • Given the activity view is destroyed, When async work completes, Then no UI update is attempted on a null binding.
      • Given the 2.4 build is released, When Crashlytics is checked, Then VolunteerActivity.getBinding shows no new events on 2.4.

      Business Rules / Validations

      • No change to Camp Hub reconnect behaviour or the offline banner content. [TBD/CLARIFICATION REQUIRED if any change is intended]

      Dependencies

      • Related: STOP-779 (RCA-05). Proposed actions CAPA-12 and CAPA-13 in StopTB_Crashlytics_RCA.xlsx.

      Impact / Affected Areas

      • VolunteerActivity (volunteer flow), Camp Hub reconnect and offline banner.
      • Same pattern seen in NewBenRegFragment, TBScreeningFormFragment and SignInFragment (getBinding NPE); not in scope of this ticket unless confirmed.

      Out of Scope

      • Other getBinding NPE sites (tracked under STOP-779).
      • Camp Hub connectivity logic changes.

      QA / Testing Considerations

      • Rotate and background the app during Camp Hub reconnect; confirm no crash (per CAPA-12 validation).
      • Exit the activity while reconnect is in progress.
      • Verify in Crashlytics after the 2.4 rollout.

      Open Questions / Clarifications

      • Why are 214 users affected when the sheet found only one code path? Other trigger paths for the 3 variants need to be confirmed. [TBD/CLARIFICATION REQUIRED]
      • Which build is the baseline for the fix: release-2.3 or the 2.4 branch? The RCA analysed release-2.2.3.

              Assignee:
              Ashutosh Gupta
              Reporter:
              Shivani Garg
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: