Repository navigation
feat: set, change and remove DashPay profile payment addresses in KotlinExampleApp - #6146
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 42 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
✅ Final review complete — no blockers (commit d6ed8f2) · triage: critical |
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
bda3f90 to
9302f65
Compare
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
Changes requested: 6 blockers
- Contact Detail can copy an address for the wrong network after a switch —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/ContactDetailScreen.kt:251-265(new)
Impact: A user who opens a testnet contact, switches to mainnet in Settings, and returns to the saved DashPay tab can copy a mainnet address that the contact never published there. - Published addresses appear unpublished when a profile opens before its first sync —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:302-308(new)
Impact: After a restart, users who open an existing profile before sync can see all addresses marked “Not published,” lose the Remove options, and submit a duplicate Create that Platform rejects. - A pending Core autofill can publish the previous address or overwrite a newer edit —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayPaymentAddressesSection.kt:343-361(new)
Impact: A user who taps “Use this wallet's address” and then saves or pastes while the lookup is pending can publish a different Core address from the one they intended. - Core autofill can offer the same public address to two identities in one wallet —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:204-210(new)
Impact: A user who accepts Core autofill on two profiles before the offered address receives a payment can publicly link those identities by publishing the same address. - Contact Detail hides published addresses for contacts managed by the same wallet —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/ContactDetailScreen.kt:252-261(new)
Impact: Users with two identities in the same wallet that are DashPay contacts cannot see or copy one identity's published addresses from the other's contact screen, even after a successful sync. - An APK with a stale native library can bind profile Save to the wrong signature —
packages/rs-unified-sdk-jni/src/dashpay.rs:660-676(new)
Impact: An Android build that packages a cached JNI library can reject a valid profile save or terminate instead of reporting an incompatible native library.
This PR adds DashPay profile payment-address editing and contact display to Android, with Kotlin SDK and JNI bindings and a Room v20 migration. The Kotlin SDK build and x86_64 emulator tests passed; Rust workspace tests were still pending at review time. Three additional suggestions were omitted under the 10-comment limit.
🔴 6 blocking | 🟡 4 suggestion(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.2-sol (agent: phase2-reviewer, role: ffi-engineer); reviewer 6: gpt-6.2-sol (agent: phase2-reviewer, role: rust-quality); reviewer 7: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 8: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 9: gpt-6.2-sol (agent: phase2-reviewer, role: ffi-engineer); reviewer 10: gpt-6.2-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — The feature spans UI, JNI, and persistence, but DashDatabase.kt's 19-to-20 migration only adds nullable columns, and the diff does not change consensus or move funds. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(lane failed),glm-5.3-flash(not used above high effort; tier asks max) - Second Phase-2 pass: on this first full review every Phase-2 reviewer also ran a second, independent time, and the verifier weighed both sets
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— ffi-engineer (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— rust-quality (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— ffi-engineer (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— rust-quality (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/ContactDetailScreen.kt`:
- [BLOCKING] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/ContactDetailScreen.kt:251-265: Contact Detail can copy an address for the wrong network after a switch
Impact: A user who opens a testnet contact, switches to mainnet in Settings, and returns to the saved DashPay tab can copy a mainnet address that the contact never published there.
The copied destination can point to the wrong chain. `MainScreen` saves and restores tab back stacks, and the network switch does not recreate that navigation host. The restored route still has its testnet identity IDs, and `DashpayDao.observeContactProfile` uses those IDs without filtering by `networkRaw`. This section then passes the old row's bytes and the newly selected network to Rust. The stored Core and Platform bytes have no network prefix, so Rust encodes them for the network it was given. Query the full `(networkRaw, ownerIdentityId, contactIdentityId)` key and suppress any collected row that does not match the active network before rendering or enabling Copy. Test returning to the saved contact route after switching networks.
- [BLOCKING] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/ContactDetailScreen.kt:252-261: Contact Detail hides published addresses for contacts managed by the same wallet
Impact: Users with two identities in the same wallet that are DashPay contacts cannot see or copy one identity's published addresses from the other's contact screen, even after a successful sync.
The new section has no profile to display for a same-wallet contact. `sync_contact_profiles` deliberately excludes identities managed by that wallet because their own profiles are authoritative; those profiles persist to `dashpay_profiles`, not `dashpay_contact_profiles`. This section reads only the contact row, and switching to the contact-cache JNI getter alone would still miss. Resolve the authoritative profile source within the selected network, using the managed identity's own profile when applicable. Kotlin's Add Contact preview and Swift's cached-profile helper already show why the own-profile path is needed. Add coverage for a same-wallet contact pair.
In `packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt`:
- [BLOCKING] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:302-308: Published addresses appear unpublished when a profile opens before its first sync
Impact: After a restart, users who open an existing profile before sync can see all addresses marked “Not published,” lose the Remove options, and submit a duplicate Create that Platform rejects.
An existing profile can remain uneditable even after sync finishes. `build_wallet_identity_bucket` restores contact profiles but not the owner's profile, so `getProfile()` can return null from Rust's memory cache while the complete own profile is already in Room. `loadProfile()` turns that miss into `profileExists = false`, which controls both the editor snapshot and `doCreate`. The background sync fills the cache without changing the wallet object, so it does not rerun `LaunchedEffect(wallet)`. Observe the network-scoped persisted own profile for last-known display, as Swift uses its persisted fallback, and refresh from the wallet when sync lands. Keep an unchecked profile distinct from confirmed absence before selecting Create, and test opening the screen before sync and leaving it open through completion.
- [BLOCKING] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:204-210: Core autofill can offer the same public address to two identities in one wallet
Impact: A user who accepts Core autofill on two profiles before the offered address receives a payment can publicly link those identities by publishing the same address.
The two profiles can publish the same destination even though the user asked for a wallet address separately in each editor. The Android view selects account `0` and calls `nextReceiveAddress` without passing the profile identity. The pinned `key-wallet` implementation looks up an available address without reserving it; the per-editor cache and reuse warning do not enforce a policy across identities. The book assigns DashPay wallet decisions to `rs-platform-wallet`, not each mobile host. Use the identity-scoped candidate operation tracked in #6164 to own account selection and reuse policy, or leave Core as typed/pasted until that operation exists. #6164 tracks the analogous Swift behavior, but this PR adds the account-selection decision to Android.
In `packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayPaymentAddressesSection.kt`:
- [BLOCKING] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayPaymentAddressesSection.kt:343-361: A pending Core autofill can publish the previous address or overwrite a newer edit
Impact: A user who taps “Use this wallet's address” and then saves or pastes while the lookup is pending can publish a different Core address from the one they intended.
Save can capture the old bytes, or the delayed lookup can overwrite a newer paste. The screen runs the Core lookup on `Dispatchers.IO`, but `useCoreWalletAddress` neither marks the row as fetching nor captures its revision before suspending. A previously valid Set value therefore leaves Save enabled, repeated taps can start overlapping lookups, and the returned result is applied unconditionally. Use the shielded row's pending and revision pattern for Core, reject overlapping calls in the model, and recheck submit eligibility before capturing the updates. Test a suspended lookup with both a valid previous value and a newer manual edit.
- [SUGGESTION] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayPaymentAddressesSection.kt:150-154: Android builds without shielded support label valid published shielded addresses as invalid
Impact: Users of a `--no-shielded` Android build can be told that a valid published shielded address is invalid when the build simply cannot display it.
The UI reports a validation failure that the wallet did not report. In a non-shielded build, `shielded_to_string` can validate the stored bytes and still return `None` because rendering is unavailable. JNI forwards this as a successful null, which both the read-only list and the editor's Published row interpret as invalid address data. Use neutral wording such as “Published, but this address could not be displayed” in both places, or expose a distinct rendering result from Rust if the UI needs to say why.
In `packages/rs-unified-sdk-jni/src/dashpay.rs`:
- [BLOCKING] packages/rs-unified-sdk-jni/src/dashpay.rs:660-676: An APK with a stale native library can bind profile Save to the wrong signature
Impact: An Android build that packages a cached JNI library can reject a valid profile save or terminate instead of reporting an incompatible native library.
A mismatched Kotlin/native pair can enter the profile writer instead of failing symbol lookup. The export keeps the old short JNI name while inserting six arguments before `doCreate` and the signer handle. With new Kotlin and an old library, even an all-Keep save supplies the old entry point with a null where it expects the signer. In the opposite direction, the new export can receive a native handle where it expects a JVM array reference; the Rust panic guard cannot make that reference safe. The documented Gradle and split-APK caching paths can leave a stale `.so`, and the packaging check checks presence and size, not ABI. Export the expanded signature under a distinct JNI name and keep the original layout if retaining the old symbol.
In `packages/rs-unified-sdk-jni/src/persistence.rs`:
- [SUGGESTION] packages/rs-unified-sdk-jni/src/persistence.rs:673-684: Precompiled custom bridges can silently stop storing identity updates after an SDK upgrade
Impact: A host that directly registers an older precompiled custom persistence bridge through the raw JNI manager can lose identity and contact-profile updates on restart even though the callbacks returned success.
The new callback descriptors can turn a persistence operation into a successful no-op. A subclass compiled against the old SDK still declares the old methods, so dispatch using either new descriptor finds the inherited `NativePersistenceBridge` implementation, which returns `0` without storing anything. The descriptor smoke check also passes because inherited methods resolve. The standard Kotlin manager constructs the updated Room handler itself; this affects hosts using the raw bridge, not that standard path. Preserve the old virtual methods and delegate to them from the new defaults, or detect and reject an old-only override at registration rather than acknowledging writes it did not perform.
In `packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/tokens/Dashpay.kt`:
- [SUGGESTION] packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/tokens/Dashpay.kt:767-778: Previously compiled callers lose the original profile-write method after an SDK upgrade
Impact: An Android app that upgrades the SDK without recompiling a library built against the old profile writer can hit `NoSuchMethodError` even if that library never edits payment addresses.
An unchanged binary caller can fail before it reaches JNI. The released v5.0.3 source has the seven-argument suspend method with an `avatarBytes` default; adding the three trailing Keep defaults preserves ordinary Kotlin source calls but replaces both the JVM method descriptor and its `$default` bridge. Preserve the original overload and its default and delegate to an additive address-aware method. If the ABI break is intentional, document the recompile requirement in the PR's breaking-changes section, which currently only calls out the persistence callbacks.
In `packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/persistence/DashDatabase.kt`:
- [SUGGESTION] packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/persistence/DashDatabase.kt:852-859: Recently cached contacts can appear to have no published addresses after upgrading
Impact: After upgrading from Room v19 to v20, users can still miss a contact's published addresses after a successful sync if the old row was checked within the past hour.
The first sync after migration can skip a row that has never stored payment addresses. The migration adds null address columns but keeps `checkedAtMs`. Restore passes that timestamp to Rust unchanged, so `should_fetch_profile` treats the incomplete legacy row as fresh for the remainder of the one-hour window. Invalidate freshness for migrated contact rows while preserving their name and avatar, so the next sweep fetches the complete profile. Cover a recently checked v19 row in the migration test.
Out-of-scope follow-up suggestions (1)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- An older profile refresh can overwrite a confirmed profile write — The shared Rust sync fetches before taking the lock that applies its result. A confirmed write can update the cache first, then lose to the older snapshot because the refresh does not compare revisions or proof heights. This PR does not change that ordering.
- Follow-up: Track the shared wallet cache-ordering fix and an interleaving test in #6165.
|
Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix; thepastaclaw left review threads unresolved; resolve them. |
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 2 only (queue backlog)
Changes requested: 4 blockers
- A deleted DashPay profile still appears published and cannot be recreated in the editor —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:124-127(new)
Impact: An owner who deletes a cached profile can reopen Your Profile after a successful sync, see its old payment addresses, and be unable to create a replacement from the editor. - Saving only an address can undo a profile text change made on another device —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:125-127(new)
Impact: An owner who changes only a payment address from a last-known Room profile can silently overwrite a newer public message or display name. - Published addresses appear unpublished when a profile opens before its first sync —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:125-132(thread, carried)
Impact: A user who starts editing a restored identity before its existing profile arrives can still be offered Create instead of Save after sync finds the profile. - Contact Detail hides published addresses for contacts managed by the same wallet —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/ContactDetailScreen.kt:264-268(thread, carried)
Impact: If a cached contact is later discovered as an identity of the same wallet, Contact Detail can keep hiding its new address or offering a removed address even after sync.
New on this head: This revision of the Android DashPay profile editor adds a Room fallback for own profiles, renders contact addresses on the identity’s network, guards Core autofill against late results, and renames the expanded JNI writer. Runner selection passed; Rust workspace tests and the Kotlin SDK emulator build and tests are pending, with no failed code checks reported.
🔴 4 blocking
Still open from earlier rounds (2)
- 🔴 Blocking: Published addresses appear unpublished when a profile opens before its first sync —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:125-132(thread) - 🔴 Blocking: Contact Detail hides published addresses for contacts managed by the same wallet —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/ContactDetailScreen.kt:264-268(thread)
Review provenance
Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 3: gpt-6.2-astra (agent: phase2-reviewer, role: ffi-engineer); reviewer 4: gpt-6.2-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 5: gpt-6.2-astra (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — The change is intricate across Kotlin, JNI, and persistence, and DashDatabase.kt changes a critical surface by migrating two existing Room tables from schema 19 to 20. - Phase 1 reviewers: not run (skipped for throughput: 13 PRs queued, above the 10 limit)
- New since the last final review (
9302f653): 2 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 2 confirmed - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— ffi-engineer (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— platform-versioning (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— rust-quality (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt`:
- [BLOCKING] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:124-127: A deleted DashPay profile still appears published and cannot be recreated in the editor
Impact: An owner who deletes a cached profile can reopen Your Profile after a successful sync, see its old payment addresses, and be unable to create a replacement from the editor.
The new Room fallback resurrects deleted payment destinations and makes every save take the Update path. An owner can delete a DashPay `profile` through Browse Documents → Delete Document because the type inherits the contract’s deletable default. When a successful profile fetch finds no document, `sync_profiles` clears the Rust cache or skips an unchanged `None` after restart. Kotlin’s `onPersistIdentityUpsert` deliberately treats an absent profile as no update, so neither case removes the old Room row. On reopening, `getProfile()` returns null, the fallback sets `profileExists = true`, and the SDK’s update fetch fails with “No existing profile document found to update.” Carry a successful lookup that found no document through the wallet’s profile state and persistence path; do not remove the row on an unchecked cache miss or failed fetch.
_Confirmed by an independent pass: An Android user who has published and cached a DashPay profile can delete its document through Browse Documents → Delete Document. After a successful profile sync confirms the deletion, reopening Your Profile still shows the cached payment addresses, and every Save attempts an update that fails with “No existing profile document found to update” instead of letting the user create a new profile._
- [BLOCKING] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:125-127: Saving only an address can undo a profile text change made on another device
Impact: An owner who changes only a payment address from a last-known Room profile can silently overwrite a newer public message or display name.
An address-only save can write old text back to Platform. If another device changes the public message while Android is offline, a user who relaunches Android and enters Edit before the own-profile fetch can start from the new Room fallback. Edit seeds the text fields from that row, and Save sends every nonempty field at lines 269–274 even when the user only touched an address. The Rust SDK fetches the current document, but `ProfileFields::overlay` treats the submitted old message as an explicit replacement, so the newer message is lost. On updates, send text and avatar fields only when the user changed them from the edit-session snapshot. Test an address-only update against a newer on-chain message.
_Confirmed by an independent pass: After another device changes the same identity’s nonempty public message, an Android user can reopen Your Profile before the next own-profile sync and start editing from the older Room row. If the user removes a published address and saves once online without touching the message, the successful update also replaces the newer on-chain message with the old one._
- [BLOCKING] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:125-132: Published addresses appear unpublished when a profile opens before its first sync
(carried; thread: https://github.com/dashpay/platform/pull/6146#discussion_r4673371913)
In `packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/ContactDetailScreen.kt`:
- [BLOCKING] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/ContactDetailScreen.kt:264-268: Contact Detail hides published addresses for contacts managed by the same wallet
(carried; thread: https://github.com/dashpay/platform/pull/6146#discussion_r4673371927)
|
Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix; thepastaclaw left review threads unresolved; resolve them. |
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 2 only (queue backlog)
Changes requested: 3 blockers
- Your Profile can copy a testnet address as a mainnet destination after a network switch —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:399-400(new)
Impact: An owner who switches to mainnet in Settings and returns to a saved testnet profile can copy a valid mainnet destination that the profile never published. - Opening Your Profile during startup sync can restore an older payment address —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:144-145(new)
Impact: An owner who opens Your Profile during startup sync can have a recently changed payment address replaced by the previous one in both wallet memory and Room. - Published addresses appear unpublished when a profile opens before its first sync —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:144-146(thread, carried)
Impact: An owner who reopens a published profile after restarting offline can see its saved addresses disappear and be offered Create instead of Update.
New on this head: This revision makes Your Profile check the wallet before enabling Edit, sends only text fields changed during the edit, and selects the wallet’s own profile for same-wallet contacts. The Kotlin emulator build and tests and the Rust workspace tests were still pending when checked; no code checks had failed.
🔴 3 blocking
Still open from earlier rounds (1)
- 🔴 Blocking: Published addresses appear unpublished when a profile opens before its first sync —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:144-146(thread)
Review provenance
Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 3: gpt-6.2-astra (agent: phase2-reviewer, role: ffi-engineer); reviewer 4: gpt-6.2-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 5: gpt-6.2-astra (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — The change is substantial across the Android UI, Kotlin SDK, and JNI, and DashDatabase.kt changes a critical surface directly by migrating two existing Room tables from schema 19 to 20. - Phase 1 reviewers: not run (skipped for throughput: 11 PRs queued, above the 10 limit)
- New since the last final review (
b69d296c): 2 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 2 confirmed - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— ffi-engineer (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— platform-versioning (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— rust-quality (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt`:
- [BLOCKING] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:399-400: Your Profile can copy a testnet address as a mainnet destination after a network switch
Impact: An owner who switches to mainnet in Settings and returns to a saved testnet profile can copy a valid mainnet destination that the profile never published.
The copied address can be valid for the wrong chain. Open Your Profile on testnet with a published Core or Platform address, switch to mainnet in Settings, then return to the DashPay tab. `MainScreen` restores the route with its original identity ID. Even when the mainnet manager has no wallet for that ID and `loadProfile()` returns early, the new `shownProfile` fallback still displays the matching testnet Room row. The address section receives the mainnet manager’s network, so Rust encodes the row’s network-neutral bytes for mainnet and the UI offers Copy. Keep the profile and its source network together when rendering, as Contact Detail does, or suppress the section on a network mismatch. Cover restoring the own-profile route with no matching wallet on the newly selected network.
_Confirmed by an independent pass: A user with a cached testnet profile containing a published Core or Platform address can leave Your Profile open, switch to mainnet in Settings, and return to the restored DashPay route. Even without a matching mainnet wallet, the screen displays the testnet row and lets the user copy its address encoded as a valid mainnet destination that the profile never published on mainnet._
- [BLOCKING] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:144-145: Opening Your Profile during startup sync can restore an older payment address
Impact: An owner who opens Your Profile during startup sync can have a recently changed payment address replaced by the previous one in both wallet memory and Room.
The app can show and offer to copy the previous address even after syncing the new one. `AppContainer` starts the background DashPay sweep at launch, and opening Your Profile before the cache fills now starts another `syncProfiles()` directly through JNI, outside `DashPaySyncManager`’s single-pass guard. If the two reads see the blocks just before and after an address change on another device, both responses can pass the SDK’s freshness check. Rust fetches before acquiring the wallet write lock, and `sync_profiles` compares only whether the profile differs, not which read is newer. If the older read finishes last, `set_dashpay_profile` replaces the newer cached profile and persists the old address to Room. Have the screen await a coordinated wallet check or use an identity-scoped read that does not write back to the shared cache. Test that delivering two responses in reverse order cannot roll back the stored profile.
_Confirmed by an independent pass: Opening Your Profile at startup before the wallet cache fills starts a second profile sync alongside the startup sweep. If the screen fetches the old address just before another device's update and the sweep stores the new address before the screen's request finishes, the late result overwrites both the wallet cache and Room, and the screen offers the superseded address for copying._
- [BLOCKING] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:144-146: Published addresses appear unpublished when a profile opens before its first sync
(carried; thread: https://github.com/dashpay/platform/pull/6146#discussion_r4673371913)
|
Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix; thepastaclaw left review threads unresolved; resolve them. |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Changes requested: 1 blocker
- Saving again after sync finds a profile can charge a fee for a discarded draft —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:347-359(new)
Impact: An owner whose existing profile loads while they edit a blank form can follow the Save prompt, spend Platform credits, and still not publish their edit.
New on this head: This revision makes Your Profile poll the wallet cache while waiting for two DashPay sweep completions, and rechecks the cache before submitting a Create. The Kotlin SDK emulator build and tests and the Rust workspace tests are pending; no code checks are failing.
A pattern across this PR's review rounds
This is review round 5, and the PR has drawn 12 blocking findings so far. 4 of them share one underlying cause. They are listed with the other findings as usual; fixing the cause is likely to be cheaper than fixing each case.
1. No confirmed profile result for the selected identity (3 new in this round, 3 earlier finding(s))
DashPayProfileScreen needs to know whether the selected identity has a profile, but getProfile() returns the same empty cache result before a check, after a failed fetch, and after confirmed absence; the last-known Room row can also survive deletion. The two-pass gate polls dashPayLastSyncUnixSeconds(), a manager-wide wall-clock timestamp, because a check that finds nothing writes no Room row; that timestamp cannot confirm the identity's result and can leave Edit waiting after a clock correction. The pre-Create reread catches a profile only once it appears in the cache, so the screen can open a blank draft, discard it when the profile arrives, and prompt a Save that can charge for an update…
Already tracked: #6187
In this round: Saving again after sync finds a profile can charge a fee for a discarded draft; Edit can stay disabled after the phone clock moves backward; The Edit gate has no regression test for sweeps that write no profile row
Suggested decision (land the prerequisite first): Land the identity-scoped own-profile check from #6187 in rs-platform-wallet and expose it to Kotlin before this screen offers Create. The result must distinguish found, confirmed absent, and fetch failed, even when there is no Room row to write. If this PR lands first, keep last-known display and editing of loaded profiles, but leave Create unavailable when the cache is empty.
🔴 1 blocking | 🟡 3 suggestion(s)
Still open from earlier rounds (1)
- 🟡 Suggestion: Your Profile can offer a duplicate Create after recovery or keep Edit disabled after a successful sync —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:167-172(thread)
Review provenance
Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 3: gpt-6.2-astra (agent: phase2-reviewer, role: ffi-engineer); reviewer 4: gpt-6.2-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 5: gpt-6.2-astra (agent: phase2-reviewer, role: rust-quality); reviewer 6: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 7: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — The change is intricate across the editor, JNI, and persistence layers, and DashDatabase.kt changes a critical surface by migrating two existing Room tables from schema 19 to 20 as part of the address persistence round trip. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(lane failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- New since the last final review (
5bab369a): 1 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 1 confirmed - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— ffi-engineer (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— platform-versioning (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— rust-quality (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
Several findings on this PR share an underlying cause (the review's "pattern" section): No confirmed profile result for the selected identity. When you fix the findings below, fix the cause, not only the reported case. The review suggests (land the prerequisite first): Land the identity-scoped own-profile check from #6187 in rs-platform-wallet and expose it to Kotlin before this screen offers Create. The result must distinguish found, confirmed absent, and fetch failed, even when there is no Room row to write. If this PR lands first, keep last-known display and editing of loaded profiles, but leave Create unavailable when the cache is empty. If that decision is not yours to make, say so to the PR's author or maintainer.
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt`:
- [BLOCKING] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:347-359: Saving again after sync finds a profile can charge a fee for a discarded draft
Impact: An owner whose existing profile loads while they edit a blank form can follow the Save prompt, spend Platform credits, and still not publish their edit.
The prompted second Save can spend credits without publishing the user's edit. An owner with a funded identity and a usable signing key can open Your Profile after intermittent connectivity lets the sweep check pass with an empty cache, paste a valid payment address, then tap Create after sync finds their existing profile. The first tap correctly sends nothing, but this branch overwrites the draft, sets `editSnapshot` to the reloaded text, resets every address to Keep, and says “Review it and save again.” Save is enabled again when `isSaving` clears. Following that prompt without making another edit sends null for every text field and Keep for every address. The Rust SDK still increments the document revision, signs, and broadcasts a fee-bearing replacement. Keep the user's explicit changes for review against the found profile, or say the draft was discarded and disable Save until there is a new change. Test both taps with an address Set in the original draft.
_Confirmed by an independent pass: After relaunch, failed profile fetches can leave a funded, signable identity’s existing profile out of the wallet cache even though the sync passes have completed, so Your Profile lets the owner draft an address change under Create. If connectivity recovers and a later pass finds the profile while the editor is open, the first Create tap discards the draft and prompts the owner to save again. Following that prompt without re-entering the edit spends Platform credits on a document replacement that does not publish the requested address._
- [SUGGESTION] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:168-172: Edit can stay disabled after the phone clock moves backward
Impact: An owner creating their first profile can remain on “Waiting for the DashPay sync” despite successful checks until the clock catches up or they reopen the screen.
Successful checks can stop advancing the Edit gate after a clock correction. `DashPaySyncManager::sync_now` stamps each sweep with whole Unix seconds from `SystemTime::now()`, and JNI passes that wall-clock value through unchanged. If it falls behind `lastSyncAtOpen` or `firstSyncAfterOpen`, the strict `>` comparison cannot count subsequent sweeps until their timestamps pass the saved marker. Polling does not help a profile-less identity because the cache keeps returning null. Use a monotonic completion generation or the identity-scoped result tracked in #6187 rather than ordering wall-clock timestamps.
- [SUGGESTION] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:167-189: The Edit gate has no regression test for sweeps that write no profile row
Impact: The example-app tests would miss a regression that enables Create after an older sweep or leaves Edit disabled when a later sweep writes nothing.
The existing editor-model tests do not exercise the screen's new polling or timestamp gate, and the DP-04 manual flow does not control sweep timing. With a fake cache and virtual time, start from an old nonzero timestamp and a cache miss, then advance the timestamp once and verify Edit remains disabled. Advance it again without changing the busy flag or the Room row and verify the next poll enables Edit. Also check that a cached profile enables Edit without waiting for either advance. These cases need neither JNI nor a network.
- [SUGGESTION] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:167-172: Your Profile can offer a duplicate Create after recovery or keep Edit disabled after a successful sync
(carried; thread: https://github.com/dashpay/platform/pull/6146#discussion_r4673623902)
|
Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix; thepastaclaw left review threads unresolved; resolve them. |
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Changes requested: 1 blocker
- Your Profile can offer a duplicate Create after recovery or keep Edit disabled after a successful sync —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:527-536(thread, carried)
Impact: An owner who opens Your Profile after recovering an identity with a published profile can be offered a blank editor and submit a duplicate Create that Platform rejects.
New on this head: This revision extracts the DashPay profile check into a tested gate, counts timestamp changes even after a clock rollback, and disables Save after the editor reloads a profile and discards the draft. The Kotlin emulator build and tests and the Rust workspace tests are still pending; no code check has reported a failure.
🔴 1 blocking | 🟡 2 suggestion(s)
Still open from earlier rounds (1)
- 🔴 Blocking: Your Profile can offer a duplicate Create after recovery or keep Edit disabled after a successful sync —
packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:527-536(thread)
Review provenance
Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 3: gpt-6.2-astra (agent: phase2-reviewer, role: ffi-engineer); reviewer 4: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 5: gpt-6.2-astra (agent: phase2-reviewer, role: rust-quality); reviewer 6: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — The Room 19-to-20 storage migration in DashDatabase.kt is part of an intricate cross-layer change that must preserve existing profile rows and carry nullable payment addresses correctly through both JNI persistence and restore. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(lane failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— ffi-engineer (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— rust-quality (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/kotlin-sdk/KotlinExampleApp/app/src/test/java/org/dashfoundation/example/ui/dashpay/OwnProfileCheckGateTest.kt`:
- [SUGGESTION] packages/kotlin-sdk/KotlinExampleApp/app/src/test/java/org/dashfoundation/example/ui/dashpay/OwnProfileCheckGateTest.kt:23-31: The Edit gate has no regression test for sweeps that write no profile row
Impact: If the screen stops polling, an owner without a profile can stay stuck waiting after successful sweeps that write no Room row or produce an observed busy-state change, while the new tests still pass.
The new test verifies what the gate does once it receives a timestamp, but it supplies every sample by calling `observe` directly. Removing the screen's two-second polling loop would leave it green. Exercise the code that delivers those samples with fake suspending profile and timestamp readers: hold the busy flag and Room row fixed, advance virtual time through the first and second completions, and assert that Edit opens only after the second. A fake initial cache hit can cover the immediate Edit branch without a native wallet.
In `packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayPaymentAddressesSection.kt`:
- [SUGGESTION] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayPaymentAddressesSection.kt:426-428: Autofilling an already-published address enables a paid Save with no address change
Impact: An owner who selects Set and autofills the shielded address already on their profile can spend Platform credits without changing any profile field.
The new `hasChanges` check treats Set as a change even when it contains the published bytes. Repeating shielded autofill for an identity that already publishes its dedicated tip address returns that same address. After the fill completes, the row is valid and no longer pending, so Save enables with no other edits. The SDK overlays the identical bytes, increments the document revision, and signs and broadcasts the replacement. For Save eligibility, compare the parsed Set bytes with the edit snapshot's `published(kind)` by content. Test with distinct byte arrays containing the same address.
In `packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt`:
- [BLOCKING] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayProfileScreen.kt:527-536: Your Profile can offer a duplicate Create after recovery or keep Edit disabled after a successful sync
(carried; thread: https://github.com/dashpay/platform/pull/6146#discussion_r4673623902)
|
Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix. |
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
1064c52 to
fb2ef34
Compare
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
fb2ef34 to
908a2e9
Compare
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
…linExampleApp Port of the SwiftExampleApp payment address editor (#6094) to Android. - JNI: payment address support, string to bytes and bytes to string exports over the platform-wallet-ffi helpers; the profile write takes keep/set/remove per address (createOrUpdateProfileWithAddresses); profile JSON carries the addresses as hex. - Persistence: the own and contact profile rows keep their addresses, and the restore hands a contact's addresses back to Rust. The migration clears contact profile freshness so the next sync fetches their addresses. - Kotlin SDK: DashPayPaymentAddressKind/Support/Update, DashPayPaymentAddresses.bytes/string, Dashpay.paymentAddressSupport. - App: payment address section in the profile editor and screen (Core and shielded fills; the Platform field is typed, #6164), and the last known addresses on the contact detail screen, on the identity's own network. Your Profile decides create or update from the wallet after a sync pass that started after it opened (#6187 tracks the Rust side), sends only changed text, and needs a change to save an update. - TEST_PLAN DP-20/DP-21 mirror Swift DP-31/32. Co-Authored-By: Claude Opus 5.5 <[email protected]>
908a2e9 to
d6ed8f2
Compare
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
New on this head: This revision of the Kotlin DashPay payment-address editor treats re-entering the published address as Keep, preserves failed sync-timestamp reads as unknown, and tests the polling loop used by Your Profile. The rebase moves the profile-column migration to Room 20→21, retaining the base branch’s 19→20 asset-lock migration. The Kotlin SDK emulator build and tests passed; Rust workspace tests are still pending.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Review provenance
Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 3: gpt-6.2-astra (agent: phase2-reviewer, role: ffi-engineer); reviewer 4: gpt-6.2-astra (agent: phase2-reviewer, role: rust-quality); reviewer 5: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 6: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — The change is substantial even without the generated schema, and DashDatabase.kt changes a storage migration by upgrading two Room profile tables from schema 20 to 21 while the JNI persistence bridge carries the new fields across saves and restores. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(lane failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— ffi-engineer (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— rust-quality (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
|
Bots are done — your move: post |
Basic explanation
Based on
v5.1-dev, which now has #6094 (the Swift editor, the Rust helpers and the FFI this PR bridges).What this does: In the Android example app, a user can now set, change or remove the public payment addresses on their DashPay profile (Core, Platform, shielded). A contact's published addresses show on the contact's screen. Same behaviour as the iOS app in #6094.
Value: Kotlin parity for
dashpay.profile_payment_addresses. Before this, the Kotlin SDK could not write or read these addresses, and Room dropped them.Risks: Low. App UI, JNI marshalling, and a Room migration that adds three nullable columns to two tables. An edit that does not touch the addresses keeps them as published. No consensus change. The Rust helpers and FFI from #6094 are used unchanged.
Issue being fixed or feature implemented
#6124 carried the addresses through the wallet, FFI and Swift, and #6094 added the Swift editor. On Android:
// Kotlin does not persist payment addresses yet),What was done?
JNI (
rs-unified-sdk-jni)dashpay_payment_address.rs:DashpayNative.paymentAddressSupport,paymentAddressFromString,paymentAddressToString, overplatform_wallet_dashpay_profile_payment_address_supportanddashpay_profile_payment_address_from_string/_to_string. They only marshal.createOrUpdateProfilenow callsplatform_wallet_create_or_update_dashpay_profile_with_addresses_with_signer, with an action (0 keep, 1 set, 2 remove) and bytes per address.profile_to_jsonaddscorePaymentAddress,platformPaymentAddress,shieldedAddressas lower hex when published.onPersistIdentityUpsertandonPersistContactProfileDeltaget the three addresses as trailing nullablebyte[]. A contact's addresses are read back fromContactProfileRestoreDataon load. The two descriptors are now shared constants, so the call site and the descriptor check cannot drift.Kotlin SDK
DashPayPaymentAddressKind,DashPayPaymentAddressSupport,DashPayPaymentAddressUpdate(Keep/Set(bytes)/Remove).DashPayPaymentAddresses.bytes(kind, text, network)and.string(kind, bytes, network).Dashpay.paymentAddressSupport().Dashpay.createOrUpdateProfile(...)takescorePaymentAddress,platformPaymentAddress,shieldedAddress, each defaulting toKeep.dashpay_profilesanddashpay_contact_profilesgaincorePaymentAddress,platformPaymentAddress,shieldedAddress(nullable BLOB), migration 20 to 21. Swift uses a separate sidecar table so its released SwiftData schema stays unchanged. Room migrates in place, so here the addresses sit on the profile row and commit with it.KotlinExampleApp
DashPayPaymentAddressesSection.kt, ported from SwiftDashPayPaymentAddressesSection.swift: a read-only list and the editor.nextReceiveAddress(0), fetched once per edit. While the field holds it, a note says the wallet can offer the same address to another identity's profile until it is paid.prepareShieldedIdentityAddress, the identity's account default address. An edit made while it is being prepared wins, and Save is held until the fill ends.paymentAddressSupport(). Save is disabled while a Set field holds no valid address.dashpay.profile.paymentAddress.<kind>.*,dashpay.contact.paymentAddress.<kind>.*,dashpay.profile.save).Example:
Docs
DP-20(mirrors SwiftDP-31) andDP-21(mirrors SwiftDP-32).DP-04notes updated.partial/partial/ restarttested.PARITY_SUMMARY.mdregenerated.Public interface changes
DashpayNative.createOrUpdateProfileis replaced bycreateOrUpdateProfileWithAddresses, which adds six arguments. The new name makes a stale native library fail to link instead of reading the wrong arguments. The publicDashpay.createOrUpdateProfileonly gains three trailing arguments with aKeepdefault, so existing Kotlin source compiles unchanged, but its JVM signature changes.NativePersistenceBridge.onPersistIdentityUpsertandonPersistContactProfileDeltagain three trailingByteArray?parameters, defaultnull. Kotlin callers compile unchanged. A subclass outside the SDK that overrides them must add the parameters, because the JVM signature changed. The descriptors changed with them in the same commit.ContactProfileRestoreDatagains three@JvmFieldfields, defaultnull.DashPayPaymentAddressKind,DashPayPaymentAddressSupport,DashPayPaymentAddressUpdate,DashPayPaymentAddresses. New functionDashpay.paymentAddressSupport().How the open Swift follow-ups apply to Kotlin
PlatformWallet::write_dashpay_profile). Kotlin passes the bytes and adds no check of its own, so it behaves the same as Swift. The fix in Rust will apply to both.Recovery after process death
shouldPersistAndRestoreAContactsPublishedPaymentAddressesand by the extendedWalletManagerRoundTripTest.How Has This Been Tested?
cargo test -p rs-unified-sdk-jni --lib -- profile payment_address descriptor support_flags: 10 passed. 4 are new: JSON hex fields, support flag order, exact-length restore copy, descriptor tails.cargo clippy -p rs-unified-sdk-jni --all-targets --all-features --locked -- --no-deps -D warnings: clean.cargo fmt --all: clean../gradlew :sdk:testDebugUnitTest --tests '*PlatformWalletPersistenceHandlerTest*': 169 passed, 4 new:./gradlew :sdk:compileDebugAndroidTestKotlin: compiles.FfiSmokeTest.profilePaymentAddressSymbolsBindAndConvert.DashDatabaseMigrationTest.migrate20To21AddsProfilePaymentAddressColumns.WalletManagerRoundTripTest../gradlew :sdk:testDebugUnitTest --tests '*DashDatabaseTest*': 17 passed, including the version 21 pin and the newDashDatabaseTest.shouldHaveNullablePaymentAddressColumnsOnBothProfileTables../gradlew :app:testDebugUnitTest --tests '*DashPayPaymentAddressEditorModelTest*': 9 passed, including a prepared shielded address dropped when the user edited the field meanwhile.python3 scripts/check_sdk_parity_manifest.py: OK.Not yet verified
build_android.shnative build, so the instrumented tests (FfiSmokeTest,WalletManagerRoundTripTest,DashDatabaseMigrationTest) have not run on a device. The emulator is shared with other Kotlin threads.DP-20/DP-21, and nothing against a network.Breaking Changes
None for consensus or the wire. Room moves to schema 21 with a migration, which also clears each cached contact profile's
checkedAtMsso the next sync fetches its addresses. A binary built against the old SDK that callsDashpay.createOrUpdateProfilemust be recompiled, since its JVM signature changed. A source rebuild needs no change. A subclass ofNativePersistenceBridgeoutside the SDK that overrides the two profile callbacks must add the new parameters, as described above. Another open Kotlin PR that also adds Room version 21 will need its version renumbered.Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
d6ed8f2/self-reviewedsdk-parity— you own itkotlin-sdk(packages/kotlin-sdk/KotlinExampleApp/TEST_PLAN.md,packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/ContactDetailScreen.kt,packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/DashPayJson.ktand 24 more) — HashEngineeringWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.