Skip to content

feat: accept allowance offers automatically on the allowee's wallet - #1385

Draft
ovitrif wants to merge 7 commits into
feat/paykit-allowancesfrom
feat/allowance-auto-accept
Draft

ovitrif wants to merge 7 commits into
feat/paykit-allowancesfrom
feat/allowance-auto-accept

Conversation

@ovitrif

@ovitrif ovitrif commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1353
Twin: synonymdev/bitkit-ios#841
Stacked on #1340
Refs: #1351

This PR makes the allowee's wallet accept an allowance the allower offers, so the allowee taps nothing and the allowance is active as soon as the offer arrives.

Description

  • Adds automatic acceptance of a received allowance proposal that makes this wallet the allowee, so the allower's decision alone activates the allowance.
  • Adds an "Allowance Added" notification, "{name} set up an allowance for you", with a toast fallback, so the allowee learns about the new allowance.
  • Keeps the review sheet with Accept and Decline for an allowee's ask, because there the money is this wallet's.
  • Retries a failed acceptance on the next refresh, and never touches a proposal this wallet sent or one already answered.

Out of Scope

  • app/src/main/res: the new strings are English only until the next translation sync.

Design

N/A — no design available.

Preview

Payer: Set Allowance Payer: waiting for an answer Payer: Active
Allowee: Allowance Added notification Allowee: notification shade Allowee: row Active
Recording
allowance-set-and-accept-payer-left-payee-right.mp4

QA Notes

Journeys

  • updated set-and-accept.xml — the allowee's wallet accepts the offer with no review sheet, posts "Allowance Added", and both rows turn Active
    • Driven on two fresh staging wallets, a3861ce build, Paykit rc59: the allowee accepted once with no tap, no review sheet opened, "Allowance Added" posted once, and both rows turned Active. The allowee's row took about 3 min 16 s after Save on a heavily loaded host, 2 min of it the payer publishing the proposal.
    • Journey drift, not edited here: the intro button has no SkipIntro tag (its "Skip Intro" text works), and Choose Contact shows "Add a contact first" for about 3 minutes after the contacts are saved, until Paykit discovery finishes.

Manual Tests

N/A

Automated Checks

  • added PaykitAllowanceTest.kt — only a received proposal from the allower counts as an offer
  • added PaykitAllowanceRepoTest.kt — an allower's offer is accepted without the sheet and not announced twice; a failed accept is retried; an allowee's ask still goes to the sheet; sent and answered proposals are never accepted
  • updated AppViewModelSendFlowTest.kt — the send flow stubs the new acceptance call
  • ran ./gradlew assembleDevDebug testDevDebugUnitTest detekt on Paykit 0.1.0-rc59 merged with feat: add allowances for automatic paykit payments #1340 (b929cce) — 3,227 unit tests pass and detekt is clean

@ovitrif ovitrif self-assigned this Sep 30, 2026
@ovitrif

ovitrif commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed 528fb7b: merged the updated feat/paykit-allowances (Paykit rc59, allowances bound to the contact identity) into this branch.

  • The auto-accept code needed no change, since it already addresses an allowance by counterparty and allowance id.
  • The new tests now use the identity-bound acceptAllowance(counterparty, allowanceId) and processOutboundPrivateMessages(counterparty) calls (a3861ce).
  • The rule is unchanged: only a received proposal that makes this wallet the allowee is accepted automatically; an ask from the allowee still opens the review sheet.
  • testDevDebugUnitTest (3,220 tests) and detekt pass.
  • Device run of set-and-accept.xml on two emulators is still pending; screenshots and a recording follow in the description.

@ovitrif

ovitrif commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

Added the device result and media to the description.

  • set-and-accept.xml passes on two fresh staging wallets with the a3861ce build (Paykit rc59): the allowee accepted with no tap and no review sheet, "Allowance Added" posted once, and both rows turned Active.
  • Save to the allowee's row took about 3 min 16 s on a heavily loaded host.
  • The build was a3861ce; head 528fb7b only adds a base merge that touches PaykitAllowanceRepo.kt (one line) and PaykitPaymentRequestRepo.kt.
  • Preview now has the payer and allowee screenshots plus the recording.
  • Journey drift is noted under QA Notes and the journey is not edited here.

@ovitrif

ovitrif commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed e7a8bd3: merged the updated feat/paykit-allowances (b929cce, Ben's newer shared-runtime sync and Paykit session retry) into this branch.

  • The merge was clean and changes none of this PR's code.
  • testDevDebugUnitTest (3,227 tests) and detekt pass on the merged head.
  • The device run was on the a3861ce build, before this merge, and has not been repeated.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant