Skip to content

fix: skip the limit reached notification while bitkit is open - #1716

Merged
ovitrif merged 3 commits into
masterfrom
fix/allowance-limit-foreground
Oct 27, 2026
Merged

ovitrif merged 3 commits into
masterfrom
fix/allowance-limit-foreground

Conversation

@ovitrif

@ovitrif ovitrif commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1715
Twin: synonymdev/bitkit-ios#1151
Refs: synonymdev/bitkit-ios#1136

A payment request above an allowance no longer posts a "Limit Reached" system notification while Bitkit is in the foreground, where the Payment Request sheet already shows it.

Description

  • AppViewModel skips the "Limit Reached" notification while Bitkit is unlocked in the foreground, as PaykitSubscriptionNotificationScheduler already does for a subscription payment due. Behind the PIN screen, or with no Bitkit screen in the foreground, the notification is posted as before, or the toast when notifications are off.
  • "Payment Executed" and "Allowance Added" are unchanged.
  • The monthly cap journey and the allowance journeys' README follow: with Bitkit open, the third request opens the Payment Request sheet with no notification.
  • Adds the subscription journey from fix: skip duplicate banners in the foreground bitkit-ios#1151 for the foreground due-payment case, which Android already handles.
  • No changelog fragment: allowances have not shipped yet.

Out of Scope

Design

N/A — no UI changes.

Preview

N/A — the change removes a system notification in the foreground.

QA Notes

Setup

Two dev (regtest) builds of this branch set up as in journeys/allowances/README.md, with notification permission granted on the payer.

Journeys

  • J1: updated monthly-cap-reached.xml — the request over the monthly limit opens the Payment Request sheet with no "Limit Reached" notification
  • J2: new foreground-due-no-banner.xml — a subscription payment due in the foreground opens the payment due sheet with no "Subscription Payment Due" notification

Manual Tests

  • 1. With a $5 a payment allowance, open Bitkit in split screen on the payer with the other app focused, then send it a $6 request → a "Limit Reached" notification is posted. Bitkit stops polling once no screen is visible, so a request sent with Bitkit fully in the background is fetched on return and opens the sheet instead — split screen is not in Capabilities
  • 2. With the PIN screen up on the payer, send it a $6 request → a "Limit Reached" notification is posted

Automated Checks

  • updated AppViewModelSendFlowTest.kt — "Limit Reached" posts nothing when Bitkit is unlocked in the foreground, and still notifies behind the PIN screen

Evidence

  • AppViewModelSendFlowTest and detekt pass on this head.

Gaps

  • J1, J2, 1 and 2 have not run on a device yet.

Models used

  • Planning/scoping: claude-opus-5-5 (reasoning: medium)
  • Implementation: claude-opus-5-5 (reasoning: medium)
  • Review: Not performed

@ovitrif ovitrif added this to the 3.1.0 milestone Oct 27, 2026
@ovitrif ovitrif self-assigned this Oct 27, 2026
@ovitrif
ovitrif requested review from a team, ben-kaufman and pwltr and removed request for a team October 27, 2026 16:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T16:02:46.759506Z aa96c17 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa96c17fb8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issues were found.

Summary

Skips the “Limit Reached” notification and fallback toast while Bitkit has a current activity.

  • Over-limit requests no longer trigger a duplicate alert while Bitkit is open.

Review checks were code-only; no build or device tests were run.

Reviews (1) · Last reviewed commit: "fix: skip the limit reached notification..." · Reviewed by Greptile

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from c97c912 (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings. Skips the allowance "Limit Reached" system notification while an activity is in the foreground, where the Payment Request sheet opens for the same request. Reviewed aa96c17, full tier, static: on the Bitkit track an unasked review does not build the branch, so this is reasoned from the code and CI.

What I checked, and 4 candidates I ruled out

Read: AppViewModel.kt (allowance event handling, processAllowanceRequests, presentNextIncomingPaykitPaymentRequest, isPaymentRequestPresentationBlocked), PaykitAllowanceExecutor.kt (autoPay, classifyAboveLimit, notifyLimitReached), PaykitAllowanceRepo.kt (processIncomingRequests, isAutomaticallyHandling), App.kt (CurrentActivity), PaykitSubscriptionNotificationWorker.
CI: compile, lint, detekt and 4 e2e groups green. e2e-tests-local - onboarding_backup_numberpad is red, and the same group failed on two unrelated branches today (fix/pending-wallet-restore-admission, fix/blocktank-fee-cache), so I did not tie it to this diff. onchain_boost_receive_widgets was still running.

Ruled out

  • Over-limit request never surfaces in the foreground: every LimitReached emit sits on a path that returns MANUAL (or marks the request manual in markAboveLimitManual), which sets manualRequestSignatures, so isAutomaticallyHandling turns false and the refresh's presentNextIncomingPaykitPaymentRequest() presents it.
  • Foreground behind the PIN screen: presentation is blocked until _isAuthenticated, and the request stays pending, so the sheet opens after unlock; nothing is lost by skipping the notification.
  • Dedupe swallows a later background notice: notifiedRequestIds marks the request even when the notification is skipped, but the request is then on screen or in the pending list, which is what the notice pointed to.
  • Foreground check out of step with the house pattern: App.currentActivity?.value != null is the same gate PaykitSubscriptionNotificationWorker, LightningNodeService and WakeNodeWorker use; CurrentActivity clears on pause, stop and destroy.

Merge confidence: 4/5, the foreground gate has no test (the author notes unit tests cannot stage the current activity) and one e2e group is red, the same way it fails on unrelated branches today.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the review run's settings are not readable from inside the run)

@ovitrif
ovitrif requested review from piotr-iohk and removed request for pwltr October 27, 2026 17:07

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code scan at aa96c17: no HIGH or MEDIUM. Three LOWs inline: a journey missing compared with the iOS twin, a Manual Test that can't produce its notification, and the notice dropped behind the PIN screen.

Checked and clean: every LimitReached path marks the request manual, so the Payment Request sheet still opens in the foreground. Foreground detection reads CurrentActivity on the main thread when the event is handled, and in paused states it errs toward posting.

Device gate (partial): aa96c17, not run yet. Pending: monthly-cap-reached.xml, paired with iOS.

Comment thread journeys/allowances/README.md Resolved
@ovitrif

ovitrif commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed e322a60: "Limit Reached" is skipped only while Bitkit is unlocked in the foreground, so behind the PIN screen it is still posted. The foreground subscription journey from synonymdev/bitkit-ios#1151 is ported as J2, and Manual Test 1 now uses split screen, which can be staged. This answers @jvsena42's three LOWs on aa96c17; the description is updated to match.

@ben-kaufman ben-kaufman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No new material findings in the code review at c97c912. CI still has failed E2E jobs. J1, J2 and manual cases 1 and 2 were not run, and the independent security passes remain incomplete.

Reviewer model: gpt-6-astra
Reasoning effort: high

@ovitrif
ovitrif merged commit 91a212c into master Oct 27, 2026
28 of 32 checks passed
@ovitrif
ovitrif deleted the fix/allowance-limit-foreground branch October 27, 2026 19:11
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.

bug: limit reached notification posts while bitkit shows the request sheet

4 participants