Repository navigation
test: cover no expiry toast for the request being paid - #1660
Conversation
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
coreyphillips
left a comment
There was a problem hiding this comment.
Two independent reviews, nothing blocking a merge.
nits
- Test emits an ACCEPTED request, which the repo never reports as expired (app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt:1884). The new test feeds
expiredPaykitProposalsa request that the realPaykitPaymentRequestRepo.expiredProposalscan never emit.reopenRetainedHardwareRequestbuilds the request withlifecycleState = ACCEPTED(AppViewModelSendFlowTest.kt:14695). The repo only reports incomingPROPOSEDrequests that are not in flight (PaykitPaymentRequestRepo.kt:1755-1757). The #1643 review describes the case this exclusion is for as a request that expires before acceptance while the user is paying it. The test is still a valid guard, because the view model filter compares ids only. I traced it:onSheetVisibleclearsrequestedPaymentRequestId, andonConfirmPaysetsisSubmittingPaymentRequest, which keeps the active context through the pending update. That leavesactiveIncomingPaymentRequest()?.idas the only check suppressing the toast. CI at 76fe2ce shows the test passing. Emitting a proposed copy would make the input one the repo can produce, without changing what the test proves:kotlin expiredPaykitProposals.emit(listOf(request.copy(lifecycleState = PaymentRequestLifecycleState.PROPOSED)))
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Adds a test that the request being paid gets no expired toast, and fixes a test comment. Reviewed 76fe2ce, light tier, reasoned from the code and CI: the branch was not run here.
What I checked, and 2 candidates I ruled out
Read in full: the diff; AppViewModel.toastExpiredPaymentRequests, finishExpiredPaymentRequestPresentation, markIncomingPaymentRequestPresented, the reopenRetainedHardwareRequest fixture
CI: build, build-local, lint, detekt green; e2e jobs still pending at review time
Ruled out
- Test passing for the wrong reason: the only path that skips the toast for a non-dismissed request is the
handledIdsexclusion (requested id or active request id), and the test reaches it after a confirmed hardware payment, the state the exclusion exists for. I did not run the mutation the description cites (dropping the active id), so that part rests on the author's run. verify(atLeast(0))with a captor proving nothing: it captures every enqueued toast, including none, and the assertion is on their tags, so a stray expiry toast would be caught.
Merge confidence: 5/5, test-only change, unit CI green.
Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the runner does not report it)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@coreyphillips Thanks. Keeping the accepted request as is, since, as you traced, the view model filter compares ids only, so the test guards the same path either way. Switching the input to a proposed copy would cost this approval on a test-only PR. |
coreyphillips
left a comment
There was a problem hiding this comment.
Rechecked after replies, with no new commit since 76fe2ce. Nothing blocking remains.
still open
- Test emits an ACCEPTED request, which the repo never reports as expired (app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt:1884). The new test feeds
expiredPaykitProposalsa request that the realPaykitPaymentRequestRepo.expiredProposalscan never emit.reopenRetainedHardwareRequestbuilds the request withlifecycleState = ACCEPTED(AppViewModelSendFlowTest.kt:14695). The repo only reports incomingPROPOSEDrequests that are not in flight (PaykitPaymentRequestRepo.kt:1755-1757). The #1643 review describes the case this exclusion is for as a request that expires before acceptance while the user is paying it. The test is still a valid guard, because the view model filter compares ids only. I traced it:onSheetVisibleclearsrequestedPaymentRequestId, andonConfirmPaysetsisSubmittingPaymentRequest, which keeps the active context through the pending update. That leavesactiveIncomingPaymentRequest()?.idas the only check suppressing the toast. CI at 76fe2ce shows the test passing. Emitting a proposed copy would make the input one the repo can produce, without changing what the test proves:kotlin expiredPaykitProposals.emit(listOf(request.copy(lifecycleState = PaymentRequestLifecycleState.PROPOSED))). The code is unchanged.reopenRetainedHardwareRequeststill builds an ACCEPTED request (AppViewModelSendFlowTest.kt:14695), and the test still emits it as-is (line 1884), whileexpiredProposalsin PaykitPaymentRequestRepo.kt only reports PROPOSED, non-in-flight requests. @ovitrif's reply restates thattoastExpiredPaymentRequests(AppViewModel.kt:1803-1807) compares ids only, which the original point already granted; it declines the nit rather than showing it wrong. As a nit, this should not hold the merge.
[Low impact] The PR appears safe to merge. SummaryAdds a test that confirms a hardware payment, reports its request as expired, and checks that no expiry toast appears.
No actionable issues found. Tests were not run during this review. Reviews (1) · Last reviewed commit: "test: cover no expiry toast for the requ..." · Reviewed by Greptile |
coreyphillips
left a comment
There was a problem hiding this comment.
Rechecked after replies, with no new commit since 76fe2ce. Nothing blocking remains.
still open
- Test emits an ACCEPTED request, which the repo never reports as expired (app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt:1884). The new test feeds
expiredPaykitProposalsa request that the realPaykitPaymentRequestRepo.expiredProposalscan never emit.reopenRetainedHardwareRequestbuilds the request withlifecycleState = ACCEPTED(AppViewModelSendFlowTest.kt:14695). The repo only reports incomingPROPOSEDrequests that are not in flight (PaykitPaymentRequestRepo.kt:1755-1757). The #1643 review describes the case this exclusion is for as a request that expires before acceptance while the user is paying it. The test is still a valid guard, because the view model filter compares ids only. I traced it:onSheetVisibleclearsrequestedPaymentRequestId, andonConfirmPaysetsisSubmittingPaymentRequest, which keeps the active context through the pending update. That leavesactiveIncomingPaymentRequest()?.idas the only check suppressing the toast. CI at 76fe2ce shows the test passing. Emitting a proposed copy would make the input one the repo can produce, without changing what the test proves:kotlin expiredPaykitProposals.emit(listOf(request.copy(lifecycleState = PaymentRequestLifecycleState.PROPOSED))). The test at AppViewModelSendFlowTest.kt:1884 still emitslistOf(request)fromreopenRetainedHardwareRequest, which still builds the request withlifecycleState = ACCEPTED(line 14695). The repo'sexpiredProposalsfilter still requiresPROPOSED. The only reply is Greptile's general summary, which doesn't mention this point. Emittingrequest.copy(lifecycleState = PaymentRequestLifecycleState.PROPOSED)would settle it.
|
@coreyphillips thanks, merged. |
Refs #1624
Follow-up to #1643, from @coreyphillips' review #1643 (review).
Description
refresh crossing expiry leaves the report to the expiry timer.Out of Scope
Design
N/A — no UI changes.
Preview
N/A — no user-visible changes.
QA Notes
Journeys
N/A
Manual Tests
N/A
Automated Checks
AppViewModelSendFlowTest.ktPaykitPaymentRequestRepoTest.ktAppViewModelSendFlowTest,PaykitPaymentRequestRepoTestand detekt