Skip to content

build: v11.9.1 - #1567

Merged
HashEngineering merged 39 commits into
masterfrom
build/11.9.1
Sep 28, 2026
Merged

HashEngineering merged 39 commits into
masterfrom
build/11.9.1

Conversation

@HashEngineering

Copy link
Copy Markdown
Collaborator

Regression ticket: MO-1055.

Stacked on #1560 (fix/dashspend-payment-resilience). Only the commits on top of that branch are shown here; merge #1560 first, then retarget this PR to master.

Included

  • Prevent registering a locked username (f62572f)
  • Enable Dash Connect for mainnet (6ef70d6)
  • Translation updates pulled from Transifex (c21e99d)
  • Fill missing translations for DE, PL, IT, FR, RU, ES, PT (532b874): 170 keys per locale covering the transaction status and conversion rows, DashPay contact requests and DashConnect, common balance/payment-pending/camera strings, gift card save failure, and the Dash DEX strings. Coin and network names are copied verbatim.

Still to do on this branch

  • Bump version name and code, update CHANGELOG
  • Testnet and mainnet release builds
  • QA regression per MO-1055

🤖 Generated with Claude Code

HashEngineering and others added 17 commits August 26, 2026 09:39
The purchase screen decided Fixed vs Flexible from the provider row's
cached denominationsType (explore dataset), while the denominations list
came from the provider's live API. When the two disagreed — e.g. a
PiggyCards merchant selling a min-max range card while the cache said
"fixed" — the range endpoints (e.g. $3 and $2,000) were rendered as two
fixed denominations with quantity steppers.

updateMerchantDetails now stamps the API response's denominationsType
onto the matching provider row, matched by provider name instead of
always index 0 (which could also stamp savings/active onto the wrong
provider). loadMerchant keeps reading the provider row, which now
carries the live type, and tolerates an unparseable cached type on the
network-failure fallback path instead of crashing.

Co-Authored-By: Claude Fable 5 <[email protected]>
The all-locations screen (shown when selecting a multi-location physical
merchant like Chipotle with location services unavailable) loads its data
from a flow gated on searchBounds, whose only writer is the Google Map's
camera-idle callback. On devices without Google Play Services the map
never initializes, searchBounds stays null, the query never runs, and the
user is left on a blank screen with no way to reach a location's details
or the purchase flow.

Seed the flow with GeoBounds.noBounds when no map bounds exist. This is
already the bounds value used for the query outside Nearby mode, so
behavior on devices with a working map is unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
Review feedback on #1556: when the noBounds seed reaches the Nearby
branch (location enabled, map bounds not yet produced), getRadiusBounds
would compute a radius around latitude/longitude (0, 0) and query the
wrong area. Center on the user's last known location instead, falling
back to an unbounded query when there is none.

Adds regression tests for both the original blank-screen case (no map
bounds, location disabled) and the Nearby fallback.

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

The Online tab's grouped query counts a chain's online and "both" rows,
so physicalAmount can exceed 1. With location services disabled (or a
territory selected) canShowNearestLocation() was false and the tap fell
through to the all-locations screen. Before the noBounds seeding in this
PR that screen's query never ran, so the fall-through was masked by a
blank list; now it showed every location of the chain.

There is no nearest physical location to resolve for an online listing
and the details screen never offers the all-locations list for one, so
open details directly in the Online tab. Physical tabs keep the existing
routing.

Adds a regression test for the Online tab and a counterpart for the All
tab.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
A gift card purchase could sit at "pending" for hours: CTX received the
BIP70 payment and broadcast the transaction, but the reply never reached
the phone, so the wallet neither committed the transaction nor knew it
had been sent. The blockchain service was also gone for the whole
payment window, leaving no peers to learn otherwise.

Payment submission:

- Run the submission in a NonCancellable context so a lock screen or
  activity recreation can no longer abandon it mid-flight.
- On an ambiguous HTTP failure, hand the signed transaction to the new
  PendingDirectPaymentVerifier instead of guessing. It locks the inputs
  so a retry cannot double-spend them, persists the transaction, and
  watches the network: seen means commit, unlock and rebroadcast; never
  seen while connected and synced means the merchant did not get it, so
  release the inputs. Pending payments survive process death and are
  resumed when the service starts.
- Post the payment with retryOnConnectionFailure disabled. OkHttp was
  re-sending the payment on a fresh connection and reporting only the
  last failure, which is how a DNS error masked an attempt that had
  already reached the merchant.
- Add PaymentSubmissionPendingException so callers can tell "unknown"
  from "failed". The gift card dialog and the BIP70 screen show a
  status-unknown message and withhold retry.

Gift cards:

- Record the order on the pending path too, keyed by the transaction id
  the exception carries; the purchase screen otherwise closes holding
  the only copy of the order details. saveGiftCardDummy now suspends
  until the rows are written.
- Remove those rows again through the new
  TransactionMetadataProvider.removeGiftCards if the payment is later
  proven never to have been sent.

Blockchain service lifecycle:

- onTrimMemory only stops at TRIM_MEMORY_COMPLETE, and reschedules.
  TRIM_MEMORY_BACKGROUND just means the process reached the LRU list,
  so the service was killing itself shortly after every backgrounding.
- The cleanup deadlock guard waits longer and reschedules a restart
  rather than leaving the wallet with no service and no peers.
- Keep PAUSED mixing in the foreground and log demotions, so a paused
  wallet stops flapping between foreground and background.

Verified on testnet against CTX staging: a real purchase timed out
reading the response headers, was quarantined with its input locked,
and was committed 15s after connectivity returned.

MO-987

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Explore records can arrive with no street, city or territory. getDisplayAddress
appended the CTX/PiggyCards city and territory unconditionally, so such a record
rendered as ", , " — every row of the merchant locations list for an affected
chain. A null street rendered the word "null". The details screen was affected
too: it gates its address block on getDisplayAddress().isNotEmpty(), which was
true for a record with no address at all.

Join only the parts that are present, so a partial record yields a shorter
address and an empty record yields an empty string.

Note this is a display guard, not a data fix: the testnet explore dataset
downloaded on 2026-09-09 has empty address, city and territory on roughly
two thirds of its physical merchant rows.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
A merchant whose locations carry coordinates but no street, city or territory
gave a "Select location" picker of blank rows, with nothing to choose between.
Resolve the destination from the loaded locations instead of assuming the
picker: if none of them renders an address, open the merchant details screen,
where the gift card purchase flow is reachable.

The screen state is now posted on the first emission rather than up front, so
the picker no longer appears before its contents are known. A merchant with at
least one readable location still gets the picker, unchanged.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Releasing an abandoned payment removed its gift cards but left the
transaction_metadata row behind, tagged with the service and keyed by a
transaction id that will never exist. Worse, the queued change was still
in the platform cache, so metadata about a transaction nobody broadcast
could be published to Dash Platform.

Replace removeGiftCards with forgetTransaction, which drops the gift
cards, the queued platform changes and the metadata row together. Queued
changes go first so a concurrent publish cannot put the metadata back.
It refuses to run when the wallet holds the transaction, so it can never
discard real user data.

Also mark the transaction as a gift card purchase on the pending path.
markGiftCardTransaction only ran on the success path, so a purchase that
recovered from an unknown submission result kept its service tag but
lost its expense tax category and merchant icon.

MO-987

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Six issues raised in review, all confirmed against the code.

Input locks leaked when persistence failed. quarantine locked the inputs
and then persisted the record, so a DataStore failure left the locks set
with no record for resume to find. The outputs stayed unspendable until
the process restarted. Release them and rethrow.

forgetTransaction failed open. The guard read the wallet through a safe
call, so a null wallet made the condition false and everything was
deleted. It now requires a wallet that positively reports the
transaction absent; without one it does nothing, because "never
broadcast" and "cannot check right now" are not the same thing.

The cleanup was not atomic. Three deletes ran through three DAOs while
release discarded the retry state afterwards, so a failure part way
through stranded rows with nothing left to retry them. They now run in
one Room transaction on a new TransactionRecordsDao. This adds no
schema, so no migration.

The saved order was cleared before it was persisted, on both the pending
and the success path, so a failed write lost the order details as well.
Persist first, clear afterwards.

A database failure on the success path could abort the coroutine before
the details screen opened, leaving no feedback after a successful
payment. This was introduced by making saveGiftCardDummy suspend, which
stopped viewModelScope swallowing it. Handle it and still show the
screen.

The DNS-failure test used payment.invalid.dash-wallet-test, whose
top-level label is not reserved. A wildcard resolver could answer it,
turning the failure into a connect or TLS error that is classified
ambiguous, and the test would fail. RFC 2606 reserves .invalid, so the
labels were the wrong way round.

MO-987

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Two findings from review, both introduced by the previous round of fixes.

release() discarded the pending payment whether or not the cleanup
worked. It caught any failure from forgetTransaction and called finish()
regardless, and the fail-closed guard added last time returns without
doing anything when no wallet is available to confirm the transaction is
absent. Between them, the retry state could be deleted while the gift
cards, metadata and queued platform changes were all still there, which
is exactly the orphan this branch exists to remove.

forgetTransaction now reports whether it settled: true when the records
were discarded or the transaction turned out to be real, false when it
could not be attempted. release() only finishes on true. Otherwise the
payment stays on disk and the next resume() retries the cleanup.

A released payment is marked abandoned before the cleanup runs, so a
failure or a crash cannot cause resume() to lock its inputs or verify it
a second time. Such a payment is only ever cleaned up.

The success path opened the gift card details screen even when saving
the cards had failed. That screen reads the cards from the database and
takes the order id from them, so it would have shown an empty card that
could never be fetched. Explain what happened instead. The entered
amount is still cleared, because the payment did succeed and returning
the user to a pre-filled purchase screen would invite a second payment.

