You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
clipboard prompt racing a scan drops the usdt payment and blocks sheets #959
Found while driving the USDT journeys for #948 at ab313b1, in code that PR did not touch.
Observed
With Settings › Security › Read clipboard on, pasting a USDT payment link in the Scanner closes the scanner and nothing opens. 5 of 5 attempts each logged Hiding sheet scanner reason: Scanner routed USDT payment. The scene went inactive and came back ~400 ms later. After that, Scan and Send do nothing until Back or a relaunch: Showing sheet scanner is logged but no sheet appears. With Read clipboard off, the same link opens the USDT review.
The scanned link opens the USDT review. No clipboard prompt competes with a scan that is already being handled.
Steps to reproduce
Turn on Settings › Security › Read clipboard and open the USDT wallet.
Put a USDT payment link on the clipboard while Bitkit is in the foreground (Universal Clipboard, or xcrun simctl pbcopy on a simulator).
Tap Scan › Paste and allow paste.
Nothing opens. Tapping Send afterwards also shows nothing.
Root cause
The iOS "Allow Paste" prompt (ScannerManager.swift:290) makes the scene inactive, then active again.
On becoming active, MainNavView.swift:369-372 runs handleClipboardIfEnabled(). That raises the clipboard alert (:759-791, alert at :458-470) without checking for an open or replacing sheet.
At the same moment, hideSheetBeforePerforming (SheetViewModel.swift:104-118) pushes .usdtPayment (ScannerManager.swift:94-101), and that screen opens its send sheet on appear (UsdtWalletScreen.swift:17, :75).
The presentations collide and are dropped, leaving showClipboardAlert and showSend stuck at true.
handlePaste (ScannerManager.swift:287-300) does not record the pasted value in ClipboardPromptHistory (ClipboardPrompt.swift:22-37), so the same link is offered again.
Bitcoin and Lightning scans use the same 0.7 s replace window (SheetViewModel.swift:51-68) and are probably affected too. That was not observed.
Suggested fix
Return early from handleClipboardIfEnabled while sheets.isAnySheetOpen || sheets.isReplacingSheet, or while a scan is being handled.
Record the value used by paste and scan in ClipboardPromptHistory.
Platform parity
Android is not affected: its prompt is a Compose dialog (AutoReadClipboardHandler.kt:58-86) that does not block sheets or navigation.
Activity
ovitrif commentedon Oct 19, 2026
Fixed by #973.