Skip to content

Release: develop -> main#3831

Merged
TaprootFreak merged 4 commits into
mainfrom
develop
Jun 8, 2026
Merged

Release: develop -> main#3831
TaprootFreak merged 4 commits into
mainfrom
develop

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Automatic Release PR

This PR was automatically created after changes were pushed to develop.

Commits: 1 new commit(s)

Checklist

  • Review all changes
  • Verify CI passes
  • Approve and merge when ready for production

TaprootFreak and others added 2 commits June 8, 2026 10:09
…uy/sell quote (#3825)

* feat(realunit): surface price-source (Aktionariat) outage as 503 on buy/sell quote

When the external RealUnit price provider (Aktionariat) is down, the buy and
sell payment-info endpoints used to leak a generic 500, so clients could not
tell the failure apart from any other error. Wrap the price-dependent quote
calls in getPaymentInfo/getSellPaymentInfo: on failure, if the live price is
currently unavailable, throw a 503 PriceSourceUnavailableException with code
PRICE_SOURCE_UNAVAILABLE so the apps can show an explicit "price provider
unavailable" message; otherwise the original error is rethrown unchanged.

The /v1/realunit/price endpoints are unchanged (still 200 + null) so the price
chart keeps rendering history during the outage.

* fix(realunit): detect price-source outage via PriceInvalidException instead of re-querying price

The previous guard called getRealUnitPrice() after a failure and checked
chf == null to detect an Aktionariat outage. This was unreliable: the
secondary call uses PriceValidity.ANY and may return a stale cached price
with chf != null even when the source is down, causing the guard to miss
the outage window and fall back to a generic 500.

PricingService.getAssetPrice always throws PriceInvalidException on any
pricing failure, so checking instanceof PriceInvalidException is a direct,
synchronous signal with no second network call and no cache timing issue.
Non-price errors (KYC, validation, IBAN) are unaffected.

* style: fix prettier formatting in realunit.service.spec.ts

---------

Co-authored-by: David May <david.leo.may@gmail.com>
…down (#3829)

* fix(realunit): use last known price when Aktionariat price source is down

The buy/sell quote depends on the live RealUnit price provider (Aktionariat).
When that source is unavailable, the price lookup throws, so the quote and the
payment-info endpoints fail and the app becomes unusable.

Let the RealUnit pricing provider fall back to the last persisted price
(Asset.approxPriceChf/Eur, refreshed hourly and surviving restarts) when the
live fetch fails. The fallback price is flagged invalid so strict consumers
(exact quotes, the price snapshot job) keep rejecting the stale value, while
estimates (non-exact quotes, min volume, fees) keep working during an outage.

* fix(pricing): do not persist an invalid price as a rule's current price

Guard doUpdatePriceFor so a price flagged invalid is never written to
PriceRule.currentPrice. This keeps the RealUnit last-known-price fallback from
leaking into VALID_ONLY consumers: estimates (ANY) still use the last price,
while the snapshot job and exact lookups keep skipping the stale value instead
of recording it as current.
…mpty (#3830)

The price fetch crashed with a cryptic "Cannot read properties of
undefined (reading 'priceInCHF')" when the Aktionariat getPrice endpoint
returned an empty/invalid body. Validate the response after the cache
(AsyncCache swallows callback errors with fallbackToCache) and throw an
explicit, source-attributing error instead.
…p crash (#3832)

PricingRealUnitService read Config.environment in a class field initializer.
Because of a circular import, Config is undefined at construction time, so
NestJS DI threw "Cannot read properties of undefined (reading 'environment')"
and the whole API failed to bootstrap (crash loop, all health checks down).

Convert the field into a lazy getter so Config is read at runtime, after the
module graph is fully initialized.
@TaprootFreak TaprootFreak merged commit e34d200 into main Jun 8, 2026
12 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.

1 participant