Skip to content

fix: Dash DEX sell-swap fixes (MO-983, MO-984, MO-969) - #1519

Merged
HashEngineering merged 11 commits into
masterfrom
fix/dash-dex-fixes
Jul 29, 2026
Merged

HashEngineering merged 11 commits into
masterfrom
fix/dash-dex-fixes

Conversation

@HashEngineering

@HashEngineering HashEngineering commented Jul 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A batch of Dash DEX (SwapKit / NEAR Intents) sell-swap fixes, driven by a field report of a DASH → SOL swap whose funds went to a "different address than intended" (MO-983). Investigating that report surfaced two more defects (MO-984, MO-969).

MO-983 — persist the committed swap route, not the stale preview quote

commitSwapTransaction refreshes the SwapKit route before broadcasting (routeIds expire after 60s); on NEAR Intents routes the refreshed quote creates a new intent with a fresh one-time deposit address, which the transaction pays. The stored SwapOrder, the success-screen params and the marked address were still built from the pre-refresh preview model, so swap tracking and the in-app NEAR Intents explorer link followed the abandoned first intent — stuck on "Pending Deposit" forever even when the swap settled. commitSwapTrade now persists the model returned by the commit, and logs when the deposit address changed across the refresh.

MO-984 — max sells always refunded on NEAR Intents routes

A max ("empty wallet") sell sweeps the balance and the miner fee comes out of the sweep's single output, so the deposit delivers balance − fee — but the quote was requested for the full balance, and NEAR Intents refuses any deposit below the quoted amount, auto-refunding ~1h later minus a 0.001 DASH fee. Every max sell on a NEAR route was doomed. getSwapInfo now quotes the post-fee sweep output (via estimateNetworkFee(emptyWallet = true), derived from the current balance so preview and the pre-broadcast refresh stay idempotent), and buildAndSendDepositTx gains a pre-broadcast guard that aborts with a recoverable error if the balance dropped below the quoted amount. Maya vault routes execute on whatever arrives and are unchanged.

MO-969 — Dash address accepted as sell destination → "Conversion failed"

Several target chains validate destinations with permissive lexical patterns that a Dash address also satisfies — Solana accepted any 32–44 char Base58 string, and a Dash address is 34 Base58 chars. Three layers: SolanaAddressParser now requires the Base58 payload to decode to a raw 32-byte ed25519 key (rejecting 25-byte Base58Check addresses in exactMatch and findAll, including the clipboard row); SolanaPaymentIntentParser validates the address in its URI-prefixed branch, which previously bypassed validation entirely; and the address-input continue gate explicitly rejects any checksum-valid DASH address as a sell destination, covering every target chain's parser at once.

Also included: buy enter-amount title direction fix, all-caps bech32 scan handling and lowercase display, and the URI-prefix memo colon fix.

Test plan

  • :integrations:maya unit tests pass; AddressParserTest extended with the field-report Dash addresses and a Bitcoin address as Solana-rejection regression cases
  • Manual (recommended before release): small max sell DASH → SOL on a NEAR route — preview should show balance-minus-fee, the intent should complete rather than refund, and the tx details explorer link should open the funded intent
  • Field-report forensics for MO-983/984 (tx a050e551…, refund 63857302…) documented in the Jira tickets

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Consistent canonical address casing across scan, paste, and URI inputs (including uppercase Bech32 QR normalization where allowed).
    • Stricter chain-specific case rules and improved Bech32 mixed-case rejection.
  • Bug Fixes
    • Fixed delimiter/colon handling in multiple URI address parsers so extracted addresses exclude the separator.
    • Improved address input normalization and corrected Dash address rejection in the continue flow.
    • Swap preview/commit consistency improved, with additional safety checks for maximum trades.
    • Corrected DEX conversion wording (“Convert %s to Dash”).
  • Tests
    • Expanded address/parser and payment-intent test coverage for casing, prefixes, memo generation, and invalid payload rejection.

HashEngineering and others added 7 commits July 27, 2026 10:56
BIP-173 allows a bech32 string to be all-lowercase or all-uppercase
(QR codes use upper for the denser alphanumeric mode), but the parser
regexes were lowercase-only, so scanned all-caps addresses (BTC bc1...,
kujira/maya/thor, Zcash shielded, Cardano Shelley, Radix) were
considered invalid.

- AddressParser: optional ignoreCase flag for the match regex
- Bech32AddressParser: match case-insensitively and reject mixed case
  (needed for chains without params, which never reach a decoder)
- CardanoAddressParser: case-insensitive Shelley alternative only;
  Byron Base58 stays case-sensitive
- Intent parsers normalize matched bech32 addresses to their canonical
  lowercase form before building the swap memo (Base58 forms untouched)
- Add all-caps and mixed-case vectors to both AddressParserTests,
  including the BIP-173 uppercase test vector

Co-Authored-By: Claude Fable 5 <[email protected]>
Bech32PaymentIntentParser and EthereumPaymentIntentParser stripped only
uriPrefix.length / currency.length characters from "scheme:address"
inputs, leaving the ":" on the address that goes into the swap memo
(e.g. "=:THOR.RUNE::thor1..."). Skip the colon too, and fix Ethereum's
currency branch which matched startsWith(currency) without the colon.

Bech32 URI payloads are also normalized to canonical lowercase when
they are a valid bech32 match, same as bare scanned addresses.

Adds Bech32PaymentIntentParserTest covering the memo built from bare,
URI-prefixed, and all-uppercase inputs.

Co-Authored-By: Claude Fable 5 <[email protected]>
…O-983)

commitSwapTransaction refreshes the SwapKit route before broadcasting
(routeIds expire after 60s), and on NEAR Intents routes the refreshed
quote creates a new intent with a fresh one-time deposit address — the
address the transaction actually pays. The success params, the stored
SwapOrder and the marked address were still built from the pre-refresh
preview model, so swap tracking and the NEAR Intents explorer link
followed the abandoned first intent, which stays "Pending Deposit"
forever. Persist the model returned by commitSwapTransaction instead,
and log when the deposit address changed across the refresh.

Co-Authored-By: Claude Fable 5 <[email protected]>
The buy flow converts the selected asset into DASH, but
dex_enter_amount_title read "Convert Dash to %s". Now reads
"Convert %s to Dash".

Co-Authored-By: Claude Fable 5 <[email protected]>
A max ("empty wallet") sell sweeps the balance and bitcoinj deducts the
miner fee from the sweep's single output, so the deposit delivers
balance − fee. The SwapKit quote, however, was requested for the full
balance, and NEAR Intents refuses any deposit below the quoted amount
("Deposited amount is less than quoted amount"), auto-refunding it
about an hour later minus a 0.001 DASH refund fee — every max sell on
a NEAR Intents route was doomed. Maya vault routes execute on whatever
arrives and were unaffected.

Quote the post-fee sweep output instead, estimated with
estimateNetworkFee(emptyWallet = true) from the current balance so the
preview quote and the pre-broadcast refresh in commitSwapTransaction
stay idempotent (the refresh passes the already-reduced amount back
in). NEAR accepts deposits above the quoted amount, so a balance that
grows before broadcast stays safe; a balance that shrinks is caught by
a new guard in buildAndSendDepositTx that aborts with a recoverable
error instead of broadcasting a deposit that can only refund.

Co-Authored-By: Claude Fable 5 <[email protected]>
QR codes carry bech32 addresses uppercase (alphanumeric mode); the
address fields now display and store the canonical lowercase form.

- AddressParser.normalizeCase(): lowercases an all-uppercase input only
  when its lowercase form is a valid address, so case-significant forms
  (Base58, EIP-55, mixed case, URIs) pass through unchanged
- Applied at the scan / paste / clipboard-row / source-row entry points
  of MayaAddressInputFragment and DEXRefundAddressFragment; typed input
  is untouched
