Files
Andrey Bocharnikov 3b141e54ad feat(wallet/leaderboard): fetch the market tab in the user's display currency
The leaderboard endpoints were always fetched without a currency, so the
Market tab showed USD values labelled with whatever currency the user had
selected (status-app#21273). Send convert_currency so the proxy serves the
values in that currency.

The currency comes from the settings DB, seeded at start and followed
through the accounts publisher; the currency a client passes to
FetchMarketTokenPageAsync keeps working as before. Cached values, ETags and
the persisted snapshot all belong to the currency they were fetched in, so a
change drops them and triggers the refresh loops, which push the replacement
data to the client over the same path as any other refresh. With no client
listening the cache is simply left invalidated for the next page request.

Because fetching and storing are not one atomic step, a response carries the
currency it was requested in and is dropped if that no longer matches - a
request in flight across a currency change would otherwise label one
currency's values as another's and refresh the timestamp that decides
whether anything needs fetching.

If the proxy rejects the currency with a 400 the request is retried once
without the conversion, so the tab falls back to USD values rather than
staying empty, and that currency is not asked for again.

Rows persisted before the migration are USD, which is what the proxy served
when no conversion was requested.
2026-08-26 22:42:57 +04:00
..