[Crashlytics] Crash on unguarded navigate() (navigation action not found) – SignInFragment, AllHouseholdFragment, HouseholdMembersFragment

XMLWordPrintable

    • STOP TB Sprint 12

      Summary

      IllegalArgumentException "navigation action not found from the current destination" on unguarded navigate() calls (likely double-tap), across SignInFragment, AllHouseholdFragment and HouseholdMembersFragment.

      Background / Context

      Source: StopTB Android Crashlytics RCA (Oct 15–21 2026, release 2.2.3). RCA ref RCA-04, status: Probable Root Cause. 36 captured events across 5 issues (plus 1 issue with no counts captured). Priority: P1 (SignInFragment, 30 events), P3 for the rest.

      Problem Statement

      findNavController().navigate(actionId) runs when the NavController is already at (or moving to) the target destination.

      Current Behaviour (Actual)

      navigate() is called straight from click or checked-change listeners with no currentDestination check or debounce. There is no shared safe-navigation pattern in the app. Slow screens and tablets make double-taps likelier. The double-tap trigger is inferred from the error message, not observed.

      Crashlytics issues:

      1. SignInFragment.onViewCreated$lambda$5 (SignInFragment.kt:185) — 30 events / 21 users — 1.1.4→2.2.3 — current destination = campModeConnectFragment
      2. AllHouseholdFragment.openHouseholdDetails (:161) — 3 / 3 — current = newHouseholdFragment
      3. AllHouseholdFragment.openHouseholdMembers (:176) — 2 / 2 — current = newHouseholdFragment
      4. AllHouseholdFragment$onViewCreated$3.invoke (:130) — 1 / 1 — current = newHouseholdFragment
      5. HouseholdMembersFragment.openMemberForm (:303) — event/user counts not captured (list truncated), first seen 2.2.3 — current = newBenRegFragment (file not inspected)

      Expected Behaviour / Requirement

      Repeated or late taps/events must not crash the app; navigation is executed at most once per intended action.

      User Story

      As a field user, I want repeated taps on slow screens to be handled safely, so that the app does not crash during sign-in or household workflows.

      Acceptance Criteria

      • Given the affected screens (SignInFragment, AllHouseholdFragment, HouseholdMembersFragment), When the user double-taps the navigation control, Then the app navigates once and does not crash (CAPA-10).
      • Given each flagged navigate() call, When invoked, Then it is guarded by a currentDestination check or a safeNavigate helper.
      • (Preventive, CAPA-11) Given the safeNavigate helper adopted app-wide and a lint rule against raw navigate() in click listeners, When lint runs, Then it passes and no raw calls remain.

      Business Rules / Validations

      None identified.

      Dependencies

      None identified.

      Impact / Affected Areas

      SignInFragment.kt:185, AllHouseholdFragment.kt:130/161/176, HouseholdMembersFragment.kt:303; any other raw navigate() call sites if CAPA-11 is included.

      Out of Scope

      Redesign of navigation graph.

      QA / Testing Considerations

      Double-tap test on the affected screens, on slow devices/tablets; confirm no new IllegalArgumentException events post-release.

      Open Questions / Clarifications

      • HouseholdMembersFragment not inspected [TBD].
      • Is app-wide adoption + lint rule (CAPA-11) in scope for 2.5, or limited to flagged call sites?

      Source: StopTB_Crashlytics_RCA.xlsx (RCA-04, CAPA-10, CAPA-11).

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

                Created:
                Updated: