Skip to content

Conversation

@peachbits
Copy link
Contributor

@peachbits peachbits commented Nov 3, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Note

Parallelizes v3/rates requests and rebuilds asset pair caches from returned results; exports createRateKey and minor util cleanups.

  • Exchange Rates:
    • Parallelize v3/rates POST requests with Promise.allSettled and aggregate results into rates.
    • Build asset pair caches (cryptoPairs/fiatPairs) from actual responses using createRateKey, replacing prior map-based cache population.
    • Persist updated in-memory cache and write to disk.
  • Utilities:
    • Export createRateKey from src/util/exchangeRates.ts and add minor type/condition tweaks.

Written by Cursor Bugbot for commit e869a1a. This will update automatically on new commits. Configure here.


With the cache, and periodic looping, this isn't really necessary and can actually slow down rate updates
Assets that cannot have not found a rate, like obscure or invalid tokens, shouldn't slow down the initial lookup on login. Also, we were previously storing pairs in the cache along with dates which meant historical rates were being queried as well.

Fix eslint error in exchangeRates.ts
cryptoPairs: Array.from(cryptoPairMap.values()),
fiatPairs: Array.from(fiatPairMap.values())
cryptoPairs: Array.from(cryptoPairCache.values()),
fiatPairs: Array.from(fiatPairCache.values())
Copy link

Choose a reason for hiding this comment

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

Bug: Cache clears failed rate pairs, causing missing data

The exchange rate cache now only persists asset pairs that successfully returned rate data, rather than all initially requested pairs. If a rate fetch fails, the asset pair is removed from the cache and won't be tracked or re-requested until its associated wallet is active again, potentially causing missing exchange rates.

Fix in Cursor Fix in Web

Copy link
Contributor

@swansontec swansontec left a comment

Choose a reason for hiding this comment

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

It seems like this would be better, but as Cursor points out, we do run the risk of losing rates that we fail to fetch. It might make sense to pre-populate these two sets with the existing data, which would turn this into an update rather than a stomp.

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.

3 participants