Skip to content

fix: Maestro search failures from tab-stack poisoning, repair smoke flow - #1292

Draft
skalthoff wants to merge 2 commits into
mainfrom
fix/maestro-search-stack-poisoning
Draft

fix: Maestro search failures from tab-stack poisoning, repair smoke flow#1292
skalthoff wants to merge 2 commits into
mainfrom
fix/maestro-search-stack-poisoning

Conversation

@skalthoff

@skalthoff skalthoff commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

what is the change

fixes the maestro ci suite, red on every run (prs and the nightly) for weeks, and guards against a repeat.

  • flows/quick-actions/flow.yaml — focus the input by id: "search-input" instead of tapOn: text: "Search" (the placeholder is randomized, so the text match hit the tab bar label), close swipe menus by scrolling instead of a blind tapOn: point: 50%, 40% (which pushed a detail screen onto the search stack), and pop back to the search root before leaving.
  • flows/search/gd-search.yaml — swap the 180s scroll for a bounded BACK + re-select-tab reset that pops any leftover detail screen, then a hard assert.
  • flow-smoke.yaml + scripts/maestro-android.js — repointed at existing flows (both referenced files deleted in Speed up local playback, Be More Aggressive with Fetching Playback Info, Be Less Aggressive with Fetching User Data #1146/chore: Add additional Maestro Subflows #1158).
  • jest/functional/maestro-flow-integrity.test.ts (new) — fails the pr jest run if any runFlow/file: reference is missing, so this can't silently rot again.
  • animated-row.tsx — keep the testID when animations are off (reduced motion on ci emulators was hiding these rows from maestro).
  • also deletes two stale duplicate flow files and updates the readme.

verified locally on android 14 / maestro 2.5.1 against the demo server — full and smoke suites both green end-to-end.

what does this address

every maestro run failing deterministically for weeks, from tab-stack poisoning. each tab keeps its own nav stack; quick-actions left a detail screen pushed on the search tab, so when the search flow later selected that tab it landed on the leftover screen — search-input wasn't in the hierarchy at all, and the old 180s scroll recovery could never find it. the dead smoke suite and android script were separately pointing at flow files deleted in #1146/#1158.

issue number / link

tag reviewers

Every Maestro CI run (PRs and nightly) has failed for weeks in
flows/search: the quick-actions flow left an album/artist detail screen
pushed on the Search tab's navigation stack, so the search flow's
selectors weren't in the hierarchy at all and its 180s scroll-up
recovery could never succeed.

- quick-actions: focus the search input by testID (placeholder text is
  randomized, so the old text match hit the tab bar label), close swipe
  menus by scrolling instead of blind coordinate taps (which tapped
  result rows and pushed detail screens), and restore the Search tab to
  its root before leaving it.
- gd-search: replace the 180s scroll with a deterministic reset —
  scroll-up, then a bounded BACK + re-select-tab loop that pops leftover
  detail screens and cannot back out of the app, then a hard assert.
- flow-smoke.yaml: rebuild on current flows/ building blocks; it had
  referenced maestro/tests/*.yaml files deleted in #1146/#1158 and
  failed instantly when dispatched.
- Remove stale maestro/tests/7-settings.yaml (duplicate of
  flows/settings/flow.yaml) and maestro/flows/flow-settings.yaml
  (referenced a deleted file).
- scripts/maestro-android.js: point at flow-full.yaml (flow-0.yaml no
  longer exists).
- Add jest/functional/maestro-flow-integrity.test.ts so dangling
  runFlow references fail the PR jest suite instead of surfacing as
  emulator-time failures.

Verified on a local API 34 x86_64 emulator with Maestro 2.5.1: the old
flows reproduce CI's exact failure; the fixed flow-full.yaml passes
end-to-end (setup, home, player, quick-actions, library, search,
discover, settings).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 2, 2026 09:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR repairs the Maestro CI suite by preventing “tab-stack poisoning” in the Search tab, rebuilding the smoke flow on the current flows/ structure, and adding a Jest guard to catch broken runFlow references at review time.

Changes:

  • Harden Search-related flows by resetting the Search tab to a known root state (bounded BACK + tab reselect) and avoiding brittle selectors in quick-actions.
  • Rebuild maestro/flow-smoke.yaml to use current flows/ entry points and remove stale/dead flow files.
  • Add a Jest integrity test to ensure all maestro/**/*.yaml runFlow references point to existing files.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/maestro-android.js Updates the Android Maestro runner script to execute maestro/flow-full.yaml.
maestro/tests/7-settings.yaml Deleted redundant legacy settings test file.
maestro/README.md Updates docs to reflect flows/-based structure and adds tab stack hygiene guidance.
maestro/flows/search/gd-search.yaml Adds deterministic Search-tab reset logic before asserting search-input.
maestro/flows/quick-actions/flow.yaml Fixes Search input targeting and adds cleanup/reset to avoid leaving Search stack dirty.
maestro/flows/flow-settings.yaml Deleted stale flow referencing removed test files.
maestro/flow-smoke.yaml Rebuilt smoke entrypoint to reuse flows/ building blocks instead of deleted tests/*.yaml.
jest/functional/maestro-flow-integrity.test.ts Adds Jest test to detect missing runFlow targets in Maestro YAML.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 12 to +16
element:
id: "search-input"
direction: UP
timeout: 180000
timeout: 20000
optional: true
Comment on lines +34 to +39
- scrollUntilVisible:
element:
id: "search-input"
direction: UP
timeout: 20000
optional: true
Comment on lines +233 to 238
- scrollUntilVisible:
element:
id: "search-input"
direction: UP
timeout: 20000
optional: true
Two more failures surfaced once the search fix let CI get past the
search flow for the first time in weeks:

- AnimatedRow dropped its testID (and flex style) entirely in the
  reduced-motion branch. CI emulators run with animations disabled,
  which Reanimated reports as reduced motion, so discover's
  `discover-recently-added` / `discover-suggested-artists` rows never
  existed in the hierarchy there — the discover flow failed on CI while
  passing on emulators with animations enabled. Render a plain View
  with the same testID and style instead. Also give the discover flow
  an extendedWaitUntil for slow cold loads.

- #1289 bumped prettier to 3.9.3 in package.json but bun.lock kept
  3.8.4, so CI's `bun i` + `format:check` now fails on three files that
  3.9.3 formats differently (single-line short union types). Reformat
  them and sync the lockfile.

Verified: full flow-full.yaml green on a local API 34 emulator with
animations disabled (reduced motion active) — including the previously
failing discover flow — plus jest 105/105 and format:check clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@skalthoff
skalthoff marked this pull request as draft July 2, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants