Skip to content

bug: backup reminder closes the qr scanner #1368

Description

@ovitrif

What happened?

On Android, the Backup reminder can open while the user is scanning a QR code, and it closes the scanner. Reported by @catch-21.

The tab-bar scanner is a sheet (Sheet.QrScanner) opened over Home, so Home stays resumed and the timed-sheet check that Home schedules two seconds after it resumes still runs. TimedSheetManager.checkAndShowNextSheet() does not look at what is on screen. The only guard, where AppViewModel collects timedSheetManager.currentSheet, skips just the sheets in isHighPrioritySheet (Gift, Send, BTCPayConnection, LnurlAuth, Pin, PubkyAuth). The scanner is not one of them, so showSheet(Sheet.TimedSheet(...)) replaces it.

All five timed sheets use this path (App update, Backup, Notifications, QuickPay, High balance), so any of them can interrupt the scanner.

Expected behavior

No timed sheet opens while the QR scanner, or any other sheet, is open. A timed sheet that comes due then stays queued and shows on a later Home visit, as on iOS.

Steps to Reproduce

  1. Use a wallet with a non-zero balance and an unverified backup, with the Backup reminder not dismissed in the last day.
  2. Go to Home, then tap Scan in the tab bar within about two seconds.
  3. The Backup reminder replaces the scanner.

These steps come from the report and a code reading; not yet reproduced on a device.

Logs / Screenshots / Recordings

N/A

Bitkit Version

Not stated in the report; code read at 67685e3 on master.

Device / OS

Android

Reproducibility

Intermittent: depends on when the scanner opens relative to the timed-sheet check.

Additional context

  • The window is wider than two seconds. The App update sheet is checked first and waits on a network request before Backup is checked. Opening the scanner may also re-arm the check: the camera permission request and the gallery picker pause and resume the Activity, which Home treats as leaving and returning. Needs device confirmation.
  • The same guard drops a timed sheet while Send is open: TimedSheetManager has already taken it off its queue when AppViewModel skips it, so it does not show again until Bitkit restarts.
  • iOS is not affected: its TimedSheetManager cancels the pending check whenever a sheet is shown and skips the check while any sheet is open, and the tab-bar scanner opens as a sheet.
  • Suggested fix: match iOS. Check for an open sheet before taking a timed sheet off the queue, and cancel the pending check when any sheet opens. Per-timed-sheet rules can be added on top if a sheet ever needs to show over another one; this case does not need them.

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