MO-987

Co-Authored-By: Claude Opus 5 <[email protected]>
Fill the 170 keys that were missing from each of the seven main locales:
transaction status/conversion rows, DashPay contact request and
DashConnect strings, common balance/payment-pending/camera strings,
gift card save-failure strings, and the Dash DEX (Maya) strings.
Coin/network names in strings-maya.xml are copied verbatim.

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

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 141 files, which is 41 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

Check out review usage here.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e8514240-cee2-479b-a66e-76785846e8f1

📥 Commits

Reviewing files that changed from the base of the PR and between 3b5079b and 12ab218.

📒 Files selected for processing (141)
  • build.gradle
  • common/src/main/java/org/dash/wallet/common/ui/components/ActionItem.kt
  • common/src/main/java/org/dash/wallet/common/util/GenericUtils.kt
  • common/src/main/res/values-ar/strings.xml
  • common/src/main/res/values-cs/strings.xml
  • common/src/main/res/values-de/strings.xml
  • common/src/main/res/values-el/strings.xml
  • common/src/main/res/values-es/strings.xml
  • common/src/main/res/values-fa/strings.xml
  • common/src/main/res/values-fil/strings.xml
  • common/src/main/res/values-fr/strings.xml
  • common/src/main/res/values-id/strings.xml
  • common/src/main/res/values-it/strings.xml
  • common/src/main/res/values-ja/strings.xml
  • common/src/main/res/values-ko/strings.xml
  • common/src/main/res/values-nl/strings.xml
  • common/src/main/res/values-pl/strings.xml
  • common/src/main/res/values-pt/strings.xml
  • common/src/main/res/values-ru/strings.xml
  • common/src/main/res/values-sk/strings.xml
  • common/src/main/res/values-th/strings.xml
  • common/src/main/res/values-tr/strings.xml
  • common/src/main/res/values-uk/strings.xml
  • common/src/main/res/values-zh-rTW/strings.xml
  • common/src/main/res/values-zh/strings.xml
  • features/exploredash/src/main/res/values-ar/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-de/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-el/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-es/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-fil/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-fr/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-id/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-it/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-ja/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-ko/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-nl/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-pl/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-pt/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-ru/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-sk/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-th/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-zh-rTW/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-zh/strings-explore-dash.xml
  • features/exploredash/src/main/res/values/strings-explore-dash.xml
  • gradle.properties
  • integrations/maya/src/main/res/values-de/strings-maya.xml
  • integrations/maya/src/main/res/values-el/strings-maya.xml
  • integrations/maya/src/main/res/values-es/strings-maya.xml
  • integrations/maya/src/main/res/values-fil/strings-maya.xml
  • integrations/maya/src/main/res/values-fr/strings-maya.xml
  • integrations/maya/src/main/res/values-id/strings-maya.xml
  • integrations/maya/src/main/res/values-it/strings-maya.xml
  • integrations/maya/src/main/res/values-ja/strings-maya.xml
  • integrations/maya/src/main/res/values-ko/strings-maya.xml
  • integrations/maya/src/main/res/values-nl/strings-maya.xml
  • integrations/maya/src/main/res/values-pl/strings-maya.xml
  • integrations/maya/src/main/res/values-pt/strings-maya.xml
  • integrations/maya/src/main/res/values-ru/strings-maya.xml
  • integrations/maya/src/main/res/values-sk/strings-maya.xml
  • integrations/maya/src/main/res/values-zh-rTW/strings-maya.xml
  • integrations/maya/src/main/res/values-zh/strings-maya.xml
  • wallet/CHANGES
  • wallet/build.gradle
  • wallet/res/layout/activity_lock_screen.xml
  • wallet/res/values-de/strings-dashpay.xml
  • wallet/res/values-de/strings-extra.xml
  • wallet/res/values-de/strings.xml
  • wallet/res/values-el/strings-dashpay.xml
  • wallet/res/values-el/strings-extra.xml
  • wallet/res/values-el/strings.xml
  • wallet/res/values-es/strings-dashpay.xml
  • wallet/res/values-es/strings-extra.xml
  • wallet/res/values-es/strings.xml
  • wallet/res/values-fa/strings-dashpay.xml
  • wallet/res/values-fil/strings-dashpay.xml
  • wallet/res/values-fil/strings-extra.xml
  • wallet/res/values-fil/strings.xml
  • wallet/res/values-fr/strings-dashpay.xml
  • wallet/res/values-fr/strings-extra.xml
  • wallet/res/values-fr/strings.xml
  • wallet/res/values-hdpi/dimens.xml
  • wallet/res/values-id/strings-dashpay.xml
  • wallet/res/values-id/strings-extra.xml
  • wallet/res/values-id/strings.xml
  • wallet/res/values-it/strings-dashpay.xml
  • wallet/res/values-it/strings-extra.xml
  • wallet/res/values-it/strings.xml
  • wallet/res/values-ja/strings-dashpay.xml
  • wallet/res/values-ja/strings-extra.xml
  • wallet/res/values-ja/strings.xml
  • wallet/res/values-ko/strings-dashpay.xml
  • wallet/res/values-ko/strings-extra.xml
  • wallet/res/values-ko/strings.xml
  • wallet/res/values-nl/strings-dashpay.xml
  • wallet/res/values-nl/strings-extra.xml
  • wallet/res/values-nl/strings.xml
  • wallet/res/values-pl/strings-dashpay.xml
  • wallet/res/values-pl/strings-extra.xml
  • wallet/res/values-pl/strings.xml
  • wallet/res/values-pt/strings-dashpay.xml
  • wallet/res/values-pt/strings-extra.xml
  • wallet/res/values-pt/strings.xml
  • wallet/res/values-ru/strings-dashpay.xml
  • wallet/res/values-ru/strings-extra.xml
  • wallet/res/values-ru/strings.xml
  • wallet/res/values-sk/strings-dashpay.xml
  • wallet/res/values-sk/strings-extra.xml
  • wallet/res/values-sk/strings.xml
  • wallet/res/values-sl/strings.xml
  • wallet/res/values-tr/strings-dashpay.xml
  • wallet/res/values-uk/strings-dashpay.xml
  • wallet/res/values-xhdpi/dimens.xml
  • wallet/res/values-zh-rTW/strings-dashpay.xml
  • wallet/res/values-zh-rTW/strings-extra.xml
  • wallet/res/values-zh-rTW/strings.xml
  • wallet/res/values-zh/strings-dashpay.xml
  • wallet/res/values-zh/strings-extra.xml
  • wallet/res/values-zh/strings.xml
  • wallet/src/de/schildbach/wallet/Constants.java
  • wallet/src/de/schildbach/wallet/WalletApplication.java
  • wallet/src/de/schildbach/wallet/ui/AbstractBindServiceActivity.kt
  • wallet/src/de/schildbach/wallet/ui/AddressBookActivity.java
  • wallet/src/de/schildbach/wallet/ui/BaseMenuActivity.kt
  • wallet/src/de/schildbach/wallet/ui/BlockInfoActivity.kt
  • wallet/src/de/schildbach/wallet/ui/CreateUsernameActivity.kt
  • wallet/src/de/schildbach/wallet/ui/DashPayUserActivity.kt
  • wallet/src/de/schildbach/wallet/ui/EditProfileActivity.kt
  • wallet/src/de/schildbach/wallet/ui/LockScreenActivity.kt
  • wallet/src/de/schildbach/wallet/ui/NetworkMonitorActivity.java
  • wallet/src/de/schildbach/wallet/ui/coinjoin/CoinJoinActivity.kt
  • wallet/src/de/schildbach/wallet/ui/dashpay/CropImageActivity.kt
  • wallet/src/de/schildbach/wallet/ui/dashpay/PlatformRepo.kt
  • wallet/src/de/schildbach/wallet/ui/main/MainActivity.kt
  • wallet/src/de/schildbach/wallet/ui/more/AdvancedSecurityActivity.kt
  • wallet/src/de/schildbach/wallet/ui/payments/SweepWalletActivity.kt
  • wallet/src/de/schildbach/wallet/ui/send/SendCoinsActivity.kt
  • wallet/src/de/schildbach/wallet/ui/staking/StakingActivity.kt
  • wallet/src/de/schildbach/wallet/ui/transactions/TransactionResultActivity.kt
  • wallet/src/de/schildbach/wallet/ui/username/request/RequestUserNameViewModel.kt
  • wallet/src/de/schildbach/wallet/ui/username/request/RequestUsernameFragment.kt
  • wallet/test/de/schildbach/wallet/ui/username/request/RequestUserNameViewModelTest.kt

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

@thepastaclaw

thepastaclaw commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

✅ Final review complete — no blockers (commit 12ab218) · triage: normal

@HashEngineering HashEngineering self-assigned this Sep 21, 2026
@HashEngineering
HashEngineering marked this pull request as ready for review September 21, 2026 06:07

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

⚠️ DEGRADED — Final validation — Phase 1 + Phase 2

⚠️ DEGRADED review. The primary review models were unavailable (gpt-6-astra unavailable: All credentials for model gpt-6-astra are cooling down (last error: usage_limit_reached: The usage limit has been reache), so this review ran on stand-in models: gpt-5.6-luna → muse-spark-1.3-contributor, gpt-5.6-sol → muse-spark-1.3-contributor, gpt-5.6-terra → muse-spark-1.3-contributor, gpt-6-astra → muse-spark-1.3-contributor. Both review phases and the independent verifiers still ran, but on weaker models, with Phase 1 capped at high effort. Treat the verdict as provisional; a full-strength re-review will run on the next push once the primary models are back.

Verified the v11.9.1 range end-to-end: locked-username gating fails closed, Dash Connect remains disabled on prod, and icon-host, lock-screen, and translation changes match intent. No in-scope correctness, security, or funds defects found.

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: security-auditor); reviewer 3: muse-spark-1.3-contributor (standing in for gpt-6-astra) (agent: phase2-reviewer, role: general); reviewer 4: muse-spark-1.3-contributor (standing in for gpt-6-astra) (agent: phase2-reviewer, role: security-auditor); final verifier: muse-spark-1.3-contributor (standing in for gpt-6-astra) (agent: astra-verifier, role: final-verifier)

  • Degraded mode: gpt-6-astra unavailable: All credentials for model gpt-6-astra are cooling down (last error: usage_limit_reached: The usage limit has been reache (detected by probe, since 2026-09-20T20:45:34Z); stand-ins gpt-5.6-luna → muse-spark-1.3-contributor, gpt-5.6-sol → muse-spark-1.3-contributor, gpt-5.6-terra → muse-spark-1.3-contributor, gpt-6-astra → muse-spark-1.3-contributor; Phase 1 effort capped at high
  • Triage: normal by muse-spark-1.3-contributor (standing in for gpt-6-astra) (effort low) — Large mostly-translation release with ordinary UI and username/explore logic fixes that do not change consensus, funds movement, crypto, or migrations.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort high); agent phase1-reviewer, muse-spark-1.3-contributor — security-auditor (completed, effort high); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (lane failed), glm-5.3-flash (zai below 15% reserve: 5h 100% left, weekly 13% left)
  • Fresh verifier: muse-spark-1.3-contributor (standing in for gpt-6-astra) — final-verifier; agent astra-verifier
  • Phase 2 reviewers: muse-spark-1.3-contributor (standing in for gpt-6-astra) — general (completed, effort high); agent phase2-reviewer, muse-spark-1.3-contributor (standing in for gpt-6-astra) — security-auditor (completed, effort high); agent phase2-reviewer

HashEngineering and others added 3 commits September 22, 2026 11:47
… wallet

blockchainServiceIntent is only assigned by initEnvironment(), which does not
run when the process starts without a wallet file. SweepWalletActivity called
startBlockchainService() right after super.onCreate(), so startService(null)
threw a NullPointerException in ContextImpl.validateServiceIntent.

LockScreenActivity.onCreate already finishes the activity when there is no
wallet, but its `return` only exits the superclass, so the subclass kept going.

- SweepWalletActivity: return from onCreate when the base class already finished
- startBlockchainService(): skip the start when there is no wallet, since
  BlockchainServiceImpl gives up on a null wallet anyway
- build the service intent lazily so null can never reach startService/stopService

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…sh()

LockScreenActivity.onCreate calls finish() when there is no wallet, but its
return only exits the superclass, so subclasses continue their own onCreate on
an activity that is already finishing. Same shape as the SweepWalletActivity
crash; these two dereference the wallet afterwards:

- MainActivity: upgradeWalletKeyChains()/upgradeWalletCoinJoin() do walletData.wallet!!
- TransactionResultActivity: TransactionResultViewBinder(walletData.wallet!!, ...)

Also harden TransactionResultActivity against an intent without extras (the
EXTRA_TX_ID cast and the !! on intent.extras both threw), which is what happens
when the activity is launched directly rather than from the app.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…thod

LockScreenActivity.onCreate finishes the activity when there is no wallet, but
its return only exits the superclass - every subclass kept running its own
onCreate on a finishing activity, which is how the SweepWalletActivity NPE and
the wallet!! dereferences in MainActivity/TransactionResultActivity happened.

LockScreenActivity now calls the new open onCreateWithWallet() at the point
where it used to hand control back to the subclass, and only when a wallet
exists. All 13 subclasses override that instead of onCreate, so the guard can
no longer be forgotten and the isFinishing checks added earlier are gone.

onCreate cannot be made final: Hilt rejects it ("Do not mark onCreate as final
in base Activity class, as Hilt needs to override it to inject SavedStateHandle"),
so the contract is documented on both methods instead.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
HashEngineering and others added 4 commits September 22, 2026 12:22
Found on device: launching MainActivity with no wallet now finishes cleanly in
onCreate, but onDestroy still ran unregisterReceiver(timeChangeReceiver) for a
receiver that was never registered:

  W LockScreenActivity: no wallet, finishing MainActivity
  E AndroidRuntime: FATAL EXCEPTION: Unable to destroy activity MainActivity:
      java.lang.IllegalArgumentException: Receiver not registered: timeChangeReceiver

Track the registration and skip the unregister when it never happened. Guard
TransactionResultActivity's lateinit transactionResultViewBinder in onDestroy
for the same reason.

Verified on a Samsung SM-S901U: walletless launches of MainActivity and
SendCoinsActivity log the guard and finish with no fatal exception.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Found on device while reproducing the stranded-task case:

  kotlin.UninitializedPropertyAccessException: lateinit property binding has not been initialized
    at LockScreenActivity.setLockState(LockScreenActivity.kt:412)
    at LockScreenActivity.onStart(LockScreenActivity.kt:226)

Calling finish() from onCreate does not reliably skip onStart/onResume, so the
lock screen's onStart ran against the binding it never inflated. This predates
the onCreateWithWallet() refactor - the original code also returned before
`binding = ...` - and it is live in 11.9.1.

- LockScreenActivity.onStart: return when already finishing
- lockScreenDisplayed: false when the binding was never initialized
- MainActivity.onStart/onResume: return when finishing (onResume calls
  checkWalletEncryptionDialog(), which does walletApplication.wallet!!)
- AbstractBindServiceActivity.onResume: don't bind BlockchainServiceImpl with no wallet

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The isFinishing guards added in e045acb did not fire: the device still crashed
with UninitializedPropertyAccessException in LockScreenActivity.onStart after
onCreate had called finish().

Activity.finish() only sets mFinished when the activity manager can finish the
activity right away. An activity finished mid-launch - which is exactly what
happens when the system restores a task - keeps reporting isFinishing == false
while its onStart()/onResume() run.

Track the bail-out explicitly instead: LockScreenActivity sets
finishedWithoutWallet before finish(), and onStart, MainActivity.onStart/onResume
and AbstractBindServiceActivity.onResume check that flag.

Verified on a Samsung SM-S901U with the full stranded-task repro (share a QR
image -> sweep in its own task -> Reset Wallet -> am kill -> restore the task):
guard fires, onStart and onResume run and return, no fatal exception.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

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

Re-review — Final validation — Phase 2 only (queue backlog)

Both supplied findings are supported by the source at head 202c6a5. The wallet-only lifecycle migration leaves two Java activities outside its protection, and the new username availability and recovery branches lack focused regression tests. Verification was static; no builds or runtime tests were performed.

🔴 1 blocking | 🟡 1 suggestion(s)

Review provenance

Source: reviewer 1: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)

  • Triage: normal by gpt-6-astra (effort low) — This is a broad, cross-module change spanning translations, wallet activity lifecycle handling, username validation, mainnet feature enablement, and tests, but the supplied changes do not clearly establish a large or intricate modification to a qualifying critical surface.
  • Phase 1 reviewers: not run (skipped for throughput: 14 PRs queued, above the 10 limit)
  • Fresh verifier: gpt-6-astra — final-verifier; agent astra-verifier
  • Phase 2 reviewers: gpt-6-astra — general (completed, effort high); agent phase2-reviewer, gpt-6-astra — security-auditor (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `wallet/src/de/schildbach/wallet/ui/LockScreenActivity.kt`:
- [BLOCKING] wallet/src/de/schildbach/wallet/ui/LockScreenActivity.kt:170-179: Complete the wallet-only hook migration for the Java activities
  AddressBookActivity.java and NetworkMonitorActivity.java both extend AbstractBindServiceActivity but still override onCreate() and initialize their UI after super.onCreate() returns. If either manifest-registered activity is restored without a wallet, LockScreenActivity returns before initializing its binding, but the Java initialization continues: when isFinishing is true, setContentView() skips inflation and toolbar.setTitle() dereferences null; otherwise, setContentView() accesses the uninitialized binding. The new onStart/onResume guards cannot prevent this earlier crash. Although the underlying failure predates this change, these omitted subclasses leave the PR's explicit wallet-only lifecycle migration incomplete. Move both Java initialization bodies into onCreateWithWallet(), matching the migrated Kotlin subclasses.

In `wallet/src/de/schildbach/wallet/ui/username/request/RequestUserNameViewModel.kt`:
- [SUGGESTION] wallet/src/de/schildbach/wallet/ui/username/request/RequestUserNameViewModel.kt:383-410: Add regression coverage for the new username availability states
  This PR introduces distinct availability outcomes for completed locked ballots, winning ballots, no-winner ballots, and failed username lookups, but its added tests cover only Explore behavior. The existing voting-operation tests do not exercise these ViewModel states, which control whether registration is allowed. Add focused tests asserting usernameBlocked, usernameExists, and usernameCheckSuccess for each outcome, especially a locked ballot with an empty contender map and a winning ballot whose domain lookup has not caught up. Also cover the newly changed recovery branches: absent or malformed USERNAME_REQUESTED values and reuse of an already registered identity after a username-step failure.

@HashEngineering HashEngineering added this to the 11.9.1 milestone Sep 24, 2026
HashEngineering and others added 3 commits September 27, 2026 18:01
Brings in the squashed #1560 (dashspend payment recovery) and #1556
(flexible gift cards / blank locations screen). This branch carried an
earlier cut of the dashspend branch (up to c5bc4d1) plus the unsquashed
#1556 commits, so every conflict resolves to master's version, which
supersedes both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
AddressBookActivity and NetworkMonitorActivity still overrode onCreate()
and kept initializing after LockScreenActivity gave up for having no
wallet. Restored without a wallet, they crashed in onCreate: either
toolbar.setTitle() on a null toolbar (setContentView skipped inflation)
or setContentView() touching the uninitialized lock screen binding
(isFinishing still false mid-launch). Their bodies now run from
onCreateWithWallet(), like the Kotlin subclasses.

setContentView() also guarded on isFinishing, which can be false after
finish() during onCreate; guard on finishedWithoutWallet instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
checkUsername() decides whether registration is allowed, and none of its
outcomes had tests. Cover a failed lookup, a free name, an existing
name, a vote in progress (contested, or blocked by lock votes), a
finished vote that locked the name with an empty contender map, a won
vote whose domain document has not shown up yet, and a vote that ended
with no winner.

Also cover the recovery branches: USERNAME_REQUESTED absent or malformed
no longer crashes isUsernameLocked()/isUsernameLostAfterVoting(), and
submit() reuses a registered identity after the username step failed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@HashEngineering
HashEngineering changed the base branch from fix/dashspend-payment-resilience to master September 28, 2026 02:19
- versionCode 11090109, versionName 11.9.1
- CHANGES: v11.9.1 release notes
- gradle.properties: enable parallel Gradle sync (org.gradle.tooling.parallel)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

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

Re-review — Final validation — Phase 1 + Phase 2

Both prior findings are fixed at the reviewed head, but the locked-username protection still permits registration to proceed when the ballot lookup fails, and an added Filipino translation displays an unrelated swap error. Static validation passed: git diff --check, parsing all 112 changed XML files, and placeholder checks on changed resources; builds and unit tests were not rerun. The tracked worktree remains unchanged.

🔴 1 blocking | 🟡 1 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: security-auditor); reviewer 3: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 4: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); reviewer 5: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 6: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)

  • Triage: normal by gpt-6-astra (effort low) — The diff is a broad release and localization change spanning build configuration, lock-screen lifecycle, username registration logic, mainnet connectivity, UI resources, and substantial tests, but it does not itself alter consensus, funds movement, cryptography, key handling, peer deserialization, or storage migrations.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — security-auditor (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity below 15% reserve: weekly 13% left, 5h 100% left), glm-5.3-flash (not used above high effort; tier asks max)
  • Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
  • Fresh verifier: gpt-6-astra — final-verifier; agent astra-verifier
  • Phase 2 reviewers: gpt-6-astra — general (completed, effort high); agent phase2-reviewer, gpt-6-astra — security-auditor (completed, effort high); agent phase2-reviewer, gpt-6-astra — general (completed, effort high); agent phase2-reviewer, gpt-6-astra — security-auditor (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `wallet/src/de/schildbach/wallet/ui/username/request/RequestUserNameViewModel.kt`:
- [BLOCKING] wallet/src/de/schildbach/wallet/ui/username/request/RequestUserNameViewModel.kt:383-387: Keep username availability unverified when the ballot lookup fails
  PlatformRepo.getVoteContenders() catches every Exception and returns Contenders(Optional.empty(), mapOf(), 0, 0). If the domain lookup successfully returns no document for a locked name but the subsequent ballot lookup times out, this branch treats the failure as an absent vote and ultimately publishes usernameCheckSuccess=true, usernameExists=false, and usernameBlocked=false. RequestUsernameFragment then enables continuation, allowing the user to enter a registration flow that can fund an identity before the unavailable username is rejected. Although the repository fallback predates this PR, the new completed-ballot protection relies on distinguishing this failure from a genuinely available name. Surface ballot lookup failures separately, leave availability unverified with submission disabled, and add a regression test for a successful empty domain lookup followed by a failed ballot lookup.

In `features/exploredash/src/main/res/values-fil/strings-explore-dash.xml`:
- [SUGGESTION] features/exploredash/src/main/res/values-fil/strings-explore-dash.xml:206: Replace the swap error with a gift-card challenge label
  This added translation says “This swap backend does not support the buy flow” instead of “Challenge.” GiftCardDetailsDialog uses this resource as the label beside a gift card's redemption challenge and copy control, so Filipino users see an unrelated failure message on an otherwise valid purchased card. Replace it with the challenge label.

HashEngineering and others added 2 commits September 27, 2026 20:37
PlatformRepo.getVoteContenders() turns any failure into an empty
Contenders, which looks exactly like a name with no vote. When the
domain lookup found no document and the ballot lookup then timed out,
checkUsername() reported a locked or already won name as available and
let the user continue into a flow that funds an identity first.

Add getVoteContendersOrNull(), which returns null on failure, and use
it in checkUsername() so a failed ballot lookup leaves the check
unverified (the request button stays disabled), like a failed name
lookup. getVoteContenders() keeps its behavior for its other callers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
purchase_redeem_url_challange was translated as "This swap backend does
not support the buy flow", so the label beside a gift card's redemption
challenge showed an unrelated error. Use "Hamon" (Challenge).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

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

Re-review — Final validation — Phase 1 + Phase 2

Verified the complete diff at c61aa59 and confirmed that all four prior findings are fixed; no in-scope blocking issues remain. One documentation suggestion remains because the release notes announce mainnet DashConnect availability while production explicitly disables it. Changed XML and string-format checks passed, and existing test reports record 17 passing username tests for each debug flavor; builds and runtime tests were not rerun during this verification.

🟡 1 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: security-auditor); reviewer 3: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 4: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); reviewer 5: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 6: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)

  • Triage: normal by gpt-6-astra (effort low) — The changes span username availability logic, wallet initialization and activity lifecycle handling, mainnet feature enablement, tests, and translations, but do not clearly constitute a large or intricate change to any specified critical surface.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — security-auditor (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity below 15% reserve: weekly 13% left, 5h 100% left), glm-5.3-flash (not used above high effort; tier asks max)
  • Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
  • Fresh verifier: gpt-6-astra — final-verifier; agent astra-verifier
  • Phase 2 reviewers: gpt-6-astra — general (completed, effort high); agent phase2-reviewer, gpt-6-astra — security-auditor (completed, effort high); agent phase2-reviewer, gpt-6-astra — general (completed, effort high); agent phase2-reviewer, gpt-6-astra — security-auditor (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `wallet/CHANGES`:
- [SUGGESTION] wallet/CHANGES:7: Align the DashConnect release note with the mainnet feature gate
  This release note announces mainnet availability, but Constants.java explicitly sets SUPPORTS_CONNECT=false for the prod flavor. ToolsScreen and the payment/address scanning entry points check that flag, so production users cannot access the advertised functionality. The mainnet disablement is intentional, as recorded in commit 4d682249b. Remove the mainnet availability claim or describe the feature as unavailable on mainnet; correcting the release note does not require re-enabling the feature.

Comment thread wallet/CHANGES Resolved
The notes said DashConnect was enabled on mainnet, but the prod flavor
sets SUPPORTS_CONNECT=false (4d68224). Drop that line and mark the
feature entry as testnet only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

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

Re-review — Final validation — Phase 1 + Phase 2

Verified the combined reviewer findings against head 1a1209c: all five prior findings are fixed, and no in-scope blocking issue was confirmed. One translation suggestion remains: the Slovenian backup warning incorrectly implies that the PIN can recover the backup password. Independent validation included source tracing, parsing all 112 changed XML files, checking changed string placeholders, and git diff --check; Android builds and unit tests were not independently rerun.

🟡 1 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: security-auditor); reviewer 3: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 4: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); reviewer 5: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 6: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)

  • Triage: normal by gpt-6-astra (effort low) — The cross-cutting username availability, activity lifecycle, lock-screen UI, build, and translation changes warrant ordinary review, but the supplied diff scope does not establish intricate changes to funds movement, cryptography, key handling, consensus, network deserialization, or storage migrations.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — security-auditor (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity below 15% reserve: weekly 13% left, 5h 100% left), glm-5.3-flash (not used above high effort; tier asks max)
  • Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
  • Fresh verifier: gpt-6-astra — final-verifier; agent astra-verifier
  • Phase 2 reviewers: gpt-6-astra — general (completed, effort high); agent phase2-reviewer, gpt-6-astra — security-auditor (completed, effort high); agent phase2-reviewer, gpt-6-astra — general (completed, effort high); agent phase2-reviewer, gpt-6-astra — security-auditor (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `wallet/res/values-sl/strings.xml`:
- [SUGGESTION] wallet/res/values-sl/strings.xml:160: Correct the backup-password recovery claim in the Slovenian warning
  The new translation tells users to remember their PIN if they want to recover the backup password ("obnoviti geslo varnostne kopije"), instead of telling them to remember both credentials. BackupWalletDialogFragment displays this warning for encrypted wallets, but encrypts the exported file with the separately entered backup password using Crypto.encrypt(); the PIN cannot recover that password. Users following this advice could retain only their PIN and later be unable to restore the file. Preserve the original instruction to remember both the PIN and the backup password.

Comment thread wallet/res/values-sl/strings.xml Resolved
…sword

backup_wallet_dialog_warning_encrypted told users to remember their PIN
"if they want to recover the backup password". The backup file is
encrypted with the separately entered backup password, which the PIN
cannot recover. Say to remember both, as the English does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

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

Re-review — Final validation — Phase 1 + Phase 2

Verified the cumulative diff at 2ea8c74 and confirmed that all six prior findings are fixed. Two in-scope blockers remain: stale availability responses can bypass the new locked-username protection, and the new intent-capture test helper can fail intermittently; the German deposit instructions also reverse the conversion direction. Changed XML files parse successfully, translation format-argument checks and git diff --check pass, and the worktree remains clean.

🔴 2 blocking | 🟡 1 suggestion(s)

1 finding(s) not shown inline (the lines are not part of this PR's diff)

🔴 Blocking: Reject stale username-check results before enabling registration
wallet/src/de/schildbach/wallet/ui/username/request/RequestUserNameViewModel.kt:423-430

These availability results are published without checking which input is currently displayed. Start a slow lookup for available name A, then change the input to locked name B: removing the fragment's delayed runnable does not cancel A's already-running coroutine. A can finish after B's input validation or even after B's locked result, setting usernameCheckSuccess=true and usernameBlocked=false while the fragment uses B's current validity and balance flags. Continue then copies B from the input, and the confirmation dialog calls submit() without checking that B has a matching successful availability result. The new locked-name protection therefore still allows entry into identity funding and preorder registration for a locked name. Associate results with an input generation, invalidate that generation immediately on input changes, ignore superseded responses, and require a matching successful result before continuing or submitting. Add an out-of-order-response regression test.

source: gpt-6-astra (phase2-reviewer: general, security-auditor)

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: security-auditor); reviewer 3: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 4: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); reviewer 5: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 6: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)

  • Triage: normal by gpt-6-astra (effort low) — The diff spans username eligibility checks, lock-screen and activity UI behavior, build configuration, translations, and tests, but does not clearly introduce large or intricate changes to any of the specified critical surfaces.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — security-auditor (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity below 15% reserve: weekly 13% left, 5h 100% left), glm-5.3-flash (not used above high effort; tier asks max)
  • Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
  • Fresh verifier: gpt-6-astra — final-verifier; agent astra-verifier
  • Phase 2 reviewers: gpt-6-astra — general (completed, effort high); agent phase2-reviewer, gpt-6-astra — security-auditor (completed, effort high); agent phase2-reviewer, gpt-6-astra — general (completed, effort high); agent phase2-reviewer, gpt-6-astra — security-auditor (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `wallet/src/de/schildbach/wallet/ui/username/request/RequestUserNameViewModel.kt`:
- [BLOCKING] wallet/src/de/schildbach/wallet/ui/username/request/RequestUserNameViewModel.kt:423-430: Reject stale username-check results before enabling registration
  These availability results are published without checking which input is currently displayed. Start a slow lookup for available name A, then change the input to locked name B: removing the fragment's delayed runnable does not cancel A's already-running coroutine. A can finish after B's input validation or even after B's locked result, setting usernameCheckSuccess=true and usernameBlocked=false while the fragment uses B's current validity and balance flags. Continue then copies B from the input, and the confirmation dialog calls submit() without checking that B has a matching successful availability result. The new locked-name protection therefore still allows entry into identity funding and preorder registration for a locked name. Associate results with an input generation, invalidate that generation immediately on input changes, ignore superseded responses, and require a matching successful result before continuing or submitting. Add an out-of-order-response regression test.

In `wallet/test/de/schildbach/wallet/ui/username/request/RequestUserNameViewModelTest.kt`:
- [BLOCKING] wallet/test/de/schildbach/wallet/ui/username/request/RequestUserNameViewModelTest.kt:389-394: Capture the service intent during verification to avoid a test race
  submit() switches to Dispatchers.IO, and MainCoroutineRule's UnconfinedTestDispatcher permits the continuation to call startService on that worker thread. MockK 1.13.8 records the invocation before executing the stub's argument capture, so verify(timeout = 5_000) can return while this slot is still empty. The saved full-suite result contains exactly this failure: submit_identityRegisteredWithoutError_createsANewIdentity throws IllegalStateException: Value not yet captured at line 394. Capture the intent in verification so the test thread completes the capture before reading it; increasing the timeout does not fix this ordering race.

In `integrations/maya/src/main/res/values-de/strings-maya.xml`:
- [SUGGESTION] integrations/maya/src/main/res/values-de/strings-maya.xml:260: Describe conversion into Dash in the German deposit instructions
  The added wording says “we convert your Dash” (konvertieren wir deine Dash), making Dash the input asset. DEXReceiveScreen displays this text beneath the selected external coin's deposit address, and the English resource explains that the incoming transfer is converted into Dash. State the conversion direction explicitly so the instructions agree with the deposit heading.

HashEngineering and others added 2 commits September 28, 2026 09:41
Changing the input cancelled the fragment's pending check but not one
already running. A slow result for an earlier, available name could land
after the input moved to a locked name and report usernameCheckSuccess
with usernameBlocked=false; Continue then took the locked name from the
input and went on to identity funding.

- Cancel the running check when the input changes or a new check starts,
  and clear the previous result straight away.
- Record which name a result belongs to (checkedUsername), and only
  continue when the result is a successful one for exactly the name in
  the input (hasAvailableResultFor); otherwise recheck.
- Tests for out-of-order results, and capture the service intent during
  verification: MockK records the call before a stub's capture() runs,
  so verify(timeout) could return with the slot still empty.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
dex_receive_description read "we convert your Dash", making Dash the
input. The deposit is converted into Dash; say so, as the English does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@HashEngineering

Copy link
Copy Markdown
Collaborator Author

Re the out-of-diff blocker (stale username-check results, RequestUserNameViewModel.kt:423-430): fixed in ab41c73.

  • A running check is now cancelled whenever the input changes (checkUsernameValid) or a new check starts, and the previous result is cleared right away. Each result is published on the main thread right after a withContext, which throws once the job is cancelled, so a superseded check can't publish.
  • Results carry checkedUsername. onContinue() (the only entry point to the confirm dialog, VerifyIdentity and submit(), and shared by the secondary-username subclass) now requires hasAvailableResultFor(input), meaning a successful, not-taken, not-blocked result for exactly the name in the input. Otherwise it rechecks instead of continuing.
  • Regression tests: a slow result for a free name that finishes after a locked name's result, and an input change while a check is in flight. Both fail if the cancellation is removed.

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

Re-review — Final validation — Phase 1 + Phase 2

Independently assessed the complete diff at 12ab218 and verified that all nine prior findings are fixed; no additional actionable in-scope defects were identified. Fresh wallet unit-test execution passed with 229 tests, zero failures or errors, and one skipped, including all 20 username regression tests; production-debug Kotlin compilation validation, parsing of all 112 changed XML files, translation placeholder checks, and diff whitespace checks also passed. Signed release builds and device-level QA were not performed, and the tracked worktree remains clean.

🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(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: security-auditor); reviewer 3: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 4: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); reviewer 5: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 6: gpt-6-astra (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)

  • Triage: normal by gpt-6-astra (effort low) — The changes span username-validation concurrency, lock-screen and activity behavior, release configuration, tests, and extensive translations, but do not clearly introduce large or intricate changes to any qualifying critical surface.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — security-auditor (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity below 15% reserve: weekly 13% left, 5h 100% left), glm-5.3-flash (not used above high effort; tier asks max)
  • Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
  • Fresh verifier: gpt-6-astra — final-verifier; agent astra-verifier
  • Phase 2 reviewers: gpt-6-astra — general (completed, effort high); agent phase2-reviewer, gpt-6-astra — security-auditor (completed, effort high); agent phase2-reviewer, gpt-6-astra — general (completed, effort high); agent phase2-reviewer, gpt-6-astra — security-auditor (completed, effort high); agent phase2-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.

@HashEngineering
HashEngineering merged commit ef552d4 into master Sep 28, 2026
3 checks passed
HashEngineering added a commit that referenced this pull request Oct 16, 2026
Review 4299080469. Master's v11.9.1 (#1567, ef552d4) added a reuse
condition to RequestUserNameViewModel.submit(): a locked or lost vote,
or a creation error at or past IDENTITY_REGISTERED. Matching identities
go through CreateIdentityService.createIntentForNewUsername. That path
was written for dashj-funded identities. createIdentity(retry=true)
replaces the identity record with a fresh one at NONE, then looks for
the funding transaction in dashj's AuthenticationGroupExtension.

The SDK creation path never puts its asset lock there. So after the
cutover, an SDK-created identity whose DPNS name was rejected went
into fresh legacy funding (CREDIT_FUNDING_TX_CREATING) instead of
registering a name for the identity it already has.

After the cutover, such an identity (one with a userId) now goes
through the name-only recovery that phase-1 already has:
- the new SdkTransparentUsernameCreation.retryNameForExistingIdentity()
  records the requested name(s) against the existing identity with
  restoring = true;
- it puts the creation state back on USERNAME_REGISTERING with the old
  error cleared;
- it hands the identity to RestoreIdentityOperation, the same handoff
  the SDK create path uses on a name failure.
That worker's post-cutover branch registers the name through
registerDpnsNameForExistingIdentity and never funds. Before the cutover
master's legacy reuse path is unchanged.

Tests (written first; both new behaviour tests failed before the fix):
- the downstream retry persists the name context for the same
  identity, drives only the name step, hands that identity off, and
  never calls registerWithWalletFunding, resume or key preview;
- the view model routes a post-cutover retry to it and starts no
  CreateIdentityService;
- a pre-cutover retry still takes the legacy path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HashEngineering added a commit that referenced this pull request Nov 4, 2026
…tity (#1626)

* Register a replacement username for an SDK-created identity

After the cutover, retrying with a new username for an identity the
SDK created (a contested name that LOST_VOTE or was LOCKED, or a name
rejected after IDENTITY_REGISTERED) never registered the new name.

- submit() still sent the retry down the dashj CreateIdentityService
  path, which resets the identity record to NONE and looks for a
  funding transaction the SDK never wrote to dashj's
  AuthenticationGroupExtension.
- RestoreIdentityWorker only registered a name when the identity
  owned none, so a registered instant secondary blocked the
  replacement.
- The recovery could overwrite the requested label with that
  secondary unless the request was contestable.

This matches master's dashj behaviour (option B, the user's choice).
The requested name is registered for the existing identity and becomes
the primary/display name, and a registered instant secondary stays the
secondary.

- RequestUserNameViewModel.submit(): after the cutover a reuse retry
  goes to the new SdkTransparentUsernameCreation.retryNameForExistingIdentity.
  It records the name context with restoring = true, marks the label
  (new BlockchainIdentityConfig.REQUESTED_NAME_RETRY), drops the old
  USERNAME_REQUESTED status, sets USERNAME_REGISTERING with the error
  cleared, and hands the identity to RestoreIdentityOperation. It never
  funds and never resets the identity. Before the cutover, master's
  path is unchanged. The reuse condition gains master's #1567 clause
  (rejected after IDENTITY_REGISTERED). Invites are out of scope.
- RestoreIdentityWorker: the currentUsername == null gate is now
  requestedNameStepApplies().
  - With no name on chain it behaves as before.
  - Otherwise it registers only the pending replacement, only while
    that label is not already owned. An earlier attempt that landed,
    an Ambiguous one included, is never re-submitted, and a plain
    restore never re-registers an old name. The contender guard still
    runs for contestable labels.
  - The marker is cleared when the restore finishes. A replacement
    still missing at that point throws a retryable error instead of
    finishing quietly, so the screen never sits on "registering" after
    a no-op.
- recoveredPrimaryIsPendingDualSecondary() no longer requires a
  contestable record primary. IdentityRepository keeps the requested
  primary both before and after it registers, whichever name dashj
  adopts as "primary", and no longer copies that primary into the
  secondary field.

Tests drive the real repository record update (pending and registered
replacement, contestable and not, with and without a secondary) and the
worker's gate (a registered secondary, no name, already owned, plain
restore, wrong label), plus the retry and the view model routing. The
pre-cutover legacy path is checked too.

Expected overlap with PR #1616 (88e3424), which adds the same
retryNameForExistingIdentity and the same submit() routing block and
reuse clause. The text is kept identical where possible. This version
adds the REQUESTED_NAME_RETRY marker (markNameRetry).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep the name-only retry alive after the username screen closes

Review 5556781925 (raised on PR #1616; the same code is on this branch).
The post-cutover name-only retry set usernameRequestSubmitting before
calling retryNameForExistingIdentity() in the screen's viewModelScope.
UsernameSubmitStatusDialogs navigates Home and finishes the activity on
that flag, which clears the view model. The retry, still suspended in
its DataStore writes, was cancelled before handOffToLegacy() enqueued
RestoreIdentityWorker. The user landed on Home with nothing submitted
and only part of the name context written. A new view-model test parks
the context write, closes the screen and waits for the handoff, which
never came before this change.

retryNameForExistingIdentity() now follows the existing submit()
pattern. It launches the retry on the application scope, registered
with the wallet-wipe fence (LAZY, tracked, then started), and returns
whether it was accepted. With no executor scope, or a wipe in progress,
it refuses and does nothing. The view model publishes the submitting
state only once the retry is accepted, and shows the error state
otherwise.

Review 4302041841: the application scope has no exception handler, so
a failure in the context write or the worker handoff escaped the launch
and crashed the process after the screen was told the retry started.
The launch now catches non-cancellation failures, logs them and records
a retryable USERNAME_REGISTERING error so the retry card shows.
CancellationException (the wipe fence) still propagates. Two tests make
the context write and the handoff throw.

Same change as PR #1616's 717af4f and ac3911d, kept textually
identical so the two branches merge cleanly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Register a replacement name in the retry itself, like the create path

Reviews 4301924854 and 4301924856: the name-only retry handed the
identity to RestoreIdentityWorker to register the replacement. A
home-tile retry (fromCreation=false) rebuilt the record from recovery,
overwrote USERNAME with the recovered secondary, and skipped the name
step for good. A newly requested secondary was never registered at all.

RestoreIdentityWorker is to be removed, so this backs out the branch's
worker changes (requestedNameStepApplies, the REQUESTED_NAME_RETRY
handling and the end-of-run check), the REQUESTED_NAME_RETRY key, and
the ContestedReregistrationGuardTest additions. The worker is back to
phase-1.

retryNameForExistingIdentity() now registers the names itself, inside
the same app-scoped, wipe-fenced, error-catching run, through the
create path's own name tail. That tail is now registerNamesAndHandOff(),
shared and left in place:
- the primary through registerNameTracked (PREORDER, REGISTERING,
  REGISTERED);
- a requested secondary with the *_SECONDARY_* states, only once the
  primary is confirmed;
- a confirmed non-contested primary driven to DONE;
- the recovery handoff (DONE or VOTING), or restoring marked when the
  primary did not confirm.
It never funds and never resets the identity. Before submitting, a label
the identity already owns or contends for (an earlier Ambiguous attempt
that landed, a contested name it is already in) is not submitted again.
That check uses PlatformRepo's owned-names lookup (the SDK read, else
dashj) and its vote contenders, and fails closed: an unreadable lookup
refuses the retry with a retryable error before anything is submitted.
The persisted name context carries the requested primary, and a
secondary only when one is requested, so a registered secondary stays.
The IdentityRepository and UsernameDisplay changes keep that primary as
the display name when recovery's dashj adopts the old secondary.

RequestUserNameViewModel.submit() reads the cutover state strictly, as
#1616 c4ac593 does: SdkL1SendService.cutoverCommittedOrUnknown(),
through SdkTransparentUsernameCreation.cutoverStateOrUnknown(), for the
name-only retry and the fresh SDK registration. Committed retries the
name, explicitly not committed keeps the legacy path, and unknown shows
the error state with no service started and nothing reset.

Tests first; each failed on the previous code:
- a replacement primary is registered for the existing identity, with
  the record's secondary left alone, DONE and the recovery handoff, and
  no funding;
- a requested secondary is registered after the confirmed primary;
- an owned label is not submitted again;
- an unreadable ownership lookup refuses with a retryable error and
  nothing escapes the app scope;
- an unknown cutover state is refused with nothing started or reset.
The retry tests that asserted the worker handoff are replaced.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep a failed name-only retry on its own route, and refuse before accepting

Review round 1 on #1626 (thread 4301924854 and the follow-ups).
RestoreIdentityWorker is untouched.

- A replacement name that did not register, or whose outcome is
  unknown, was left with restoring set. The home tile's retry and the
  background discovery then ran the restore worker with
  fromCreation=false, which rebuilt the record from the chain, adopted
  the registered secondary and dropped the replacement. A name-only
  retry (registerNamesAndHandOff(nameOnlyRetry = true)) now leaves
  restoring alone and stamps its own retryable error,
  NAME_ONLY_RETRY_ERROR, Ambiguous included. The home tile's Try again
  and tap send that error back into retryNameForExistingIdentity() with
  the requested names on record; the ownership check there keeps a name
  that did land from being submitted again.
- A failure before submission left a stamped error whose Try again
  started CreateIdentityService after the cutover. The wallet binding
  and the fail-closed ownership/contender read now run before the retry
  is accepted (retryNameForExistingIdentity is a suspend function). A
  refusal returns false, the screen shows its error, and the identity
  is untouched. A failure once accepted (a context write) is stamped
  with NAME_ONLY_RETRY_ERROR, which routes the same way. The tile's
  routing is the pure identityRetryRoute().
- The wider reuse clause (an identity on chain whose name was rejected)
  applies only once the cutover is committed; before it, master's
  LOCKED or LOST_VOTE rule stands.
- submit() records the requested name (updateConfig) only once a path is
  taken. A refusal (unknown cutover state, a refused retry) changes
  nothing. The replacement is written only once a retry is accepted, and
  no recovery runs on a failed one, so the wider
  recoveredPrimaryIsPendingDualSecondary guard cannot pin a name that
  was never submitted.
- SdkL1SendService.cutoverCommittedOrUnknown() is built on phase-1's
  cutoverCommittedOrThrow(). The new functions sit after the existing
  functions' KDocs and declarations (registerDpnsNameForExistingIdentity,
  isCutoverCommitted, cutoverCommittedOrThrow, getVoteContendersOrThrow)
  instead of between them.

Tests first; each failed on 819e4f0:
- a failed replacement stays on the name-only route, and the tile's
  retry registers it;
- an Ambiguous one is not submitted again once it landed;
- an unreadable ownership read refuses before acceptance with nothing
  touched;
- an in-run failure is stamped for the name-only route;
- the tile routes that error back to the name-only retry;
- an unknown cutover state and a refused retry leave USERNAME unchanged;
- before the cutover a rejected-name record takes master's fresh path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Single-flight the name-only retry and route every Try again to it

Review round 2 on #1626. The user chose master's behaviour: an uncertain
name-only outcome is a plain retryable error (NAME_ONLY_RETRY_ERROR, as
before), and Try again retries the same name. The ownership/contender
check in retryNameForExistingIdentity() finds a name that did land and
completes it rather than submitting it again. RestoreIdentityWorker is
untouched.

- Single-flight (B2): SdkTransparentUsernameCreation holds one slot for
  retryNameForExistingIdentity() and submit() together, for the whole
  run. A second call while one is running returns false and changes
  nothing, so a double tap cannot register (and prefund) the same name
  twice.
- More screen (B1): CreateIdentityViewModel.retryCreateIdentity(), which
  the More screen's tile tap and Retry button call, sends a name-only
  retry's error back into the name-only retry with the requested names
  on record. It never goes to CreateIdentityService after the cutover.
- A name taken by someone else: when a name-only failure is a duplicate
  or a contest the identity is not part of, the home tile and the More
  screen open the request-name screen instead of retrying the same name.
  Checked before the name-only route, through a shared needsNewName()
  (the More screen's existing list); identityRetryRoute() gains
  NEW_NAME.

Tests first; the three new ones failed on 065ea58:
- the More screen's retry of a name-only error calls the name-only retry
  and never starts CreateIdentityService;
- a second retry, or a creation, while a name-only retry runs is refused;
- a name-only failure because the name is taken routes to NEW_NAME.
The existing test that an Ambiguous attempt which landed is not
resubmitted on Try again still holds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Address review: IO-dispatched name checks, NEW_NAME tile route, primary metadata

- SdkTransparentUsernameCreation: the name-only retry's ownership and
  contender checks run on ioDispatcher, not the caller's Main dispatcher.
- WalletTransactionsFragment: a home-tile tap on a NEW_NAME error opens
  CreateUsernameActivity reusing the transaction, like Try again.
- IdentityRepository: when dashj recovers the requested replacement as its
  "secondary", its status and salt now go to the primary fields too, so they
  no longer keep the lost name's LOST_VOTE/LOCKED status or old salt. It is
  still not duplicated into the secondary.
- CreateIdentityViewModel/MoreFragment: a refused name-only retry (or one
  with no identity id or username on record) emits a one-shot event; the More
  screen shows the same toast as the home tile.
- RequestUserNameViewModel: no `!!` on the requested name; null is a refusal.

Tests: dispatcher of the ownership checks, primary status/salt on recovery,
the More-screen refusal event, and a null requested name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Address review: refuse id-less reuse after cutover, tolerate config write failure, IO wallet-id read

- RequestUserNameViewModel: after the cutover a reuse submission (locked,
  lost vote, rejected after registration) with no identity id is refused
  instead of falling through to legacy creation, which resets the record
  and can fund a new identity.
- RequestUserNameViewModel: an accepted name-only retry still publishes
  the submitting state when the requested-name config write fails.
- SdkTransparentUsernameCreation: the bound wallet-id read (may cold-start
  the SDK) and identity parsing run on the IO dispatcher with the
  ownership checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Refuse a username submit/retry the wipe fence cancels at track time

A wipe could raise the fence between the early isRaised check and
track(job), or track could cancel the lazy job at once; both paths still
returned true, so the caller persisted the name and showed submitting for
a job that never runs. trackOrRefuse now cancels the job and reports a
refusal, releasing the single-flight slot (name-only retry) or the
Proving slot (create).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Address review: name-only retry error keeps reuse and primary, start-time wipe refusal, ownership re-check before each name

- RequestUserNameViewModel: a NAME_ONLY_RETRY_ERROR counts as rejected after
  registration, so a replacement name stays on the name-only retry after the
  cutover (an identity-less record is still refused)
- RequestUsernameFragment: reuseUsernameType opens a failed name-only retry
  as the primary before the older secondary heuristic
- SdkTransparentUsernameCreation: a job a wipe cancels between the track and
  the start is a refusal; the retry slot is released exactly once
- SdkTransparentUsernameCreation: the name-only retry re-reads ownership right
  before each registerDpnsName, skipping a name now ours and failing closed on
  an unreadable read

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Address review: per-identity DPNS registration lock, More screen reuses the identity

- DpnsRegistrationLock (singleton, Mutex per identity id) held across
  re-check -> registerDpnsName -> record for every in-app SDK DPNS
  registration: the transparent create path and name-only retry
  (registerNameTracked), registerDpnsNameForExistingIdentity (restore
  worker, invite flow), and the shielded create path. Waiting callers
  re-read ownership; registerDpnsNameForExistingIdentity always does.
- More screen's needs-new-name route starts CreateUsernameActivity with
  createIntentReuseTransaction, like the home tile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): submit one immutable snapshot and lock the screen while it is routed

A name-only retry captured the requested name, then suspended in its
preflight while the screen stayed editable; once accepted, updateConfig()
read the mutable field and could save a name typed in the meantime.

submit() now captures the name, secondary and link at the tap, and every
route and the config write read that snapshot. A preflight flag locks the
input and the button and ignores a second submit until it is routed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): give a name-only retry a durable owner and keep its names through recovery

A name-only retry had no durable owner until its name registered: a
process death during the registration left the record on the name step,
not restoring, with no job and no error, so it stayed "processing".
The requested names also survived only the first fromCreation handoff:
an ordinary recovery retry started from an empty record and let the
registered secondary replace the replacement and drop its contest.

RequestedNameJournal (BlockchainIdentityConfig) keeps the requested
names apart from the record and marks a name-only retry pending, in the
same write that puts the record on the name step, before anything else
changes. The mark is cleared once the outcome has an owner (the recovery
handoff, or a recorded retryable error). On restart
SdkTransparentUsernameCreation.reconcileInterruptedNameRetry(), called
from discoverAndRecoverIdentity, re-reads ownership under the DPNS lock
and never registers: owned -> DONE + handoff, contending -> registered +
handoff (recovery reaches VOTING), absent -> the name-only retryable
error, unreadable -> unchanged until the next trigger.

RestoreIdentityWorker starts a non-fromCreation run from the persisted
record when the requested names are the same identity's
(recoverySeedRecord); a genuine restore still starts empty.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): keep a name-only retry pending until recovery owns it, and record it before accepting

Review of 9d97674:
- A DONE record with the retry still pending is handed to recovery on
  restart before the mark is cleared: DONE is written before the handoff,
  and the mark stays when the handoff throws or the process dies there.
- The reconcile also runs on every platform sync tick, not only from
  discovery (once per service lifetime once an identity exists), so a
  reconcile deferred on an unreadable ownership read is retried.
- beginNameOnlyRetry() runs before retryNameForExistingIdentity() accepts,
  under the wipe fence; a failed write refuses the retry. The screen's
  "submitting" now always follows a durable pending record.
- That write also puts the identity id, requested names, restoring=false
  and the cleared request status on the record in the same edit, so a
  partial context write can no longer drop the requested secondary.
- More's taken-name retry reads the stored identity when the observed one
  has not arrived, and shows the error instead of ignoring the tap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): clear a pending name-only retry only once its recovery job is committed

WorkManager's enqueue() persists asynchronously, and the handoff discarded
its Operation: the pending mark was cleared right after, so an async
enqueue failure, or a process death before WorkManager committed, left
neither the pending record nor a recovery job.

The handoff seam is now suspending, and the production handoff awaits the
enqueue's Operation (awaitingEnqueue). It throws when the enqueue failed,
which keeps the retry pending, in the live run and in both restart
reconcile handoffs (including the DONE branch).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): claim the single-flight slot before reading a pending name-only retry

The reconcile read the pending retry before claiming the slot. A sync tick
could capture a live retry's pending record, then resume after that retry
had recorded its taken-name error, cleared its mark and freed the slot,
and overwrite the error with the generic "interrupted" one, so a Try again
retried the unavailable name instead of asking for a new one.

reconcileInterruptedNameRetry() now claims the slot first, reads under the
claim and releases it in finally on every exit. The config's
pendingNameOnlyRetry() reads the mark, the names and the record state from
one snapshot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): record a retry's terminal error with its pending mark, and read the recovery seed strictly

- Saving a name-only retry's terminal error and clearing its pending mark
  were two DataStore writes. A process death or a failed second write
  between them left the retry pending, and the restart reconcile replaced
  a taken-name error with the generic "interrupted" one, so Try again
  resubmitted the taken label. RequestedNameJournal.failNameOnlyRetry()
  does both in one edit, used by every failure path (the primary's failure,
  the run's own handler, the reconcile's "absent" branch). The reconcile
  also never replaces a name-only error already on record (same-snapshot
  read): it only retires the mark.
- loadRecoverySeed() read through BaseConfig.data, which turns an
  IOException into empty preferences, so an unreadable store looked like
  a fresh restore and recovery started from an empty record. It now reads
  the record and the requested names from one strict snapshot that throws,
  so the recovery fails (nothing reset) and is retried.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): keep a stale vote lookup from undoing a name-only replacement

A voting/reconcile lookup started for the old name could write its whole
pre-lookup snapshot back after beginNameOnlyRetry accepted a replacement (or
after failNameOnlyRetry recorded its error), restoring the old name and VOTING.
The restart reconcile then cleared the pending replacement as "taken to its vote".

- PlatformSyncService: checkVotingStatus and reconcileUsernameStatus re-read
  the stored record right before each write and skip it when the identity,
  name, creation state or error changed under the lookup (updateIfUnchanged).
  Full compare-and-set persistence is deferred to #1673.
- reconcileNow: VOTING clears the pending retry only when the record carries
  the requested replacement; otherwise it reconciles ownership as usual.
- PendingNameOnlyRetry carries the record's username from the same read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): compare and write a vote/reconcile result in one store edit

updateIfUnchanged re-read the record, then wrote it through
updateBlockchainIdentityData: a name-only retry accepted and failed between the
re-read and the write was still overwritten with the old name, VOTING and no
error, leaving neither the replacement's error nor a pending mark.

- BlockchainIdentityConfig.insertIfUnchanged: one DataStore edit reads the
  stored identity id, name, creation state and error and writes the record only
  when they match the lookup's snapshot (IdentityRecordKey, now shared). Edits
  are serialized, so beginNameOnlyRetry/failNameOnlyRetry land wholly before the
  check or after the write. A cleared store (NONE) never matches, which also
  covers the no-resurrection guard.
- IdentityRepository.updateBlockchainIdentityDataIfUnchanged routes to it;
  PlatformSyncService.updateIfUnchanged uses it, and so does the VOTING -> DONE
  write in updateContactRequests (the other stale whole-record vote write).
- IdentityConditionalWriteTest (Robolectric, real DataStore config) pauses the
  service's write at the repository, accepts and fails the replacement, then
  resumes: the record keeps the replacement name and error. It fails against the
  previous re-check-then-write.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): send a taken primary back to primary-name entry

A fresh SDK dual-name request registers its primary first; a duplicate
rejection leaves USERNAME_REGISTERING with the secondary on the record.
More now reopens that record with REUSE_TRANSACTION, and the old
heuristic routed it to Secondary entry, so the taken primary could not
be replaced. A taken-name error on the primary's step now selects
Primary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): keep a started name-only retry from being cancelled with its screen

The durable start write clears the old error and LOST_VOTE/LOCKED before
the application-scoped job exists. The request screen's identity
observer could finish on that record (only the preflight flag was set),
clearing the ViewModel and cancelling the retry before the job was
launched. The section from the write to the job start is now
NonCancellable, the single-flight slot is released by the job once it
owns it, and both identity observers stand down while a submit is being
routed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): write a won vote's result and completion in one conditional write

checkVotingStatus launched the APPROVED write and then wrote DONE
against the same loaded VOTING key. Whichever landed second was
refused, and when that was the launched write the profile update for
the winning name was skipped. The result and the completion are now
one conditional write, followed by the profile update.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): refuse the More-screen retry when its routing marker is unreadable

BaseConfig.get reads an unreadable store as empty, so a name-only
retry's error read as "no error" and the retry fell through to
CreateIdentityService. The routing decision now uses
getPreservingErrors and refuses on a failed read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): name the own profile after the record's chosen primary

After a replacement registered next to the old instant secondary,
profile recovery used the cached wrapper's currentUsername and the
contact-profile refresh kept whichever owned name its heuristic picked,
so More could keep showing the old secondary. One rule
(ownedRecordPrimary, via IdentityRepository.ownProfileUsername): the
own profile carries the record's primary when the identity owns it,
otherwise the existing choice stands (a contested primary in its vote).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): publish a contested name's verification link from the SDK registration owners

Recovery only reads IdentityVerify documents back, and the SDK paths
never published one, so a contested name (a name-only replacement, or
a fresh SDK creation) reached its vote without the link the user gave.
After the handoff, a contested primary's link on record (read strictly)
is handed to the existing BroadcastIdentityVerify publisher. A name-only
retry stays pending until that enqueue succeeds; the restart reconcile
publishes it too. The shielded creation does the same, best effort.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(username): run the paused vote write off the test thread

checkVotingStatus now writes its result in line (d2beb81), so the
test's paused store write blocked the call it was waiting to resume.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): route the More-screen retry on one strict identity snapshot

c680f74 read only the error marker strictly; the identity id, names,
restoring and invite flags were still lenient per-key reads that turn
an unreadable store into "absent". BlockchainIdentityConfig.retryRouting
now returns every routing field from one strict read, and
retryCreateIdentity refuses through nameRetryRefused when it throws,
starting neither the name-only retry nor CreateIdentityService.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): keep a verification link's publication until it can land

- BroadcastIdentityVerifyWorker retries (bounded, with WorkManager's
  backoff) while the identity is not loaded yet, instead of failing for
  good: SDK registrations (transparent and shielded) enqueue it next to
  recovery, which loads the identity only when it finishes.
- The reconcile's VOTING branch publishes a contested replacement's link
  before clearing the pending retry, and keeps it pending when that
  fails: reaching the vote proves the name, not the publication.
- The publisher skips a name whose verification work already succeeded
  or is still queued, so a re-publish never broadcasts a second document.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): let a name-only retry own its terminal error

registerNameTracked's submit and its unreadable-ownership refusal
stamped a plain error before registerNamesAndHandOff committed the
prefixed NAME_ONLY_RETRY_ERROR with the pending mark's retirement. A
process death or a failed finalizer between the two left a plain error
with the retry pending: the retry entry points could then start the
legacy CreateIdentityService, and the restart reconcile replaced a taken
name's rejection with the generic interrupted error. In name-only mode
(the primary and the secondary) those helpers now return the failure
without writing it; the retry commits it in one write.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): submit a verified replacement name instead of only verifying it

After a lost or locked vote the record stays VOTING, DONE or
DONE_AND_DISMISS, so the Verify screen's "VOTING or later" rule
published an IdentityVerify document for the new contested name and
popped the screen without submitting it: the replacement was never
registered. verifyRoute now tells a replacement (lost/locked vote, an
error on record, or a name other than the one on record) from verifying
the request already in its vote; a replacement goes through the confirm
dialog to submit(), the same name-only route the request screen uses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): never re-publish a verification link whose outcome is unknown

A FAILED verify run does not prove nothing was submitted: the SDK's
Ambiguous outcome (a submission timeout) fails the worker too. With the
name retry still pending, a reconcile then enqueued another paid create
while the first document may already have landed. The worker now marks
a failure after submitting as uncertain in its output, and the
publisher (publishVerificationLinkOnce) creates again only after no run
or a definite failure; an uncertain run is logged and not re-published.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): keep the instant-name screen on the secondary for a replacement

After a dual request's primary was taken, the user picks a replacement
contested primary and the confirmation offers an instant name.
RequestUsernameSecondaryFragment asks for Secondary, but the reuse
heuristic (3880070) read the record's old error and flipped it to
Primary, so the typed instant name overwrote the chosen replacement.
An explicit Secondary request now wins; only the primary entry follows
the reused record.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): count a username change as a profile change

DashPayProfile.equals ignored username, so the username-only update
fa99aa4 makes after a registered replacement was dropped by the
profile observers' distinctUntilChanged() and More kept the old name.
Equality now includes the username (hashCode stays a consistent subset).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): give a contested name's verification link one durable owner

The verification link was published from the registration paths as
fire-and-forget work: a worker that ran before the identity was loaded,
a process death between enqueues, or an uncertain (Ambiguous) outcome
could lose the document or create it twice, and recovery's own
registrations never published it.

- VerifyLinkObligation (BlockchainIdentityConfig): recorded when a
  contested name with a link is accepted for registration (fresh
  transparent and shielded creation, the name-only retry, and the SDK
  registration recovery uses), before the name is submitted; cleared
  only once the IdentityVerify document is found, or when the request no
  longer applies (another identity, another name, the link removed).
- VerifyLinkReconciler, run from the platform sync tick, is its one
  owner: once the identity owns or contends for the name, with no
  publication in flight and the last attempt settled, it looks the
  document up by owner and normalized label (the SDK search, else dashj,
  as the voting sync does): found -> cleared; absent -> one publication.
- The worker records an uncertain outcome on the obligation instead of
  failing silently; an uncertain attempt is published again only after
  it settled and the lookup proves the document absent. Its 12-run cap
  and the WorkManager-history dedupe are gone: a worker that finds the
  identity not loaded fails, and a later pass publishes again.
- Nothing is added to RestoreIdentityWorker.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): prove a verification document absent before publishing; route verify updates through the obligation

- verifyDocumentPresence: the SDK search's answer is definite; without
  one, dashj's IdentityVerify.get decides. Checked in dash-sdk-kotlin
  5.0.0: it returns null only for a query that succeeded empty, and
  every failed read throws (DapiClient.getDocuments rethrows or ends in
  MaxRetriesReachedException, Result.Failure.unwrap throws, Documents.get
  rethrows), which is now unknown: the pass is skipped, nothing enqueued.
- The Verify screen's update of a request in its vote no longer enqueues
  the worker directly: it puts the link on record, records the obligation
  and kicks one reconcile, which publishes only when no document exists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): keep a pending requested primary when recovery adopts another owned name

A dual replacement (bobby contested + bobby2 instant) after a lost
primary with a registered instant alice2: bobby is in its vote and
bobby2 failed, so recovery finds only alice2, which is not the record's
secondary. The secondary guard did not apply and alice2 overwrote bobby,
dropping the paid contest from the scan. The record now keeps its
primary whenever it is the name requested for this identity and
recovery adopted a different one (not after a lost or locked vote).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): one verification-link publisher for an SDK-claimed invite

An SDK-claimed invite registers its name through the SDK, which records
the obligation the VerifyLinkReconciler publishes; finishRegistration
also published the link inline, so the document could be created twice.
The inline publish now runs only for the legacy dashj creation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): rebuild a lost verification-link obligation; never publish an older link

- A funded creation's obligation write is best effort; a failed one lost
  the publication for good. The reconcile now rebuilds the obligation
  from the identity record (a contested name with a valid link, past the
  creation flow's own link step, not failed, lost or locked) unless that
  request is already settled: a found document now settles the request
  durably, so it is never rebuilt and Platform is not read again.
- The obligation is compared with the link on record, not just a
  non-blank one: a newer link replaces the pending one and the older
  link is never published.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): read requested names strictly; publish only the verification link still pending

- requestedNames() read leniently: an unreadable store read as "nothing
  requested" and let recovery adopt another name over a pending
  replacement. It now reads strictly, and the recovery update keeps the
  record's primary when the read fails.
- A reconcile pass that read link A and then waited on Platform could
  enqueue A after the user saved link B. markVerifyAttempt now reports
  whether the obligation was still A, and the pass enqueues only then;
  the worker re-reads the obligation right before submitting and
  publishes nothing for a link that is no longer pending.
- A found document settles the obligation only when it carries the
  obligation's link; another link is logged and left pending.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): chain an SDK registration's recovery after an in-flight one

The handoff enqueued RestoreIdentityOperation as unique work with KEEP:
a recovery of the same identity still running absorbed it, and that
older run could write the old name back after the retry cleared its
pending mark. The SDK registrations' handoff now uses APPEND_OR_REPLACE,
so a fresh recovery always runs after the in-flight one and reads the
record and requested names when it starts. The pending mark is still
cleared only once that enqueue is durable. Other triggers keep joining a
running recovery.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(username): finish an interrupted dual retry's secondary on restart

The restart reconcile checked only the primary: a dual retry killed
after its primary landed was handed to recovery and retired, dropping
the requested secondary. It now submits the secondary through the same
tracked path (ownership re-checked under the DPNS lock first) before
handing off; if it does not register, the prefixed name-only error is
recorded for the tile's retry instead of retiring silently.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.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