- Fix AddressInputResult.addressInputWithoutPrefix keeping the leading
  colon when stripping a URI scheme (same off-by-one as the intent
  parsers fixed earlier); it feeds the sell-flow quote request

Co-Authored-By: Claude Fable 5 <[email protected]>
A Dash P2PKH address could be entered as the destination of a sell
swap and only fail later with a generic "Conversion failed": several
target chains validate with permissive lexical patterns that a Dash
address also satisfies. Solana was the worst offender — its parser
accepted any 32-44 char Base58 string, and a Dash address is 34 Base58
chars.

Three layers:
- SolanaAddressParser now requires the Base58 payload to decode to
  exactly 32 bytes (a raw ed25519 key), rejecting Base58Check
  addresses like Dash/Bitcoin (25-byte payload) in both exactMatch
  and findAll.
- SolanaPaymentIntentParser validates the address in its URI-prefixed
  branch too — createPaymentIntent encodes whatever it is given, so
  "solana:<dash address>" previously bypassed validation entirely.
- MayaAddressInputFragment.onContinue explicitly rejects any
  checksum-valid DASH address (on the wallet's network) as a sell
  destination before quoting, covering every target asset's parser at
  once — a Dash address is never a valid sell-swap destination.

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b392cb27-8311-4f1c-9cbf-864f15f746ab

📥 Commits

Reviewing files that changed from the base of the PR and between 61fd72c and 9615aeb.

📒 Files selected for processing (1)
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConvertCryptoFragment.kt
🚧 Files skipped from review as they are similar to previous changes (1)
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConvertCryptoFragment.kt

📝 Walkthrough

Walkthrough

Address parsing now supports controlled Bech32 case normalization and validation. Maya payment and address-input flows strip URI delimiters, canonicalize addresses, reject invalid Dash inputs, validate Solana addresses, and improve swap amount, committed-trade, and fragment lifecycle handling.

Changes

Address and swap consistency

Layer / File(s) Summary
Address parser case contracts
common/src/main/java/.../payments/parsers/*, common/src/test/java/.../AddressParserTest.kt, integrations/maya/src/test/.../AddressParserTest.kt
Address parsers accept valid uppercase Bech32, reject mixed-case inputs, and normalize valid all-uppercase addresses while preserving Base58 casing.
Payment parser normalization and validation
common/src/main/java/..., integrations/maya/src/main/java/.../payments/parsers/*, integrations/maya/src/test/.../payments/parsers/*
Payment parsers remove URI delimiters, validate extracted payloads, normalize Bech32 values, preserve Base58 case rules, and enforce Solana length validation.
Address input normalization and Dash rejection
integrations/maya/src/main/java/.../ui/*
Scanned and pasted addresses are normalized, and Dash addresses are rejected before conversion.
Swap quote and committed trade consistency
integrations/maya/src/main/java/.../SwapKitApiAggregator.kt, .../MayaConversionPreviewViewModel.kt, .../strings-maya.xml
Maximum-balance quotes account for sweep fees, deposits are rechecked before broadcast, and committed trade data is persisted and displayed.
Fragment ViewModel lifecycle cleanup
integrations/maya/src/main/java/.../*Fragment.kt
Destruction cleanup safely handles unavailable navigation-scoped ViewModels.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Wallet
  participant SwapKitApiAggregator
  participant SwapTradeUIModel
  participant MayaConversionPreviewViewModel
  Wallet->>SwapKitApiAggregator: provide balance and fee estimate
  SwapKitApiAggregator->>SwapTradeUIModel: publish effective maximum-sell amount
  MayaConversionPreviewViewModel->>SwapKitApiAggregator: commit trade
  SwapKitApiAggregator->>MayaConversionPreviewViewModel: return committed trade
  MayaConversionPreviewViewModel->>SwapTradeUIModel: persist committed trade fields
Loading

Suggested reviewers: abaranouski

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main theme of the PR: fixing Dash DEX sell-swap issues.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dash-dex-fixes

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
integrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/SwapKitApiAggregator.kt (1)

991-1018: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Make the max-sell balance check atomic with broadcasting.

The sweep is estimated before sendCoins(). A concurrent outgoing transaction can consume UTXOs after Line 992 but before the empty-wallet send, causing a smaller deposit than amount despite this check. Validate the minimum deliverable amount inside the send/input-selection critical section, or reserve the inputs across estimate and broadcast.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/SwapKitApiAggregator.kt`
around lines 991 - 1018, Make the maximum-sell validation in the swap deposit
flow atomic with input selection and broadcasting: move the minimum-deliverable
check from the pre-send sweep estimation into the critical section used by
sendPaymentService.sendCoins, or reserve the selected inputs across both
operations. Ensure concurrent outgoing transactions cannot reduce the
empty-wallet deposit below amount, while preserving the existing failure
response and logging.
🧹 Nitpick comments (1)
integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConversionPreviewViewModel.kt (1)

159-165: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Publish committed-swap results through the single uiState.

This adds another independently updated success channel instead of representing loading, failure, and committed transaction details in one immutable UIState exposed as StateFlow. As per coding guidelines, “ViewModels should use a single UIState data class rather than multiple separate flows” and use a private mutable _uiState with public immutable uiState.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConversionPreviewViewModel.kt`
around lines 159 - 165, Replace the independently updated
commitSwapTradeSuccessState flow in the committed-swap success path with the
ViewModel’s single private mutable _uiState and public immutable uiState
StateFlow. Extend the existing UIState to represent the committed transaction
details while preserving its loading and failure states, and update it
atomically when constructing SendTransactionToWalletParams.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@common/src/main/java/org/dash/wallet/common/payments/parsers/AddressParser.kt`:
- Line 24: Retain the ignoreCase setting in AddressParser and update
normalizeCase to lowercase only when the parser is case-insensitive; preserve
the original value for case-sensitive formats even if its lowercase form passes
exactMatch. Add regression tests in AddressParserTest covering uppercase Bech32
normalization and unchanged uppercase Base58 values.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/Bech32PaymentIntentParser.kt`:
- Around line 46-47: Validate every URI payload with the relevant
addressParser.exactMatch before canonicalizing or creating a payment intent:
update Bech32PaymentIntentParser.kt at lines 46-47 and 60-61, remove
pass-through normalization as validation at lines 102-103, and update
CardanoPaymentIntentParser.kt lines 54-57 and XrdPaymentIntentParser.kt lines
49-50 to validate and lowercase their Shelley and radix payloads respectively.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashPaymentIntentParser.kt`:
- Around line 52-55: Update ZcashPaymentIntentParser’s URI handling to pass the
stripped payload through the same validated address-normalization logic used by
the bare-input branch, preserving transparent t-address casing while lowercasing
shielded/unified addresses. Reuse the existing normalization helper or extract
one shared by both branches, and add coverage for uppercase URI payloads.

---

Outside diff comments:
In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/SwapKitApiAggregator.kt`:
- Around line 991-1018: Make the maximum-sell validation in the swap deposit
flow atomic with input selection and broadcasting: move the minimum-deliverable
check from the pre-send sweep estimation into the critical section used by
sendPaymentService.sendCoins, or reserve the selected inputs across both
operations. Ensure concurrent outgoing transactions cannot reduce the
empty-wallet deposit below amount, while preserving the existing failure
response and logging.

---

Nitpick comments:
In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConversionPreviewViewModel.kt`:
- Around line 159-165: Replace the independently updated
commitSwapTradeSuccessState flow in the committed-swap success path with the
ViewModel’s single private mutable _uiState and public immutable uiState
StateFlow. Extend the existing UIState to represent the committed transaction
details while preserving its loading and failure states, and update it
atomically when constructing SendTransactionToWalletParams.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3ef326bf-aeca-45dc-b474-5aeb4ab9b74e

📥 Commits

Reviewing files that changed from the base of the PR and between b6d29b2 and 95e685b.

📒 Files selected for processing (21)
  • common/src/main/java/org/dash/wallet/common/payments/parsers/AddressParser.kt
  • common/src/main/java/org/dash/wallet/common/payments/parsers/Bech32AddressParser.kt
  • common/src/main/java/org/dash/wallet/common/ui/address_input/AddressInputViewModel.kt
  • common/src/test/java/org/dash/wallet/common/payments/parsers/AddressParserTest.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/Bech32PaymentIntentParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/CardanoAddressParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/CardanoPaymentIntentParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/EthereumPaymentIntentParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/SolanaAddressParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/SolanaPaymentIntentParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/XrdPaymentIntentParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashPaymentIntentParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/SwapKitApiAggregator.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/DEXRefundAddressFragment.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/DEXRefundAddressViewModel.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaAddressInputFragment.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaAddressInputViewModel.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConversionPreviewViewModel.kt
  • integrations/maya/src/main/res/values/strings-maya.xml
  • integrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/AddressParserTest.kt
  • integrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/Bech32PaymentIntentParserTest.kt

… to Home

When a completed sell swap pops the whole nav_maya graph back to the
wallet home, back-stack fragments are destroyed after the graph entry
is already gone. A restored instance whose view was never recreated
then resolves its navGraphViewModels lazy for the first time in
onDestroy and NavController.getBackStackEntry throws
IllegalArgumentException ("No destination with ID ... on the back
stack").

Capture the ViewModel in onCreateView (while the graph is guaranteed
present) and use that instance in onDestroy — the pattern
DEXEnterAmountFragment already uses. Fixes the crash in
MayaCryptoCurrencyPickerFragment and the same latent bug in
MayaConvertCryptoFragment.

Co-Authored-By: Claude Fable 5 <[email protected]>

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConvertCryptoFragment.kt`:
- Line 114: The nav-graph ViewModel references are captured only in
onCreateView, so cleanup can be skipped when a restored fragment is destroyed
before view recreation. Update MayaConvertCryptoFragment and
MayaCryptoCurrencyPickerFragment to capture their ViewModels at an earlier
guaranteed lifecycle point or centralize reset logic, ensuring the convert state
and picker search query are always cleared when removed; apply the corresponding
changes at both cited files and sites.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3a3625ab-d8d7-4884-9fcd-20bdb632a515

📥 Commits

Reviewing files that changed from the base of the PR and between 95e685b and 90dd682.

📒 Files selected for processing (2)
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConvertCryptoFragment.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaCryptoCurrencyPickerFragment.kt

HashEngineering and others added 2 commits July 28, 2026 11:52
…rmat

CodeRabbit review follow-ups on the DEX sell-swap fixes:

- AddressParser.normalizeCase now only rewrites inputs the parser reports
  as case-insensitive (bech32). Case-sensitive Base58 forms validated by
  pattern only (Solana, Zcash t-addresses) could otherwise have an all-caps
  corrupt address "repaired" into a different, plausible-looking one
  instead of being rejected. Composite parsers (Bitcoin, Zcash, Cardano)
  report case-insensitivity per input form.
- URI payloads (thor:/zcash:/cardano:/radix: etc.) now get the same
  exactMatch validation and lowercase canonicalization as bare addresses
  before reaching the swap memo; a valid scheme prefix no longer bypasses
  address validation, and an all-caps bech32 payload after the prefix is
  lowercased to canonical form.

Co-Authored-By: Claude Fable 5 <[email protected]>
The graph-scoped ViewModel was cached in onCreateView, so a restored
back-stack fragment destroyed before its view was recreated skipped the
onDestroy cleanup (stale search query / entered amount on the next
visit). Resolve the navGraphViewModels lazy directly in onDestroy under
runCatching instead: it throws only when the whole flow was already
popped to Home, where the graph scope - and the state to clear - is
gone anyway.

Co-Authored-By: Claude Fable 5 <[email protected]>

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConvertCryptoFragment.kt`:
- Around line 718-721: Update the cleanup in
MayaConvertCryptoFragment.onDestroy() to call convertViewModel.clear() only when
isRemoving is true. Preserve the existing runCatching protection for cases where
the navigation graph scope has already been removed, and leave
configuration-teardown state intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: aacb3528-3c2f-443c-831c-9db2359a9ac6

📥 Commits

Reviewing files that changed from the base of the PR and between 90dd682 and 61fd72c.

📒 Files selected for processing (17)
  • common/src/main/java/org/dash/wallet/common/payments/parsers/AddressParser.kt
  • common/src/main/java/org/dash/wallet/common/payments/parsers/BitcoinAddressParser.kt
  • common/src/test/java/org/dash/wallet/common/payments/parsers/AddressParserTest.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/Bech32PaymentIntentParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/CardanoAddressParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/CardanoPaymentIntentParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/XrdPaymentIntentParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashAddressParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashPaymentIntentParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/DEXEnterAmountFragment.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConvertCryptoFragment.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaCryptoCurrencyPickerFragment.kt
  • integrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/AddressParserTest.kt
  • integrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/Bech32PaymentIntentParserTest.kt
  • integrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/CardanoPaymentIntentParserTest.kt
  • integrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/XrdPaymentIntentParserTest.kt
  • integrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashPaymentIntentParserTest.kt
🚧 Files skipped from review as they are similar to previous changes (6)
  • integrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/Bech32PaymentIntentParserTest.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashPaymentIntentParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/CardanoAddressParser.kt
  • common/src/main/java/org/dash/wallet/common/payments/parsers/AddressParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/XrdPaymentIntentParser.kt
  • common/src/test/java/org/dash/wallet/common/payments/parsers/AddressParserTest.kt

@HashEngineering HashEngineering added this to the 11.9.1 milestone Jul 28, 2026
@HashEngineering

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

MayaConvertCryptoFragment.onDestroy() called convertViewModel.clear()
unconditionally, which also runs on a configuration change (isRemoving
false) and erased the entered amounts plus the saved-state amount the
recreated fragment was about to restore. Gate the cleanup on isRemoving,
matching MayaCryptoCurrencyPickerFragment and DEXEnterAmountFragment,
and keep the runCatching protection for the popped-to-Home case.

Co-Authored-By: Claude Fable 5 <[email protected]>

@abaranouski abaranouski 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.

Approved

@HashEngineering
HashEngineering merged commit d4c0495 into master Jul 29, 2026
2 of 3 checks passed
HashEngineering added a commit that referenced this pull request Aug 5, 2026
Brings in dark mode support (#1480) and the Dash DEX sell-swap fixes (#1519).

Conflicts (both in Tools, where DashConnect added its menu entry):
- ToolsFragment: keep our onConnectionsClick wiring inside master's new
  DashWalletTheme wrapper.
- ToolsScreen: keep the Connections MenuItem in the first Menu block, which
  master now closes before the username-gated Credits Menu.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
AshFrancis pushed a commit to AshFrancis/dash-wallet that referenced this pull request Nov 28, 2026
…dk-master

Brings in the Dash DEX master line (dashpay#1504, dashpay#1511, dashpay#1519 sell-swap fixes,
about-me redesign) and re-expresses its dashj/bitcoinj-based additions on
the branch's neutral (dashj-free) APIs:

- SwapOrder/SwapOrderDao keyed by TxId instead of Sha256Hash
- example-address generation (AddressGenerator, MayaCryptoCurrency) on a
  random SessionExampleKey + vendored Base58/SHA-256, no ECKey
- foreign-chain parsers on vendored Base58/AddressFormatException
- MayaBlockchainApi stays interface-only; master's CancellationException
  rethrow ported to the wallet-side impl
- SwapKit aggregator: master's max-sell sweep quote + pre-broadcast
  re-check adapted to the neutral SendPaymentService/WalletDataProvider
- ContactsFragment keeps the per-view ContactsIdentityGate; master's
  onDestroyView flag-reset workaround dropped as redundant

Co-Authored-By: Claude Fable 5 <[email protected]>
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.

2 participants