Skip to content

fix: missing merchant icons and other crashes, anrs - #1506

Merged
HashEngineering merged 12 commits into
masterfrom
fix/crashes-anrs
Jul 9, 2026
Merged

HashEngineering merged 12 commits into
masterfrom
fix/crashes-anrs

Conversation

@HashEngineering

@HashEngineering HashEngineering commented Jul 2, 2026 •

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

Related PR's and Dependencies

Screenshots / Videos

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

Summary by CodeRabbit

  • New Features

    • Added consistent merchant/gift-card icon rendering with Compose-based fallbacks that display merchant initials or full names when no logo is available.
    • Introduced a shared merchant logo component used across search, map, details, and transaction screens.
  • Bug Fixes

    • Restored merchant logo visibility for cached gift-card transactions and improved icon refresh when logo data arrives late.
    • Improved fallback logo behavior on map markers and transaction result screens.
    • Enhanced stability for screen transitions and app restarts; purchase confirmation now correctly disables when offline.
  • Other

    • Improved reliability of country-code lookup from location.

HashEngineering and others added 7 commits June 27, 2026 08:47
Gift card merchant logos stopped appearing on the home transaction list in
v11.8.0 when the tx_display_cache was introduced. The cache only stores a
static icon enum and dropped the merchant logo bitmap (iconBitmap), which
toTransactionRowView then hardcoded to null on read-back, so cached gift
card rows fell back to the default icon.

Re-inject the bitmap from the already-decoded in-memory metadata map on the
live (RoomLive) path, and from a disk lookup by icon id on the cold-start
path. The live path is intentionally not gated on the new customIconId
column, so rows cached by an older version recover their logo on the next
launch without a rebuild.

- TxDisplayCacheEntry: add nullable customIconId column; fromTransactionRowView
  param; toTransactionRowView iconBitmap param
- TxDisplayCacheService: iconBitmapForEntry / iconBitmapForEntryCold helpers;
  inject on both read paths; pass customIconId at all five write sites;
  preserve customIconId in the metadata-merge branch; invalidate the pager on
  an empty-changedIds metadata emission so a late-arriving logo is picked up
- AppDatabase 19 -> 20 with migration19to20 (ALTER TABLE tx_display_cache
  ADD COLUMN customIconId TEXT), registered in DatabaseModule; schema 20.json
- docs/proposals: record the implemented design

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…out a logo

DashSpend gift card transactions whose merchant has no logo were falling
back to the static gift card icon in the tx_display_cache. Generate a
full-name merchant icon (matching the merchant list) instead, both on the
home tx list (TxDisplayCacheService) and in the transaction details view
(TransactionResultViewBinder). Adds MerchantNameIcon to the shared
MerchantInitialIcon component and caches generated bitmaps by merchant name.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@HashEngineering HashEngineering self-assigned this Jul 2, 2026
@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Too many files!

This PR contains 220 files, which is 70 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 420afcb1-cd2c-41b2-8877-339e7e382a02

📥 Commits

Reviewing files that changed from the base of the PR and between 54a444e and 79c1378.

📒 Files selected for processing (220)
  • common/src/main/res/values-bg/strings.xml
  • common/src/main/res/values-ca/strings.xml
  • common/src/main/res/values-da/strings.xml
  • common/src/main/res/values-de/strings.xml
  • common/src/main/res/values-el/strings.xml
  • common/src/main/res/values-eo/strings.xml
  • common/src/main/res/values-es/strings.xml
  • common/src/main/res/values-et/strings.xml
  • common/src/main/res/values-fa/strings.xml
  • common/src/main/res/values-fi/strings.xml
  • common/src/main/res/values-fil/strings.xml
  • common/src/main/res/values-fr/strings.xml
  • common/src/main/res/values-hr/strings.xml
  • common/src/main/res/values-hu/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-mk/strings.xml
  • common/src/main/res/values-ms/strings.xml
  • common/src/main/res/values-nb/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-ro/strings.xml
  • common/src/main/res/values-ru/strings.xml
  • common/src/main/res/values-sk/strings.xml
  • common/src/main/res/values-sq/strings.xml
  • common/src/main/res/values-sr/strings.xml
  • common/src/main/res/values-sv/strings.xml
  • common/src/main/res/values-tr/strings.xml
  • common/src/main/res/values-uk/strings.xml
  • common/src/main/res/values-vi/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-bg/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-ca/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-cs/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-da/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-eo/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-es/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-et/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-fa/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-fi/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-hr/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-hu/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-mk/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-ms/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-nb/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-ro/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-sl/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-sq/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-sr/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-sv/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-uk/strings-explore-dash.xml
  • features/exploredash/src/main/res/values-vi/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
  • integrations/coinbase/src/main/res/values-bg/strings.xml
  • integrations/coinbase/src/main/res/values-ca/strings.xml
  • integrations/coinbase/src/main/res/values-cs/strings.xml
  • integrations/coinbase/src/main/res/values-da/strings.xml
  • integrations/coinbase/src/main/res/values-eo/strings.xml
  • integrations/coinbase/src/main/res/values-et/strings.xml
  • integrations/coinbase/src/main/res/values-fi/strings.xml
  • integrations/coinbase/src/main/res/values-hr/strings.xml
  • integrations/coinbase/src/main/res/values-hu/strings.xml
  • integrations/coinbase/src/main/res/values-id/strings.xml
  • integrations/coinbase/src/main/res/values-ko/strings.xml
  • integrations/coinbase/src/main/res/values-mk/strings.xml
  • integrations/coinbase/src/main/res/values-ms/strings.xml
  • integrations/coinbase/src/main/res/values-nb/strings.xml
  • integrations/coinbase/src/main/res/values-ro/strings.xml
  • integrations/coinbase/src/main/res/values-sl/strings.xml
  • integrations/coinbase/src/main/res/values-sq/strings.xml
  • integrations/coinbase/src/main/res/values-sr/strings.xml
  • integrations/coinbase/src/main/res/values-sv/strings.xml
  • integrations/coinbase/src/main/res/values-uk/strings.xml
  • integrations/coinbase/src/main/res/values-vi/strings.xml
  • integrations/crowdnode/src/main/java/org/dash/wallet/integrations/crowdnode/api/CrowdNodeApi.kt
  • integrations/crowdnode/src/main/java/org/dash/wallet/integrations/crowdnode/utils/CrowdNodeConfig.kt
  • integrations/crowdnode/src/main/res/values-cs/strings-crowdnode.xml
  • integrations/maya/src/main/res/values-ar/strings-maya.xml
  • integrations/maya/src/main/res/values-bg/strings-maya.xml
  • integrations/maya/src/main/res/values-cs/strings-maya.xml
  • 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-fa/strings-maya.xml
  • integrations/maya/src/main/res/values-fil/strings-maya.xml
  • integrations/maya/src/main/res/values-hu/strings-maya.xml
  • integrations/maya/src/main/res/values-id/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-pt/strings-maya.xml
  • integrations/maya/src/main/res/values-ro/strings-maya.xml
  • integrations/maya/src/main/res/values-sk/strings-maya.xml
  • integrations/maya/src/main/res/values-sq/strings-maya.xml
  • integrations/maya/src/main/res/values-sr/strings-maya.xml
  • integrations/maya/src/main/res/values-sv/strings-maya.xml
  • integrations/maya/src/main/res/values-th/strings-maya.xml
  • integrations/maya/src/main/res/values-tr/strings-maya.xml
  • integrations/maya/src/main/res/values-uk/strings-maya.xml
  • integrations/maya/src/main/res/values-vi/strings-maya.xml
  • integrations/maya/src/main/res/values-zh-rTW/strings-maya.xml
  • integrations/maya/src/main/res/values-zh/strings-maya.xml
  • integrations/uphold/src/main/res/values-ca/strings-uphold.xml
  • integrations/uphold/src/main/res/values-da/strings-uphold.xml
  • integrations/uphold/src/main/res/values-eo/strings-uphold.xml
  • integrations/uphold/src/main/res/values-et/strings-uphold.xml
  • integrations/uphold/src/main/res/values-fi/strings-uphold.xml
  • integrations/uphold/src/main/res/values-mk/strings-uphold.xml
  • integrations/uphold/src/main/res/values-ms/strings-uphold.xml
  • integrations/uphold/src/main/res/values-nb/strings-uphold.xml
  • integrations/uphold/src/main/res/values-sq/strings-uphold.xml
  • integrations/uphold/src/main/res/values-sr/strings-uphold.xml
  • integrations/uphold/src/main/res/values-sv/strings-uphold.xml
  • wallet/res/values-ar/strings-dashpay.xml
  • wallet/res/values-ar/strings-extra.xml
  • wallet/res/values-ar/strings.xml
  • wallet/res/values-bg/strings-dashpay.xml
  • wallet/res/values-bg/strings-extra.xml
  • wallet/res/values-bg/strings.xml
  • wallet/res/values-ca/strings-dashpay.xml
  • wallet/res/values-ca/strings-extra.xml
  • wallet/res/values-cs/strings-dashpay.xml
  • wallet/res/values-cs/strings-extra.xml
  • wallet/res/values-cs/strings.xml
  • wallet/res/values-da/strings-dashpay.xml
  • wallet/res/values-da/strings-extra.xml
  • wallet/res/values-de/strings-extra.xml
  • wallet/res/values-de/strings.xml
  • wallet/res/values-el/strings-extra.xml
  • wallet/res/values-el/strings.xml
  • wallet/res/values-eo/strings-dashpay.xml
  • wallet/res/values-eo/strings-extra.xml
  • wallet/res/values-eo/strings.xml
  • wallet/res/values-es/strings-extra.xml
  • wallet/res/values-es/strings.xml
  • wallet/res/values-et/strings-dashpay.xml
  • wallet/res/values-et/strings-extra.xml
  • wallet/res/values-et/strings.xml
  • wallet/res/values-fa/strings-extra.xml
  • wallet/res/values-fa/strings.xml
  • wallet/res/values-fi/strings-dashpay.xml
  • wallet/res/values-fi/strings-extra.xml
  • wallet/res/values-fil/strings-extra.xml
  • wallet/res/values-fil/strings.xml
  • wallet/res/values-fr/strings-extra.xml
  • wallet/res/values-fr/strings.xml
  • wallet/res/values-hr/strings-dashpay.xml
  • wallet/res/values-hr/strings-extra.xml
  • wallet/res/values-hr/strings.xml
  • wallet/res/values-hu/strings-dashpay.xml
  • wallet/res/values-hu/strings-extra.xml
  • wallet/res/values-id/strings-extra.xml
  • wallet/res/values-id/strings.xml
  • wallet/res/values-it/strings-extra.xml
  • wallet/res/values-it/strings.xml
  • wallet/res/values-ja/strings-extra.xml
  • wallet/res/values-ja/strings.xml
  • wallet/res/values-ko/strings-extra.xml
  • wallet/res/values-ko/strings.xml
  • wallet/res/values-mk/strings-dashpay.xml
  • wallet/res/values-mk/strings-extra.xml
  • wallet/res/values-mk/strings.xml
  • wallet/res/values-ms/strings-dashpay.xml
  • wallet/res/values-ms/strings-extra.xml
  • wallet/res/values-ms/strings.xml
  • wallet/res/values-nb/strings-dashpay.xml
  • wallet/res/values-nb/strings-extra.xml
  • wallet/res/values-nl/strings-extra.xml
  • wallet/res/values-nl/strings.xml
  • wallet/res/values-pl/strings-extra.xml
  • wallet/res/values-pl/strings.xml
  • wallet/res/values-pt/strings-extra.xml
  • wallet/res/values-pt/strings.xml
  • wallet/res/values-ro/strings-dashpay.xml
  • wallet/res/values-ro/strings-extra.xml
  • wallet/res/values-ru/strings-extra.xml
  • wallet/res/values-ru/strings.xml
  • wallet/res/values-sk/strings-extra.xml
  • wallet/res/values-sk/strings.xml
  • wallet/res/values-sl/strings-extra.xml
  • wallet/res/values-sl/strings.xml
  • wallet/res/values-sq/strings-dashpay.xml
  • wallet/res/values-sq/strings-extra.xml
  • wallet/res/values-sr/strings-dashpay.xml
  • wallet/res/values-sr/strings-extra.xml
  • wallet/res/values-sv/strings-dashpay.xml
  • wallet/res/values-sv/strings-extra.xml
  • wallet/res/values-sv/strings.xml
  • wallet/res/values-th/strings-dashpay.xml
  • wallet/res/values-th/strings-extra.xml
  • wallet/res/values-th/strings.xml
  • wallet/res/values-tr/strings-extra.xml
  • wallet/res/values-tr/strings.xml
  • wallet/res/values-uk/strings-extra.xml
  • wallet/res/values-uk/strings.xml
  • wallet/res/values-vi/strings-dashpay.xml
  • wallet/res/values-vi/strings-extra.xml
  • wallet/res/values-vi/strings.xml
  • wallet/res/values-zh-rTW/strings-extra.xml
  • wallet/res/values-zh-rTW/strings.xml
  • wallet/res/values-zh/strings-extra.xml
  • wallet/res/values-zh/strings.xml
  • wallet/src/de/schildbach/wallet/service/BlockchainServiceImpl.kt

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds deterministic merchant fallback icons across Compose and bitmap UI paths, restores transaction-cache merchant icon bitmaps with a new persisted icon id and migration, and updates several unrelated flows for location lookup, transition handling, dispatcher usage, restart behavior, and tests.

