Repository navigation
feat: add Search and Households to navigation drawer - #2
Merged
Merged
Conversation
Search is disabled when the user has no households; uses the first household's ID when tapped (consistent with how search is scoped). Households link surfaces household management without going through Settings.
spdotdev
added a commit
that referenced
this pull request
Jul 14, 2026
…for the 8 CI-only instrumented races
CI logcat from the actual failing run (fetched via `gh run download`) showed
these 8 tests are NOT reproducible locally (API 34/google_apis/pixel_6/
swiftshader, animations off, even CPU-throttled to 2 cores — CI's own
`cores: 2` — across three separate full/partial local runs, 65/65 clean).
The failure is CI-hardware-speed-dependent, not API-level-dependent.
Two real findings from the CI evidence, not guesswork:
1. REAL APP BUG (LeaveHouseholdFlowTest): HouseholdEditScreen's
`viewModel: HouseholdsViewModel = hiltViewModel()` default resolves
against ITS OWN back-stack entry, a different ViewModelStoreOwner than
HouseholdsScreen's — despite the screen's own doc comment claiming they
share one instance with "no extra round trip". Navigating list -> edit
silently constructs a SECOND HouseholdsViewModel; its init{} re-runs the
same cached-render-then-refreshSilent() sequence as the first, firing an
untracked GET /households the test's mock queue never anticipated (traced
directly in the CI logcat: a 3rd /households hit landing on an exhausted
queue, 2.2s after the list screen's own load). Fixed by scoping
HouseholdEditScreen's viewModel to the HOUSEHOLDS back-stack entry via
`hiltViewModel(navController.getBackStackEntry(Routes.HOUSEHOLDS))` —
same instance, still lazily constructed (an earlier attempt hoisting it
as a default param on InventoryNavHost itself was reverted: that runs the
ViewModel's eager init{} fetch at app start, before login, which broke
HouseholdFlowTest — caught by the local regression suite).
Sharing one instance also means `HouseholdsUiState.left` (one-shot,
consumed via HouseholdEditScreen's LaunchedEffect) had to become
`leftHouseholdId: Long?` instead of a boolean — a boolean would stay
stuck true after the first leave() this session and auto-navigate the
user back out of the next household-edit visit for any OTHER household.
2. Four shelf/location tests (DeleteShelfFlowTest, DeleteShelfStrategyFlowTest
x4, DeleteLocationFlowTest x2) click a row by TEXT right after entering
edit mode, with only waitForIdle() to gate it. ShelvesViewModel.load() /
StorageOverviewViewModel.load() take a cached-render + unsynchronized
refreshSilent() path whenever HierarchyStore's login-triggered walk has
already warmed the shared repository cache — confirmed via CI logcat to
be the ALWAYS-taken path here, not a rare race, since the location tile
these tests click can't even render until that walk has finished.
waitForIdle() has no visibility into that background network work
(confirmed: no IdlingResource is registered anywhere in this suite), so a
click can race a still-in-flight background refresh under CI's slower,
2-vCPU conditions in ways this dev box's much faster hardware never hit,
even throttled to the same core count. EditableRow gets a stable
testTag ("shelf-row-<id>" / "location-row-<id>"), and the 6 affected
tests now wait for that specific tag before clicking — a deterministic,
edit-mode-only handle instead of racing generic text against the
tab/list view transition and any concurrent state update.
No assertion weakened or removed. testDebugUnitTest, ktlintCheck, detekt,
and a full 57/57 connectedDebugAndroidTest run all green locally (API 34
AVD matching CI). Local green does not by itself confirm the CI race is
fixed for #2 (that's the whole reason this was hard to pin down) — a real
CI run against this commit is the actual verification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan