Repository navigation
fix: preserve contact payment setup errors - #1444
Conversation
|
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
There was a problem hiding this comment.
Suggestion: 👍 Approve
Review: diff 5 files.
iOS already reports thrown setup failures and stays on Pay Contacts. Its setup guard, retained in synonymdev/bitkit-ios#856, checks local or adopted credentials synchronously. This Android fix handles a failing SDK access lookup that iOS does not call, so there is no matching lookup to port.
QA:
Tests queued.
Reviewed by gpt-6.1-sol-high via gh-pr-review-loop skill
Commands: @ovi-reviewer review · test · retest
jvsena42
left a comment
There was a problem hiding this comment.
No findings at 5670fae.
Checked:
hasPrivatePaymentAccess()(PrivatePaykitRepo.kt:156) now throws, andContactPaymentSettingsRepo.enable()(:79-81) returns the failure before any settings write. A failed access check persists nothing, publishes nothing and releases the sharing lock; later failure points keep their existing rollback.- An identity without private capability still returns
false, so the public-only path is unchanged. The two background checks (:986,:1681) keep the non-throwing wrapper. - Error text: both callers map to fixed string resources (
PayContactsViewModel.kt:61-69,SettingsViewModel.kt:258-264); no SDK or homeserver message, key or path reaches the toast. One log, at the ViewModel. - Cancellation:
runSuspendCatchingrethrows, the lock releases,isLoadingresets infinally, nothing is logged as an error. - iOS has no SDK capability lookup to swallow (
ContactPaymentsService.swift:85-88decides synchronously), so there is nothing to port.
Device gate: no device check needed (failure path only, not drivable; covered by ContactPaymentSettingsRepoTest.kt and PrivatePaykitRepoTest.kt). CI is green at this head, including e2e.
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Lets an error from the private-payment access check fail ContactPaymentSettingsRepo.enable() before any setting is written, instead of being read as "no access" and silently enabling public-only sharing. Reviewed 5670fae, full tier.
What I checked, and 3 candidates I ruled out
Read in full: ContactPaymentSettingsRepo.kt, the hasPrivatePaymentAccess paths in PrivatePaykitRepo.kt and PaykitSdkService.kt
Call sites traced: setEnabled from SettingsViewModel and PayContactsViewModel; the internal hasPrivatePaymentAccessForCurrentProfile() callers in PrivatePaykitRepo
CI: build, detekt, unit and e2e jobs green; only the human-review check pending
Ruled out
- Internal callers now see exceptions:
hasPrivatePaymentAccessForCurrentProfile()keeps its ownrunSuspendCatching { ... }.getOrDefault(false), so the background sharing paths behave as before. - Cancellation swallowed as a failure:
runSuspendCatchingrethrowsCancellationError, and the access check runs beforesettingsStore.update, so a cancelled toggle writes nothing and thewithLockreleasessharingMutex; covered by the new cancellation test. - Partial state on failure: the early
return Result.failure(it)precedes every write, so no rollback is needed for this path.
Merge confidence: 5/5, CI green and the change is covered by the two new ContactPaymentSettingsRepoTest cases.
There was a problem hiding this comment.
Verdict: ⛔️ Request Changes
Tests for the review: Test 1 fails.
QA:
Tested on Android 15 emulator.
🔴 Test 1
Test 1
Continue showed no progress feedback for 6+ seconds; Profile appeared by 8.05 seconds.
1.mp4 |
![]() | ![]() | ![]() |
Tip
Could we show loading feedback while Continue is pending?
Note
The controlled access-check failure and restore/retry were not exercised; they require a selective SDK failure hook.
Reviewed by gpt-6.1-sol-high via gh-pr-review-loop skill
Commands: @ovi-reviewer review · test · retest
5670fae to
b059b9d
Compare



This PR reports private-payment access errors during contact payment setup instead of silently completing with private sharing disabled.
Description
Out of Scope
Design
N/A - no UI changes. Existing error and retry handling is reused.
Preview
N/A - existing setup screen and error toast are unchanged.
QA Notes
Journeys
N/A - not drivable; see Manual Tests.
Manual Tests
Automated Checks
ContactPaymentSettingsRepoTest.kt- access failure leaves settings and publication untouched, retry succeeds, and cancellation releases the sharing lock. Existing public-only coverage is retained.PrivatePaykitRepoTest.kt- access-check errors and cancellation propagate; contact-preparation identity-error coverage is preserved separately.Local validation: 3,590 unit tests passed, including existing setup error/navigation tests. Compilation passed; all 19 Detekt findings, including formatting, match the unchanged base. Controlled device fault injection was not run.