Changes

Merchant fallback icon feature and cache restoration

Layer / File(s) Summary
Core merchant icon component
common/src/main/java/org/dash/wallet/common/ui/components/MerchantInitialIcon.kt
Adds Compose icon composables, deterministic color and name helpers, bitmap rendering for non-Compose contexts, and a preview.
Shared merchant logo wrapper
features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/explore/MerchantLogo.kt
Adds a wrapper that picks bitmap, URL, or generated fallback content.
Merchant header rendering in dialogs
features/exploredash/.../GiftCardDetailsDialog.kt, .../GiftCardOrderDetailsDialog.kt, .../PurchaseGiftCardConfirmDialog.kt, .../ItemDetails.kt
Switches merchant headers to MerchantLogo and adds network-availability state to the purchase confirm flow.
Fallback icons in lists and maps
features/exploredash/.../MerchantsAtmsResultAdapter.kt, features/exploredash/src/main/res/layout/merchant_row.xml, features/exploredash/.../ExploreMapFragment.kt
Adds Compose fallback icons in merchant rows and generates merchant-name marker bitmaps for map fallback rendering.
Transaction result fallback icon
wallet/src/de/schildbach/wallet/ui/transactions/TransactionResultViewBinder.kt, wallet/src/de/schildbach/wallet/ui/transactions/TransactionDetailsDialogFragment.kt, wallet/res/layout/transaction_result_content.xml
Adds a hidden ComposeView-backed fallback icon and wires merchant names into transaction result rendering.
Transaction cache bitmap resolution
wallet/src/de/schildbach/wallet/database/entity/TxDisplayCacheEntry.kt, wallet/src/de/schildbach/wallet/service/TxDisplayCacheService.kt
Persists customIconId, resolves bitmaps for live and cold-start cache paths, and invalidates paging on bitmap-only metadata updates.
Room schema bump and migration
wallet/src/de/schildbach/wallet/database/AppDatabase.kt, wallet/src/de/schildbach/wallet/database/AppDatabaseMigrations.kt, wallet/src/de/schildbach/wallet/di/DatabaseModule.kt, wallet/schemas/de.schildbach.wallet.database.AppDatabase/20.json, wallet/androidTest/de/schildbach/wallet/database/DatabaseMigrationTest.kt, docs/proposals/restore-gift-card-icons-in-tx-cache.md
Bumps the database to v20, adds the customIconId migration, registers it, updates schema JSON and migration tests, and adds proposal documentation.

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

Location lookup coroutine refactor

Layer / File(s) Summary
Coroutine-based country lookup
features/exploredash/src/main/java/org/dash/wallet/features/exploredash/services/UserLocationState.kt
Replaces callback-based coroutine resumption with Dispatchers.IO, await(), and synchronous geocoding.

SearchFragment transition lifecycle fix

Layer / File(s) Summary
Guarded transition animations
features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/explore/SearchFragment.kt
Tracks the active transition animator, cancels it on destroy, and guards transition callbacks before touching bindings.

TopperClient IO dispatching

Layer / File(s) Summary
Move HTTP calls to IO dispatcher
integrations/uphold/src/main/java/org/dash/wallet/integrations/uphold/api/TopperClient.kt
Wraps both refresh methods in withContext(Dispatchers.IO).

Miscellaneous stability fixes

Layer / File(s) Summary
RegTestParams pre-warm
wallet/src/de/schildbach/wallet/WalletApplication.java
Pre-warms RegTestParams during startup with warning logging on failure.
Non-activity restart overload
wallet/src/de/schildbach/wallet/service/AppRestartService.kt, wallet/src/de/schildbach/wallet/ui/ResetWalletDialog.kt
Adds a Context-based restart overload and switches the reset flow to use the application context.
Dependency cleanup and test updates
wallet/src/de/schildbach/wallet/ui/TransactionResultViewModel.kt, wallet/androidTest/de/schildbach/wallet/security/SecurityGuardMultiThreadingTest.kt, wallet/test/de/schildbach/wallet/service/WalletTransactionMetadataProviderGiftCardTest.kt
Removes an unused dependency and updates test scaffolding for the new signatures.

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TxDisplayCacheService
  participant TxDisplayCacheEntry
  participant MetadataProvider
  participant TransactionRowView
  TxDisplayCacheService->>TxDisplayCacheService: iconBitmapForEntry(metadata)
  TxDisplayCacheService->>MetadataProvider: iconBitmapForEntryCold(customIconId)
  MetadataProvider-->>TxDisplayCacheService: bitmap
  TxDisplayCacheService->>TxDisplayCacheEntry: toTransactionRowView(iconBitmap)
  TxDisplayCacheEntry-->>TransactionRowView: row with iconBitmap
Loading

Possibly related PRs

Suggested reviewers: abaranouski

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the PR’s main themes: fixing missing merchant icons plus stability issues like crashes and ANRs.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/crashes-anrs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

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

⚠️ Outside diff range comments (4)
features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/explore/SearchFragment.kt (1)

662-708: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Guard covers only doOnEnd, not the function entry that also touches binding.

transitToDetails, transitToSearchResults, and transitToAllMerchantLocations all dereference binding.* immediately at the top of the function (e.g. Line 666 BottomSheetBehavior.from(binding.contentPanel), Line 711-713, Line 748-749), well before startTransitionAnimator()/isViewBindingReady are ever reached. These functions are invoked from setupScreenTransitions() via lifecycleScope.launch { ... delay(100) ... transitToDetails() } — note this uses the fragment-scoped lifecycleScope, not viewLifecycleOwner.lifecycleScope, so the coroutine is not automatically cancelled when the view is destroyed. If the view is torn down during the delay(100) window (e.g. rapid navigation), the resumed coroutine will crash on the very first binding access, before the new isViewBindingReady guard ever has a chance to run — leaving the exact "animation vs. fragment destruction" crash class this PR aims to fix only partially addressed.

Consider either switching the caller to viewLifecycleOwner.lifecycleScope.launch in setupScreenTransitions(), or adding an early guard (if (!isViewBindingReady) return) at the top of each transit function.

🛡️ Proposed fix (guard function entry)
     private fun transitToDetails() {
+        if (!isViewBindingReady) return
         val item = viewModel.selectedItem.value ?: return

Also applies to: 710-745, 747-792

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

In
`@features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/explore/SearchFragment.kt`
around lines 662 - 708, The view-binding guard is only applied inside the
animation ավարտ callback, but transitToDetails, transitToSearchResults, and
transitToAllMerchantLocations still touch binding immediately at function entry.
Add an early isViewBindingReady check at the top of each transit function before
any binding access, or move the caller in setupScreenTransitions to
viewLifecycleOwner.lifecycleScope so the coroutine is cancelled with the view.
Use the existing transitToDetails, transitToSearchResults,
transitToAllMerchantLocations, and setupScreenTransitions symbols to place the
fix.
wallet/test/de/schildbach/wallet/service/WalletTransactionMetadataProviderGiftCardTest.kt (1)

235-266: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

order expectation looks like a copy/paste mistake.

incoming.note is null and existing.note = "order-9"; per the merge logic (falls back to existing when incoming is null, same as merchantUrl), the value passed for order should be the merged/preserved "order-9", not the unrelated literal "1234". As written, this assertion doesn't reflect the actual merge semantics for order and will either fail or (if the underlying provider code doesn't merge order before passing it) is silently testing the wrong thing.

🐛 Proposed fix
             coVerify {
                 cacheDao.insertGiftCardData(
                     txId = txId,
                     giftCardNumber = "N",
                     giftCardPin = "P",
                     merchantName = "Acme",
                     originalPrice = 25.0,
                     merchantUrl = "https://kept",
-                    order = "1234",
+                    order = "order-9",
                     index = 0,
                     giftCardChallenge = null,
                     cacheTimestamp = any()
                 )
             }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@wallet/test/de/schildbach/wallet/service/WalletTransactionMetadataProviderGiftCardTest.kt`
around lines 235 - 266, The test in
WalletTransactionMetadataProviderGiftCardTest is asserting the wrong value for
order, likely from a copy/paste error. Update the coVerify for
updateGiftCardMetadata so the expected order matches the merged value preserved
from existing.note when incoming.note is null, just like merchantUrl is asserted
from the merged state. Keep the rest of the cacheDao.insertGiftCardData
verification aligned with the merge semantics used by
provider.updateGiftCardMetadata and the GiftCard merge flow.
features/exploredash/src/main/res/layout/merchant_row.xml (1)

49-61: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

ellipsize="end" has no effect without maxLines="1".

With layout_height="wrap_content" and no line limit, this TextView wraps instead of truncating — ellipsis only kicks in when a line count is enforced.

🩹 Proposed fix
         android:layout_marginEnd="3dp"
         android:ellipsize="end"
+        android:maxLines="1"
         app:layout_constraintStart_toEndOf="`@id/logo_img`"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@features/exploredash/src/main/res/layout/merchant_row.xml` around lines 49 -
61, The title TextView in merchant_row.xml is missing a line limit, so ellipsize
won’t truncate as intended. Update the title view in the merchant row layout to
enforce a single line by adding the appropriate max line setting alongside the
existing ellipsize attribute, keeping the current constraints and width behavior
intact.
wallet/androidTest/de/schildbach/wallet/database/DatabaseMigrationTest.kt (1)

62-71: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Missing migration19to20 breaks migrate11AndUp().

AppDatabase now targets version 20 and migration19to20 was added and registered in DatabaseModule, but this test's migrations array still stops at migration18to19. migrate11AndUp() builds the db from version 11 (not covered by fallbackToDestructiveMigrationFrom(1..10)) and accesses DAOs, requiring Room to resolve a migration path all the way to 20 — which will fail with a missing-migration error since 19→20 isn't in the list.

🛠️ Proposed fix
 private val migrations = arrayOf(
     AppDatabaseMigrations.migration11To12,
     AppDatabaseMigrations.migration12To13,
     AppDatabaseMigrations.migration13to14,
     AppDatabaseMigrations.migration14to15,
     AppDatabaseMigrations.migration15to16,
     AppDatabaseMigrations.migration16to17,
     AppDatabaseMigrations.migration17to18,
-    AppDatabaseMigrations.migration18to19
+    AppDatabaseMigrations.migration18to19,
+    AppDatabaseMigrations.migration19to20
 )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wallet/androidTest/de/schildbach/wallet/database/DatabaseMigrationTest.kt`
around lines 62 - 71, The `migrations` array in `DatabaseMigrationTest` is
missing `AppDatabaseMigrations.migration19to20`, which causes `migrate11AndUp()`
to fail when Room needs a full path from version 11 to the current `AppDatabase`
version. Update the test’s `migrations` list to include `migration19to20`
alongside the existing `migration18to19` entry so the migration chain matches
the production setup in `DatabaseModule`.
🧹 Nitpick comments (4)
wallet/src/de/schildbach/wallet/service/AppRestartService.kt (1)

64-74: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider extracting shared intent-building logic.

All three performRestart overloads (Lines 49-55, 57-63, 65-74) now build the same OnboardingActivity intent and apply nearly identical logic, just differing in how the task/backstack is cleared (finishAffinity() vs. intent flags). A small private helper to construct the base intent (and maybe accept an optional "clear" strategy lambda) would reduce duplication across the three implementations.

♻️ Example consolidation
 class AppRestartService `@Inject` constructor() : RestartService {
     companion object {
         private val log: Logger = LoggerFactory.getLogger(AppRestartService::class.java)
     }

+    private fun buildOnboardingIntent(context: Context, upgrade: Boolean, extraFlags: Int = 0) =
+        OnboardingActivity.createIntent(context, upgrade).apply {
+            if (extraFlags != 0) addFlags(extraFlags)
+        }
+
     override fun performRestart(activity: Activity, finishAffinity: Boolean, upgrade: Boolean) {
         log.info("perform restart on ${activity.javaClass.simpleName}: $finishAffinity")
-        activity.startActivity(OnboardingActivity.createIntent(activity, upgrade))
+        activity.startActivity(buildOnboardingIntent(activity, upgrade))
         if (finishAffinity) {
             activity.finishAffinity()
         }
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wallet/src/de/schildbach/wallet/service/AppRestartService.kt` around lines 64
- 74, The three performRestart overloads duplicate the same OnboardingActivity
intent setup and only differ in how the task is cleared. Refactor the shared
intent-building logic in AppRestartService, ideally by extracting a private
helper used by performRestart and the other overloads, so the base intent
creation and common flags live in one place while the clear-task behavior is
supplied via a small strategy or lambda.
common/src/main/java/org/dash/wallet/common/ui/components/MerchantInitialIcon.kt (1)

201-239: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Consider caching generated bitmaps for repeat merchant names.

merchantNameBitmap re-renders (font lookup, text-fit loop, canvas draw) on every call with no memoization. TxDisplayCacheService already caches generated icons per merchant name (generatedMerchantIcons); a similar cache here would avoid redundant work for callers that invoke this repeatedly for the same merchant (e.g. map markers reloading on pan/zoom, see ExploreMapFragment.kt).

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

In
`@common/src/main/java/org/dash/wallet/common/ui/components/MerchantInitialIcon.kt`
around lines 201 - 239, merchantNameBitmap currently rebuilds the same avatar
bitmap every time, which repeats font lookup, sizing, and drawing work for
identical merchant names. Add memoization inside merchantNameBitmap or at the
caller so repeated requests for the same normalized name and sizePx reuse the
existing Bitmap instead of regenerating it. Follow the caching pattern already
used by TxDisplayCacheService.generatedMerchantIcons and keep the cache keyed by
the same inputs that affect rendering.
features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/explore/ExploreMapFragment.kt (1)

425-441: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Merchant fallback bitmap regenerated on every marker error, unbounded by caching.

Each failed logo load for a Merchant re-runs the full text-fit/canvas render in merchantNameBitmap with no reuse across markers sharing the same merchant name. See the note on merchantNameBitmap in common/.../MerchantInitialIcon.kt about adding a cache similar to TxDisplayCacheService.generatedMerchantIcons; that fix would benefit this call site too.

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

In
`@features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/explore/ExploreMapFragment.kt`
around lines 425 - 441, The Merchant fallback bitmap is being regenerated every
time a marker fails to load a logo, so repeated markers with the same merchant
name keep rerendering in ExploreMapFragment’s marker creation path. Update the
call site around addMarkerItemToMap to use a shared cache for merchantNameBitmap
results, keyed by merchant name and size, similar to the caching approach
referenced in MerchantInitialIcon and
TxDisplayCacheService.generatedMerchantIcons, so existing bitmaps are reused
instead of recreated.
wallet/src/de/schildbach/wallet/service/TxDisplayCacheService.kt (1)

274-282: 🚀 Performance & Scalability | 🔵 Trivial | ⚖️ Poor tradeoff

Frequent full PagingSource invalidation on every no-op metadata emission.

When changedIds is empty (documented as covering late-arriving icon bitmaps), the code unconditionally invalidates _currentPagingSource, forcing Paging to rebuild the list. If observePresentableMetadata() emits with any frequency where nothing meaningfully changed (not just icon-bitmap-only updates), this could cause repeated list rebuilds/scroll resets. Consider tracking whether any bitmap actually changed (vs. simply "no changedIds") before invalidating, to limit invalidation to genuine icon-bitmap arrivals.

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

In `@wallet/src/de/schildbach/wallet/service/TxDisplayCacheService.kt` around
lines 274 - 282, The no-op metadata path in TxDisplayCacheService.kt currently
invalidates _currentPagingSource whenever changedIds is empty, which can trigger
unnecessary PagingSource rebuilds. Update the Presentable metadata handling
around observePresentableMetadata() so invalidation only happens when a
late-arriving merchant logo bitmap actually changed, not for any empty
changedIds emission. Use the existing changedIds/_currentPagingSource flow to
add a bitmap-change check before calling invalidate(), keeping the cache refresh
behavior limited to genuine icon updates.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@features/exploredash/src/main/java/org/dash/wallet/features/exploredash/services/UserLocationState.kt`:
- Around line 196-208: The getCountryCodeFromLocation() suspend function in
UserLocationState is catching every Exception and accidentally swallowing
coroutine cancellation from client.lastLocation.await(). Update the try/catch so
CancellationException is rethrown before the generic handler, and keep the
existing fallback logging/empty-string behavior only for non-cancellation
failures. Add the kotlinx.coroutines.CancellationException import and preserve
the current withContext(Dispatchers.IO) and log.info handling.

In
`@features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/adapters/MerchantsAtmsResultAdapter.kt`:
- Around line 142-177: The logo loading branch in MerchantsAtmsResultAdapter.kt
still dereferences a nullable merchant via merchant.logoLocation after only
checking merchant?.logoLocation.isNullOrBlank(), so capture
merchant?.logoLocation in a local val and use that value for the null/blank
check and the load(...) call. Update the logic around the MerchantNameIcon /
logoImg / logoCompose handling to rely on the local logoLocation variable
instead of re-reading from merchant.

In `@wallet/src/de/schildbach/wallet/service/TxDisplayCacheService.kt`:
- Around line 1012-1026: `iconBitmapForEntryCold` returns too early when
`entry.customIconId` is null, so it never reaches `iconBitmapForEntry`’s
generated fallback for logo-less gift cards. Update `iconBitmapForEntryCold` to
first call `iconBitmapForEntry(entry)` and only fall back to
`metadataProvider.getIcon(...)` when that returns null, keeping the
`customIconId` null case eligible for generated icons. Use the existing
`iconBitmapForEntry` and `metadataProvider.getIcon` flow in
`TxDisplayCacheService` to preserve the cold-start fallback behavior.

In
`@wallet/src/de/schildbach/wallet/ui/transactions/TransactionResultViewBinder.kt`:
- Around line 304-335: The generated-icon path in
TransactionResultViewBinder.updateIcon() can be overwritten by a stale delayed
reveal from the checkIcon animation branch. Track the pending postDelayed
Runnable (or a generation/token for the current icon state) and cancel/ignore it
before applying a new icon branch, especially when useGeneratedIcon is selected,
so a late callback cannot force checkIcon visible over the MerchantNameIcon.

In
`@wallet/test/de/schildbach/wallet/service/WalletTransactionMetadataProviderGiftCardTest.kt`:
- Around line 281-283: The `coVerify(exactly = 0)` check is too weak because
`insertGiftCardData` has a `cacheTimestamp` parameter that is being omitted, so
the verification only matches one default timestamp value. Update the
verification in `WalletTransactionMetadataProviderGiftCardTest` to include all
parameters of `cacheDao.insertGiftCardData`, especially `cacheTimestamp`, using
an appropriate matcher so the assertion truly verifies that no cache write
occurred regardless of timestamp.

---

Outside diff comments:
In
`@features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/explore/SearchFragment.kt`:
- Around line 662-708: The view-binding guard is only applied inside the
animation ավարտ callback, but transitToDetails, transitToSearchResults, and
transitToAllMerchantLocations still touch binding immediately at function entry.
Add an early isViewBindingReady check at the top of each transit function before
any binding access, or move the caller in setupScreenTransitions to
viewLifecycleOwner.lifecycleScope so the coroutine is cancelled with the view.
Use the existing transitToDetails, transitToSearchResults,
transitToAllMerchantLocations, and setupScreenTransitions symbols to place the
fix.

In `@features/exploredash/src/main/res/layout/merchant_row.xml`:
- Around line 49-61: The title TextView in merchant_row.xml is missing a line
limit, so ellipsize won’t truncate as intended. Update the title view in the
merchant row layout to enforce a single line by adding the appropriate max line
setting alongside the existing ellipsize attribute, keeping the current
constraints and width behavior intact.

In `@wallet/androidTest/de/schildbach/wallet/database/DatabaseMigrationTest.kt`:
- Around line 62-71: The `migrations` array in `DatabaseMigrationTest` is
missing `AppDatabaseMigrations.migration19to20`, which causes `migrate11AndUp()`
to fail when Room needs a full path from version 11 to the current `AppDatabase`
version. Update the test’s `migrations` list to include `migration19to20`
alongside the existing `migration18to19` entry so the migration chain matches
the production setup in `DatabaseModule`.

In
`@wallet/test/de/schildbach/wallet/service/WalletTransactionMetadataProviderGiftCardTest.kt`:
- Around line 235-266: The test in WalletTransactionMetadataProviderGiftCardTest
is asserting the wrong value for order, likely from a copy/paste error. Update
the coVerify for updateGiftCardMetadata so the expected order matches the merged
value preserved from existing.note when incoming.note is null, just like
merchantUrl is asserted from the merged state. Keep the rest of the
cacheDao.insertGiftCardData verification aligned with the merge semantics used
by provider.updateGiftCardMetadata and the GiftCard merge flow.

---

Nitpick comments:
In
`@common/src/main/java/org/dash/wallet/common/ui/components/MerchantInitialIcon.kt`:
- Around line 201-239: merchantNameBitmap currently rebuilds the same avatar
bitmap every time, which repeats font lookup, sizing, and drawing work for
identical merchant names. Add memoization inside merchantNameBitmap or at the
caller so repeated requests for the same normalized name and sizePx reuse the
existing Bitmap instead of regenerating it. Follow the caching pattern already
used by TxDisplayCacheService.generatedMerchantIcons and keep the cache keyed by
the same inputs that affect rendering.

In
`@features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/explore/ExploreMapFragment.kt`:
- Around line 425-441: The Merchant fallback bitmap is being regenerated every
time a marker fails to load a logo, so repeated markers with the same merchant
name keep rerendering in ExploreMapFragment’s marker creation path. Update the
call site around addMarkerItemToMap to use a shared cache for merchantNameBitmap
results, keyed by merchant name and size, similar to the caching approach
referenced in MerchantInitialIcon and
TxDisplayCacheService.generatedMerchantIcons, so existing bitmaps are reused
instead of recreated.

In `@wallet/src/de/schildbach/wallet/service/AppRestartService.kt`:
- Around line 64-74: The three performRestart overloads duplicate the same
OnboardingActivity intent setup and only differ in how the task is cleared.
Refactor the shared intent-building logic in AppRestartService, ideally by
extracting a private helper used by performRestart and the other overloads, so
the base intent creation and common flags live in one place while the clear-task
behavior is supplied via a small strategy or lambda.

In `@wallet/src/de/schildbach/wallet/service/TxDisplayCacheService.kt`:
- Around line 274-282: The no-op metadata path in TxDisplayCacheService.kt
currently invalidates _currentPagingSource whenever changedIds is empty, which
can trigger unnecessary PagingSource rebuilds. Update the Presentable metadata
handling around observePresentableMetadata() so invalidation only happens when a
late-arriving merchant logo bitmap actually changed, not for any empty
changedIds emission. Use the existing changedIds/_currentPagingSource flow to
add a bitmap-change check before calling invalidate(), keeping the cache refresh
behavior limited to genuine icon updates.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 935bc801-d7fd-4ef4-ae2d-050f2a33a81d

📥 Commits

Reviewing files that changed from the base of the PR and between 62e5962 and 1eeb5cb.

📒 Files selected for processing (29)
  • common/src/main/java/org/dash/wallet/common/ui/components/MerchantInitialIcon.kt
  • docs/proposals/restore-gift-card-icons-in-tx-cache.md
  • features/exploredash/src/main/java/org/dash/wallet/features/exploredash/services/UserLocationState.kt
  • features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/adapters/MerchantsAtmsResultAdapter.kt
  • features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/dashspend/dialogs/GiftCardDetailsDialog.kt
  • features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/dashspend/dialogs/GiftCardOrderDetailsDialog.kt
  • features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/dashspend/dialogs/PurchaseGiftCardConfirmDialog.kt
  • features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/explore/ExploreMapFragment.kt
  • features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/explore/ItemDetails.kt
  • features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/explore/MerchantLogo.kt
  • features/exploredash/src/main/java/org/dash/wallet/features/exploredash/ui/explore/SearchFragment.kt
  • features/exploredash/src/main/res/layout/merchant_row.xml
  • integrations/uphold/src/main/java/org/dash/wallet/integrations/uphold/api/TopperClient.kt
  • wallet/androidTest/de/schildbach/wallet/database/DatabaseMigrationTest.kt
  • wallet/androidTest/de/schildbach/wallet/security/SecurityGuardMultiThreadingTest.kt
  • wallet/res/layout/transaction_result_content.xml
  • wallet/schemas/de.schildbach.wallet.database.AppDatabase/20.json
  • wallet/src/de/schildbach/wallet/WalletApplication.java
  • wallet/src/de/schildbach/wallet/database/AppDatabase.kt
  • wallet/src/de/schildbach/wallet/database/AppDatabaseMigrations.kt
  • wallet/src/de/schildbach/wallet/database/entity/TxDisplayCacheEntry.kt
  • wallet/src/de/schildbach/wallet/di/DatabaseModule.kt
  • wallet/src/de/schildbach/wallet/service/AppRestartService.kt
  • wallet/src/de/schildbach/wallet/service/TxDisplayCacheService.kt
  • wallet/src/de/schildbach/wallet/ui/ResetWalletDialog.kt
  • wallet/src/de/schildbach/wallet/ui/TransactionResultViewModel.kt
  • wallet/src/de/schildbach/wallet/ui/transactions/TransactionDetailsDialogFragment.kt
  • wallet/src/de/schildbach/wallet/ui/transactions/TransactionResultViewBinder.kt
  • wallet/test/de/schildbach/wallet/service/WalletTransactionMetadataProviderGiftCardTest.kt
💤 Files with no reviewable changes (1)
  • wallet/src/de/schildbach/wallet/ui/TransactionResultViewModel.kt

@HashEngineering
HashEngineering merged commit 538396e into master Jul 9, 2026
2 checks passed
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