maybe
maybe copied to clipboard
When exchange rates are not available, foreign currency account rollups should show a warning UI + message
Describe the bug The balance sums shown next to the collapsible account groups in the sidebar don't include accounts in foreign currencies, if today's exchange rates for those currencies are missing in the database.
To Reproduce Steps to reproduce the behavior:
- Create a new account in a foreign (= different from your base) currency (one that you haven't used before) with a non-zero balance
- Observe that in the sidebar, the balance of the new account isn't included in the sum for that account type group
Expected behavior
Account group balances in the sidebar should take foreign currencies into account. In the screenshot below, the number next to Other Liability
should be roughly $1020.00
(200 SEK ~ 20 USD)
Screenshots / Recordings
Additional context The issue is caused by a missing exchange rate when this check is performed: https://github.com/maybe-finance/maybe/blob/79789bd69630ad29d65b53f138da2ab6abaf69e4/lib/money.rb#L31
Perhaps we should sync the account right after it's created? Or at the very least call account.sync_exchange_rates
. We'll also need to fetch exchange rates periodically or upon login, otherwise the bug reappears the next day.