Skip to content

Send scanner plays success haptic before rejecting a pubkyauth URL #642

Description

@jvsena42

Follow-up from a review comment on #630: #630 (comment)

success haptic could be after !PubkyAuthRequest.isProtocolURL(uri) guard

Context

In ScannerManager.handleSendScan (Bitkit/Managers/ScannerManager.swift), the scan-success haptic fires before the guard that rejects pubkyauth URLs:

Haptics.play(.scanSuccess)

guard !PubkyAuthRequest.isProtocolURL(uri) else {
    app.toast(
        type: .error,
        title: t("other__qr_error_header"),
        description: t("other__qr_error_text")
    )
    completion(nil)
    return
}

Scanning a pubkyauth URL from the Send flow therefore feels like a success — haptic first — and is then immediately contradicted by an error toast.

pubkyauth is intentionally limited to the main scanner (Send paste / Enter manually reject it), so the rejection itself is correct; only the feedback ordering is wrong.

Fix

Move Haptics.play(.scanSuccess) below the guard, so the success haptic only plays for input the Send flow will actually handle. Optionally play an error haptic on the rejection path instead.

Acceptance

  • Scanning a pubkyauth URL in the Send flow produces the error toast with no success haptic.
  • Scanning a valid payment URI in the Send flow still plays the success haptic as before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions