Skip to content

test(mobile-app): pin one-tap session send and harden flaky test timeouts - #6034

Open
iscekic wants to merge 1 commit into
mainfrom
kwf/fix-the-mobile-session-send-5bb4
Open

test(mobile-app): pin one-tap session send and harden flaky test timeouts#6034
iscekic wants to merge 1 commit into
mainfrom
kwf/fix-the-mobile-session-send-5bb4

Conversation

@iscekic

@iscekic iscekic commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Changelog for users

  • One tap on the session send button sends the current message exactly once, with the keyboard open or closed — this behavior is unchanged by this PR.
  • Microphone behavior and the composer's existing send states are unchanged.

Changelog for maintainers

  • The reported two-tap send did not reproduce on device; one tap sends exactly once, so the diff ships no product change.
  • A new mounted suite pins the one-tap contract: the first press sends with the keyboard open and closed and across input focus changes.
  • The suite also pins the guards: an empty draft leaves send disabled and never sends, and a second press while sending is ignored.
  • The new suite presses the real send handler after asserting it is enabled, so the full JS submit path runs as a device tap would.
  • markdown-renderer.test.ts sets a file-wide 30 s test timeout; importing react-native-marked exceeds the 5 s default under full parallelism.
  • auth-context.test.tsx gets the same 30 s timeout, wall-clock settle budgets instead of iteration counts, and 60 s per-test timeouts for retry backoffs.
  • Review hint: weigh the device repro evidence against the reported defect before merging; the timeout bumps fix pre-existing flakiness in those suites.

E2E proof

Recording of the verified flow (waits trimmed)

e1-send-keyboard-open.mp4.trim.mp4

[e1] session composer one-tap send (ios) — e2e-mobile-app/e1-mic.png

[e1] session composer one-tap send (ios) — e2e-mobile-app/e1-focus-send.png

E2E proof — log excerpts

[e1] session composer one-tap send (ios) -> pass :: ios 1A7A48C9-C414-4FAA-94B5-9EEFBC297573: first tap sends keyboard-closed (e1-kb-closed-after.png, e1-kb-closed.log 'open keyboard send') and keyboard-open (e1-typed.png, e1-kb-open.log value="keyboard open send e2e"); empty send stays enabled=false (e1-empty.png, e1-empty.log); duplicate second Send message miss with Stop generating (e1-dup.log); focus-blur then one tap sent focus-blur-send-xyz (e1-focus-send.png, e1-focus.log); mic still opens Microphone access is off (e1-mic.png, e1-mic.log). No UX-DEFECT on the composer.
/Users/igor/.local/share/kwf/sections/fix-the-mobile-session-send-5bb4/e2e-mobile-app/e1-kb-closed.log
ios 1A7A48C9-C414-4FAA-94B5-9EEFBC297573
SCENE e1-kb-closed-after
XCUIElementTypeStaticText open keyboard send tappable [228,476][376,501]
XCUIElementTypeActivityIndicator In progress
XCUIElementTypeStaticText Writing response · 14 sec
XCUIElementTypeButton Stop generating tappable [347,786][392,831]
XCUIElementTypeTextView Message tappable [48,786][300,831]
proof: first tap on Send message with keyboard closed placed user text in the transcript and started generation
/Users/igor/.local/share/kwf/sections/fix-the-mobile-session-send-5bb4/e2e-mobile-app/e1-kb-open.log
ios 1A7A48C9-C414-4FAA-94B5-9EEFBC297573
<XCUIElementTypeTextView type="XCUIElementTypeTextView" value="keyboard open send e2e" enabled="true" visible="true" accessible="true" x="48" y="512" width="252" height="45" index="0" traits="">
<XCUIElementTypeOther type="XCUIElementTypeOther" name="UIKeyboardLayoutStar Preview" enabled="true" visible="true" accessible="false" x="0" y="583" width="402" height="233" index="0" traits="">
<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="keyboard open send e2e" name="keyboard open send e2e" label="keyboard open send e2e" enabled="true" visible="false" accessible="false
proof: first tap on Send message with keyboard open moved TextView value to transcript StaticText
/Users/igor/.local/share/kwf/sections/fix-the-mobile-session-send-5bb4/e2e-mobile-app/e1-empty.log
ios 1A7A48C9-C414-4FAA-94B5-9EEFBC297573
BEFORE <XCUIElementTypeButton type="XCUIElementTypeButton" name="Send message" label="Send message" enabled="false" visible="true" accessible="true" x="347" y="786" width="45" height="45" index="0" tr
AFTER <XCUIElementTypeButton type="XCUIElementTypeButton" name="Send message" label="Send message" enabled="false" visible="true" accessible="true" x="347" y="786" width="45" height="45" index="0" tra
proof: empty composer leaves Send message enabled=false; tap does not send
/Users/igor/.local/share/kwf/sections/fix-the-mobile-session-send-5bb4/e2e-mobile-app/e1-dup.log
ios 1A7A48C9-C414-4FAA-94B5-9EEFBC297573
SCENE e1-dup MISS tap 'Send message' on second tap
<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="dup-send-once-xyz" name="dup-send-once-xyz" label="dup-send-once-xyz" enabled="true" visible="false" accessible="false" x="230" y="-4
<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="dup-send-once-xyz" name="dup-send-once-xyz" label="dup-send-once-xyz" enabled="true" visible="false" accessible="true" x="230" y="-42
<XCUIElementTypeButton type="XCUIElementTypeButton" name="Stop generating" label="Stop generating" enabled="true" visible="true" accessible="true" x="347" y="786" width="45" height="45" index="0" trai
proof: first Send message tap sent once; second Send message tap missed because button became Stop generating
/Users/igor/.local/share/kwf/sections/fix-the-mobile-session-send-5bb4/e2e-mobile-app/e1-focus.log
ios 1A7A48C9-C414-4FAA-94B5-9EEFBC297573
AFTER_BLUR <XCUIElementTypeTextView type="XCUIElementTypeTextView" value="focus-blur-send-xyz" enabled="true" visible="false" accessible="true" x="48" y="786" width="252" height="45" index="0" traits=
AFTER_SEND <XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="focus-blur-send-xyz" name="focus-blur-send-xyz" label="focus-blur-send-xyz" enabled="true" visible="false" accessible="fal
<XCUIElementTypeButton type="XCUIElementTypeButton" name="Stop generating" label="Stop generating" enabled="true" visible="true" accessible="true" x="347" y="786" width="45" height="45" index="0" trai
proof: after focus change (Add attachment then Cancel) first Send message tap sent focus-blur-send-xyz
/Users/igor/.local/share/kwf/sections/fix-the-mobile-session-send-5bb4/e2e-mobile-app/e1-mic.log
ios 1A7A48C9-C414-4FAA-94B5-9EEFBC297573
<XCUIElementTypeAlert type="XCUIElementTypeAlert" name="Microphone access is off" label="Microphone access is off" enabled="true" visible="true" accessible="false" x="41" y="365" width="320" height="1
<XCUIElementTypeButton type="XCUIElementTypeButton" name="Start voice input" label="Start voice input" enabled="true" visible="false" accessible="true" x="312" y="791" width="36" height="36" index="2"
proof: Start voice input still opens the microphone access alert
Owner request

