feat(buy/sell): explicit price provider (Aktionariat) message on outage#699
Open
TaprootFreak wants to merge 4 commits into
Open
feat(buy/sell): explicit price provider (Aktionariat) message on outage#699TaprootFreak wants to merge 4 commits into
TaprootFreak wants to merge 4 commits into
Conversation
… outage When the buy/sell quote fails because the external price provider (Aktionariat) is unavailable, the API now returns 503 / code PRICE_SOURCE_UNAVAILABLE. Map that to a new PaymentInfoError.priceSourceUnavailable in both the buy and sell payment-info cubits (matched on statusCode == 503 OR the code, kept below the KYC/Registration clauses which are ApiException subclasses) and render an explicit message that attributes the problem to Aktionariat — instead of the generic "contact support" failure. Buy shows it inline; sell shows it as a snackbar. Adds priceProviderUnavailableTitle/Description strings (de + en), cubit tests for the 503 mapping, and a buy golden for the new state.
The regenerate run also rewrote home_page_loaded.png with an unrelated sub-pixel diff; revert it to the staging baseline so this PR adds only the new buy_price_source_unavailable golden.
Adding priceSourceUnavailable makes the enum six variants; update the contract test accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When buying/selling RealUnit while the external price provider (Aktionariat) is down, the app showed a generic "An error occurred … contact support" message. That wrongly implies the problem is with RealUnit or the app, when it is the external price provider.
Change
Pairs with API PR DFXswiss/api#3825, which now returns
503/code: PRICE_SOURCE_UNAVAILABLEfor the buy/sell quote during a price-source outage.PaymentInfoError.priceSourceUnavailable.buy_payment_info_cubit.dart) and sell (sell_payment_info_cubit.dart): add anon ApiExceptionclause — matched onstatusCode == 503orcode == 'PRICE_SOURCE_UNAVAILABLE'— kept below the KYC/Registration clauses (those areApiExceptionsubclasses). Matching on both makes it defensive even before the API ships.payment_information.dart), sell shows it as a snackbar (sell_button.dart).priceProviderUnavailableTitle/priceProviderUnavailableDescription(de + en).Dashboard intentionally unchanged (still
--.--) — scope is buy/sell only.Copy (de)
Tests
503andcode→priceSourceUnavailable; otherApiException→unknown.buy_price_source_unavailable(regenerated viagolden-regenerate.yaml).flutter analyzeclean; buy/sell cubit suites green.Test plan