Skip to content

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

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

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

Conversation

@ovitrif

@ovitrif ovitrif commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #807
Twin: synonymdev/bitkit-android#1385
Stacked on #799
Refs: #805

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

  • Bitkit/Resources/Localization: the new strings are English only until the next translation sync.
  • Allowee-authored asks: this PR only changes what the allowee's wallet does with a received offer; the iOS app proposes allowances only as allower, so the review sheet for an ask is covered by unit tests, not on a device.

Design

N/A — no design available.

Preview

Payer waits Payee: Allowance Added Payee: Active Payer: Active
Recording
07-side-by-side-payer-left-payee-right.mp4

QA Notes

Journeys

  • updated set-and-accept.xml

Manual Tests

  • 1. Payer: Allowances → Add Allowance → contact → Save: the payee's wallet shows no review sheet, posts "Allowance Added", and both rows turn Active — the first private link between two new contacts can delay the accept by a minute or two.
  • 2. regression: payee: allowance detail → Swipe To End Allowance: ends on both sides.
  • Allowee-authored ask → review sheet on the allower — not reachable on iOS, which proposes only as allower; covered by PaykitAllowanceExecutorTests.swift.

Automated Checks

  • added PaykitAllowanceTests.swift — only a received proposal from the allower counts as an offer
  • added PaykitAllowanceExecutorTests.swift — an allower's offer is accepted without the sheet and not announced twice; an allowee's ask still goes to the sheet; sent and answered proposals are never accepted
  • ran xcodebuild test -only-testing:BitkitTests on an iPhone 17 simulator (iOS 26.5) with Paykit rc59 — 1,625 tests, 12 skipped, 0 failures
  • ran the Paykit and allowance suites again after merging the updated feat: add allowances for automatic paykit payments #799 — 382 tests, 0 failures
  • ran set-and-accept.xml on two simulators against the staging regtest backend: the payee turned Active with no tap about 95 s after the proposal arrived, no review sheet opened, and the toast "Allowance Added" showed (the system notification was not exercised, no permission prompt appeared)

@ovitrif
ovitrif force-pushed the feat/allowance-auto-accept branch from b0c583e to 80f5c0f Compare October 1, 2026 21:52
@ovitrif

ovitrif commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed 0b8e352: this PR now sits on the updated #799 (merge 8f0449c, Paykit SDK rc59 with identity-wide shared state).

  • Rebased only this PR's two feature commits onto the new feat: add allowances for automatic paykit payments #799, whose old base commits are gone, and resolved the conflicts in AppScene.swift and the two allowance test files. Allowances are bound to identities now, so the offer rule is unchanged: a received proposal is accepted automatically only when this wallet is the allowee.
  • README: the journeys README no longer promises a one-second accept; the offer is accepted once it has arrived, which can take a minute or two between contacts that have never exchanged a private message.
  • Local verification: BitkitTests on an iPhone 17 simulator, 1,625 tests, 12 skipped, 0 failures; set-and-accept.xml on two simulators against staging regtest passed, the payee turned Active with no tap and no review sheet.
  • The description now carries the screenshots and a recording, and its QA Notes record that the allowee-ask review sheet is not reachable on iOS.

@ovitrif

ovitrif commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed 14307a0: merged the updated #799 (a19ea87: the request-presentation and covered-request fixes and more of Ben's shared-runtime merges) into this PR; the merge was clean and nothing in the auto-accept code changed.

Local verification: the Paykit and allowance suites on an iPhone 17 simulator, 382 tests, 0 failures.

@jvsena42
jvsena42 added this pull request to stack #866 October 2, 2026 16:44
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