Fix the mobile session send button that requires two taps.

Surface: mobile-app.
On the session page, the send button sits to the right of the microphone icon and the composer.
Expected: One tap sends the current message exactly once.
Actual: The user must tap the send button twice.

Reproduce this through the normal session composer before changing product code.
Find and fix the shared cause across affected session flows.
Prove the first tap sends with the keyboard open and with the keyboard closed.
Cover focus changes, empty input, and duplicate-send prevention with focused regression checks.
Preserve microphone behavior and existing send states.
Put local end-to-end (E2E) device proof in the pull request (PR) body.
Use temporary test support outside the product diff.
Do not commit fixtures, E2E-only code, or test-only runtime flags.
Do not leave follow-ups.
Let the workflow open and maintain the PR.
Finish only after current-head continuous integration (CI) is green and Kilobot recommends Merge.

…outs

Fix the mobile session send button that requires two taps.

Surface: mobile-app.
On the session page, the send button sits to the right of the microphone icon and the composer.
Expected: One tap sends the current message exactly once.
Actual: The user must tap the send button twice.

Reproduce this through the normal session composer before changing product code.
Find and fix the shared cause across affected session flows.
Prove the first tap sends with the keyboard open and with the keyboard closed.
Cover focus changes, empty input, and duplicate-send prevention with focused regression checks.
Preserve microphone behavior and existing send states.
Put local end-to-end (E2E) device proof in the pull request (PR) body.
Use temporary test support outside the product diff.
Do not commit fixtures, E2E-only code, or test-only runtime flags.
Do not leave follow-ups.
Let the workflow open and maintain the PR.
Finish only after current-head continuous integration (CI) is green and Kilobot recommends Merge.
@kilo-code-bot

kilo-code-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • apps/mobile/src/components/agents/chat-composer-send-once.mounted.test.tsx
  • apps/mobile/src/components/agents/markdown-renderer.test.ts
  • apps/mobile/src/lib/auth/auth-context.test.tsx

Reviewed by grok-4.6 · Input: 241.9K · Output: 15.9K · Cached: 596.1K

Review guidance: REVIEW.md from base branch main

@iscekic iscekic added the human-ready The PR is ready for human review. label Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human-ready The PR is ready for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant