2026-10-08

Stuck swap order, 3DS approval, send failures and the sweep

TLDR

8 PRs merged, 14 commits across all branches, 5 PRs opened, 3 repos (swap server 21, Nuri app 5, Nuri Connect 1), 6 deployments, +479 / -141 lines. I worked on 5 features.

Six of the merged PRs went into closing one paid-out swap order that was stuck. In the app, 3DS approvals now confirm on screen and a failed Bitcoin send stays on screen with Try again.

Closing a stuck swap order

One order on the swap server had already paid out but stayed in processing. Every write to an order stores its whole history again, and this order’s history filled its storage, so every write since 2026-09-30 failed and the expiry could not close it. It took six merged PRs, because each deploy showed the next thing in the way.

First the server dropped old history and retried when storage was full, but a full write resets the storage before any retry runs. So now old history is deleted before each write, keeping the start of the order plus the newest 100 events, the biggest page the history asks for. Deleting the whole backlog at once ran past the storage time limit and rolled back, and it also made a sweep for the same wallet take 185 seconds and fail. Now it deletes 50 old events per write and the rest drains over later writes.

After that the order ran without errors but stayed open, because of a signed follow-up swap whose deadline passed weeks ago. Now an order past its own expiry closes when every earlier step completed and nothing was sent for the follow-up. A signature the server still holds itself keeps blocking until it is published or dropped. Run locally against the live order, the new code closes it as expired, while the old code left it processing like production did.

Sweeping EURe and USDC.e

The “we found money” sweep on the swap server now converts EURe on Ethereum and bridged USDC.e on Gnosis to EURC on Base through LI.FI. Before, both were only detected, so the app kept announcing money it could not move. Merged.

The sweep still did not move funds for that wallet, so I opened PRs on the app and the swap server, both not merged yet. The app never sent a key the server requires since the new sweep version from 2026-09-16, so every sweep was refused. On Ethereum the approval also mined after the 60 second quote ran out, so the swap expired. With the fix the approval is its own step, the app approves exactly the found amount, and the order is only created once the approval is in. A sweep that died halfway resumes on the next tap, and the gas top-up covers the approval plus the swap. The app PR also fixes a refund on app open that never ran because it read the wrong field, which left a 20,000 sat lock sitting for 10 days.

3DS approval and Bitcoin send failures

In the app, after you approve a card payment in the 3DS view and the server accepts it, the view shows “Approval successful” and “You can now return to your checkout.” with a Done button. It does not say the merchant payment went through. A decline or a failed call never shows it, and you can retry like before.

On the Bitcoin send sheet every send failure now stays on screen: the keypad hides, the amount and reason stay, and the button reads “Try again”. That only goes back to the form, nothing is sent until you press Confirm again. A cancelled passkey does not count as a failure. Both merged, tests pass, checked on web screenshots at phone width.

eSIM claims

The app retried a pending eSIM order forever when the eSIM provider said it had no checkout for it, on every app start and every 5 seconds while open. That answer now counts as unpaid, so the order is dropped once its invoice expired and it was never paid. Paid orders stay pending. Merged.

Home buttons and address book

Not merged yet: every home card shows only Send and Add money, with Move merged into both, and “From another wallet” opens your own pay page inside the app. Checked on web, not on a device yet.

Also not merged: Settings drops “Copy address book key for desktop”. Instead the desktop tool asks for access through Nuri Connect, you approve with the passkey on your phone, and the book comes back encrypted for that desktop only. Connect never sees the keys or the contacts. Tests and a local end to end run pass.