Skip to content

bug: signing out mid-payment can let a waiting contact import write before the payment ends #1498

Closed

Description

@ovitrif

What happened?

Found while testing Case 8 of the Shop contact import on #1485 at 2f07d8c (not reproduced on a device yet).

Signing out while a payment is still running (clearStateLocked) resets the shared payment-in-progress gate to false before the payment ends. Any import or other work waiting on that gate can then run while the payment is still in progress, which is what Case 8 guards against.

Expected behavior

The payment gate stays closed until the running payment returns or is actually cancelled, including when the user signs out during it.

Notes

Activity

  1. added this to the 3.0.5 milestone on Oct 15, 2026
  2. ben-kaufman commented on Oct 15, 2026

    @ben-kaufman
    Contributor

    Confirmed and fixed in #1506. The guard now belongs to each running payment attempt, so sign-out, clearing the request UI and hardware-sheet disposal cannot release it early. Targeted tests hold a USDT attempt through sign-out and a hardware broadcast through cancellation, and verify that finishing an older attempt cannot release a newer one. This also protects BTC/LN requests. iOS already uses attempt ownership and its corresponding tests passed.

  3. modified the milestones: 3.0.5, 3.0.0 on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions