Skip to content

fix(ios): harden pasteIOSText against simctl pbcopy flake - #218

Merged
piotr-iohk merged 1 commit into
mainfrom
ada/harden-pasteIOSText-pbcopy-retry
Sep 11, 2026
Merged

fix(ios): harden pasteIOSText against simctl pbcopy flake#218
piotr-iohk merged 1 commit into
mainfrom
ada/harden-pasteIOSText-pbcopy-retry

Conversation

@piotr-iohk

Copy link
Copy Markdown
Collaborator

Summary

  • Harden pasteIOSText for iOS CI flake where mobile: setPasteboard fails with xcrun simctl pbcopy … exitcode 60.
  • Retry setPasteboard (up to 4 attempts with backoff), then fall back to typeText if pasteboard or the Paste menu is unavailable.
  • In restoreRnWallet, wait explicitly for RestoreButton (same pattern as native restoreWallet) so empty/failed paste fails clearly instead of a blind tap.

Does not relax balance assertions (migration_3 100k-short / zero-balance mismatches stay as product/env signals).

Evidence

bitkit-ios E2E Migration (iOS) run 34431873300 (master, attempt 3), job e2e-tests - v1.1.6 - migration_1-restore:

  1. E2E attempt 1: Appium session create timeout (infra)
  2. E2E attempt 2: pasteIOSTextWebDriverError: Process ended with exitcode 60 (cmd: 'xcrun simctl pbcopy …') on mobile: setPasteboard
  3. E2E attempt 3: element ("~RestoreButton") still not displayed after 60000ms (consistent with failed/empty paste)

Related historical balance mismatches (not addressed here — product/env):

  • migration_3 same run: Expected 446184 got 0, then got 346184 (exactly 100k short)
  • Sep 8 migration_1: Expected 446712 got 346712 (100k short)
  • Sep 6 migration_1: Appium timeout then Expected 446712 got 100000

Test plan

  • CI / local iOS restore path exercises pasteIOSText (migration_1 restore or any mnemonic paste)
  • Confirm pbcopy exit-60 no longer hard-fails the suite when retry/fallback succeeds
  • Confirm migration_3 balance assertions still fail loudly if balance is wrong (no gutting)

CI Migration (and other iOS restore flows) intermittently fail when
`mobile: setPasteboard` dies with `xcrun simctl pbcopy` exit code 60.
Retry setPasteboard, fall back to typeText if pasteboard/Paste menu is
unavailable, and wait explicitly for RestoreButton in restoreRnWallet.

Evidence: bitkit-ios E2E Migration run 34431873300 attempt 3
migration_1 — Appium session timeout, then pbcopy exit 60 in
pasteIOSText, then RestoreButton 60s timeout.
@piotr-iohk

Copy link
Copy Markdown
Collaborator Author

Validation dispatch: bitkit-ios E2E Migration (iOS) with e2e_branch=ada/harden-pasteIOSText-pbcopy-retryhttps://github.com/synonymdev/bitkit-ios/actions/runs/34529781285 (duplicate dispatch cancelled).

@piotr-iohk

Copy link
Copy Markdown
Collaborator Author

Re-dispatched after concurrency cancel of earlier attempts: https://github.com/synonymdev/bitkit-ios/actions/runs/34530116332 (e2e_branch=ada/harden-pasteIOSText-pbcopy-retry).

@piotr-iohk

Copy link
Copy Markdown
Collaborator Author

Validation note: first iOS Migration dispatch with only this branch (34530116332) never reached e2e-tests — prepare-wallets migration_2 died 3× on RN ActivityShort-1 (same harness flake as Android mig1), which skipped the whole e2e matrix via needs.

#219 was rebased onto this PR. Combined iOS Migration validation (paste + RN setup/tag waits): https://github.com/synonymdev/bitkit-ios/actions/runs/34531814945 (e2e_branch=ada/harden-migration1-rn-setup-and-tag-backup).

@piotr-iohk

Copy link
Copy Markdown
Collaborator Author

Validation: iOS E2E Migration FULL GREEN with combined branch (includes this paste fix): https://github.com/synonymdev/bitkit-ios/actions/runs/34531814945 — mig1–4 all success. mig1 attempt1 Appium session timeout (infra); attempt2 tag sync retries; attempt3 verified. No pbcopy exit-60 in the successful path.

@piotr-iohk
piotr-iohk merged commit 1ce8990 into main Sep 11, 2026
@piotr-iohk
piotr-iohk deleted the ada/harden-pasteIOSText-pbcopy-retry branch September 11, 2026 08:46
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.

1 participant