fix(android): Approve and add no-op from shared Compose busy flag #18

Merged
sirius merged 1 commit from wt/t_af421dc6 into main 2026-09-12 02:05:47 +00:00
Owner

Summary

Phone bug: Approve and add did nothing after a successful Verify. Two LaunchedEffects shared one busy flag; tapping Approve relaunched decode, which cleared busy and cancelled add.

Fix: extract InviteAddFlow with separate verifying/adding flags. Each click handler launches its own coroutine. Composable stays dumb.

Android-only. No Rust/SDK/TUI/protocol changes.

Tests

  • RED ./gradlew :app:testDebugUnitTest (shared-busy): 5 tests, 4 failed (add never ran / double-tap hung). failed_decode_sets_error_and_never_calls_onAdd passed.
  • GREEN after the split: 5 tests, 0 failed (TEST-com.siriusdevops.onionwire.ui.InviteAddFlowTest.xml).

APK

android/app/build/outputs/apk/debug/app-debug.apk ~37M (built on the previous run of this card). Not rebuilt after rebase — only TUI commits landed on main since.

On-device

Not run. No emulator and no adb device on this machine. A green unit test is not a phone.

Manual: install the debug APK, add a friend, paste invite, Verify (preview card), Approve and add. Expect the Added line and the friend in the roster.

Please do not merge until you have tapped it on a phone.

## Summary Phone bug: **Approve and add** did nothing after a successful Verify. Two `LaunchedEffect`s shared one `busy` flag; tapping Approve relaunched decode, which cleared `busy` and cancelled add. Fix: extract `InviteAddFlow` with separate `verifying`/`adding` flags. Each click handler launches its own coroutine. Composable stays dumb. Android-only. No Rust/SDK/TUI/protocol changes. ## Tests - RED `./gradlew :app:testDebugUnitTest` (shared-busy): 5 tests, 4 failed (add never ran / double-tap hung). `failed_decode_sets_error_and_never_calls_onAdd` passed. - GREEN after the split: 5 tests, 0 failed (`TEST-com.siriusdevops.onionwire.ui.InviteAddFlowTest.xml`). ## APK `android/app/build/outputs/apk/debug/app-debug.apk` ~37M (built on the previous run of this card). Not rebuilt after rebase — only TUI commits landed on `main` since. ## On-device **Not run.** No emulator and no `adb` device on this machine. A green unit test is not a phone. Manual: install the debug APK, add a friend, paste invite, Verify (preview card), Approve and add. Expect the Added line and the friend in the roster. Please do **not** merge until you have tapped it on a phone.
fix(android): Approve & add no-op from shared Compose busy flag
All checks were successful
ci / test (pull_request) Successful in 2m32s
f6ac5ea738
PasteInviteScreen drove Verify and Approve from one busy boolean plus
LaunchedEffect(busy). Tapping Approve relaunched decode, which cleared
busy and cancelled add — so the roster never updated.

Extract InviteAddFlow with separate verifying/adding flags and launch
each action from its click handler. Unit tests were red against the
shared-busy state machine (4/5 failed) and green after the split (5/5).
sirius merged commit 8c79250acf into main 2026-09-12 02:05:47 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/onionwire!18
No description provided.