Skip to content

bug: allowance added notice is lost when the app leaves during an automatic accept #1672

Closed

Description

@ovitrif

Twin: synonymdev/bitkit-ios#1103
Refs: #1385 (review)

What happened?

When the allowee's wallet accepts an allowance offer automatically and the app goes to the background at that moment, the allowance becomes Active but "Allowance Added" is never shown. Leaving the app stops the request polling job; the SDK still commits the accept, then the cancellation skips the step that returns the offer for announcement. Later refreshes see the allowance as already accepted, so the notice is lost for good. Process death right after the accept ends the same way.

Expected behavior

Every offer accepted automatically is announced once, on the refresh after the accept if the one that accepted it was cancelled.

Steps to Reproduce

  1. Payer sets an allowance for the payee (journeys/allowances/set-and-accept.xml).
  2. On the payee, send Bitkit to the background right as the offer is being accepted.
  3. Reopen Bitkit: the allowance is Active, and no "Allowance Added" notification or toast ever appears.

Logs / Screenshots / Recordings

PaykitSdkService.completeSdkCall runs acceptAllowance under NonCancellable, then calls ensureActive(), so the accept is committed and a CancellationException follows. acceptOffersFromAllowers never returns the offer, and announceAcceptedAllowanceOffers is skipped.

Small follow-ups from the same review:

  • journeys/allowances/monthly-cap-reached.xml step 2 still says "have the payee accept it"; the payee's wallet accepts by itself. Same wording in end-stops-auto-pay.xml.
  • journeys/allowances/pin-gates-allowance-changes.xml: the "On the payee instance" step ends by checking the payer's row; split it into a payee step and a payer step.
  • PaykitAllowanceRepoTest.kt: offer accept never answers an ask that joined the entry after the check cannot fail, since allowances of different contacts never share an entry; rename it to what it checks and drop the matching comment in PaykitAllowanceRepo.kt.

Bitkit Version

Allowances, #1385 (not released yet).

Device / OS

Any Android device.

Reproducibility

Timing-dependent: only when the app leaves the foreground while an automatic accept is in flight.

Activity

  1. added this to the 3.2.0 milestone on Oct 22, 2026
  2. added theissue type on Oct 22, 2026
  3. self-assigned this
    on Oct 26, 2026
  4. modified the milestones: 3.2.0, 3.1.0 on Oct 26, 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

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions