Skip to content

bug: received sheet closes when a second payment arrives as the first one closes #795

Description

@ovitrif

What happened?

When a received sheet is closed and a second payment's received sheet opens while the first one is still animating out (about 0.5 s), the second sheet closes right away and the second payment's confirmation is lost.

The first sheet's dismiss handler in MainNavView runs after its dismiss animation and calls hideSheetIfActive(.receivedTx). Both presentations share the .receivedTx sheet ID, so the guard matches the new sheet and hides it. Before #793 the same handler closed it through hideSheet(), so this is not a regression. Greptile flagged it on #793.

Android is not affected: its received sheet is a separate overlay, and SheetHost fires its dismiss callback only while the dismissed sheet is still the current one (synonymdev/bitkit-android#1186).

Expected behavior

A sheet's dismiss handler closes only the presentation it dismissed. A received sheet that opens while the previous one is closing stays open.

Steps to Reproduce

  1. Receive a payment so the received sheet opens.
  2. Close the sheet.
  3. Receive a second payment within about 0.5 s, while the first sheet is still closing.
  4. The second received sheet opens and closes at once.

Logs / Screenshots / Recordings

Found in code review, not reproduced on a device yet. SheetViewModel.hideSheetIfActive compares SheetConfiguration.id only, not presentationID.

Bitkit Version

master at 3ac017b (2.5.0), and #793

Device / OS

Any iOS device (timing-dependent code path)

Reproducibility

Rarely (once or twice)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions