Skip to content

Commit 0aa9e3e

Browse files
committed
fix(session): use state-enriched bill on give restart to preserve rendezvous
The restart closure in showBill() captured the original bill parameter which has no nonce. On restart, a fresh nonce was generated producing a different rendezvous key — so device 2 could never grab the bill. Read the current bill from BillController state instead, which carries the nonce from the first presentation.
1 parent 9195d70 commit 0aa9e3e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/flipcash/shared/session/src/main/kotlin/com/flipcash/app/session/internal/RealSessionController.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,11 @@ class RealSessionController @Inject constructor(
334334
message = "Cash link not sent. Restarting awaiting grab",
335335
type = TraceType.User,
336336
)
337-
awaitBillGrab(bill, owner)
337+
// Use the state-enriched bill which carries the
338+
// nonce from the first presentation, so the
339+
// restarted give reuses the same rendezvous.
340+
val currentBill = billController.state.value.bill ?: bill
341+
awaitBillGrab(currentBill, owner)
338342
}
339343
}
340344
),

0 commit comments

Comments
 (0)