Skip to content

01a0344d - fix(buy): hide FormatException on 502 and pin retry-only golden - #939

Merged
TaprootFreak merged 4 commits into
stagingfrom
fix/buy-quote-502-formatexception
Aug 24, 2026
Merged

01a0344d - fix(buy): hide FormatException on 502 and pin retry-only golden#939
TaprootFreak merged 4 commits into
stagingfrom
fix/buy-quote-502-formatexception

Conversation

@TaprootFreak

@TaprootFreak TaprootFreak commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

EN:
A 502 with a plain-text body no longer crashes JSON parsing into a FormatException on the buy quote screen. The quote retry button remains; if the API sent no JSON message, only Retry is shown. A visual baseline pins that retry-only state.

DE:
Ein 502 mit Klartext-Body erscheint auf dem Kauf-Quote-Screen nicht mehr als FormatException. Der Wiederholen-Button bleibt; ohne JSON-Message zeigt die UI nur Wiederholen. Eine visuelle Baseline pinnt diesen Zustand.

Details

Gateway 502 responses with a non-JSON body (e.g. error code: 502) were passed through jsonDecode, which threw FormatException. That string was stored on BuyPaymentInfoFailure.message and rendered as the info title.

ApiException.fromBody now decodes JSON objects via fromJson and otherwise yields an empty user-facing message with the HTTP status. The buy payment-info service uses it on error paths. HTTP 502 is mapped like 503 (priceSourceUnavailable). The catch-all no longer copies Object.toString() into the UI.

A golden (buy_price_source_unavailable_empty) pins the empty-message retry-only buy screen. The PNG is generated on the self-hosted runner via golden-regenerate.yaml, not locally.

@TaprootFreak

Copy link
Copy Markdown
Contributor Author

EN:
Ready after 1 review pass.
Buy quote no longer shows a FormatException when the API returns a non-JSON 502.

DE:
Bereit nach 1 Review-Durchlauf.
Die Kauf-Quote zeigt bei einem Nicht-JSON-502 keine FormatException mehr.

Details

Review: one pass to 0 findings on quality and logic. Mergeable against staging. No open review threads or PR comments. Commit 90f76b5d is verified. CI on this repo skips while the PR is draft; real checks start after ready.

@TaprootFreak
TaprootFreak marked this pull request as ready for review August 24, 2026 16:04
@TaprootFreak
TaprootFreak marked this pull request as draft August 24, 2026 16:40
Gateway 502 bodies like "error code: 502" were jsonDecoded and the
resulting FormatException was shown on the buy quote screen. Parse
error bodies via ApiException.fromBody and map HTTP 502 like 503.
The retry-only buy screen (no FormatException title) needs a committed
baseline. PNG is produced by the self-hosted golden-regenerate workflow.
@TaprootFreak
TaprootFreak force-pushed the fix/buy-quote-502-formatexception branch from 90f76b5 to 4fc7ce8 Compare August 24, 2026 16:40
@TaprootFreak TaprootFreak changed the title 01a0344d - fix(buy): do not show FormatException on quote 502 01a0344d - fix(buy): hide FormatException on 502 and pin retry-only golden Aug 24, 2026
@TaprootFreak

Copy link
Copy Markdown
Contributor Author

EN:
Ready after 2 review passes.
Buy quote no longer shows a FormatException on a non-JSON 502, and a golden pins the retry-only screen.

DE:
Bereit nach 2 Review-Durchläufen.
Die Kauf-Quote zeigt bei einem Nicht-JSON-502 keine FormatException mehr; eine Golden-Baseline pinnt den Nur-Wiederholen-Screen.

Details

Pass 1 covered the 502 parse fix. Pass 2 added buy_price_source_unavailable_empty.png via the self-hosted regenerate workflow and re-reviewed the full diff. Mergeable against staging. No open review threads. One reported fromJson fallback (Unknown error when a JSON body has no message) was declined: that fallback is pre-existing, the spec left fromJson unchanged, and the reported screenshot was a non-JSON body.

@TaprootFreak
TaprootFreak marked this pull request as ready for review August 24, 2026 17:07
@TaprootFreak
TaprootFreak merged commit 4a71a59 into staging Aug 24, 2026
11 checks passed
@TaprootFreak
TaprootFreak deleted the fix/buy-quote-502-formatexception branch August 24, 2026 19:40
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