From 4772fac4135ffeb07d68a3dae7ebcfaf9de90b9f Mon Sep 17 00:00:00 2001 From: Erdem Yerebasmaz Date: Tue, 4 Aug 2026 02:02:52 +0300 Subject: [PATCH 1/2] exception_handler: surface disabled swap creation as a swap outage Verified against device logs: Boltz keeps its pairs endpoint live while refusing to create swaps, so prepare_receive_payment succeeds with real fees and limits, and the refusal only lands on receive_payment as Generic { err: "Boltz API returned error status 400 Bad Request: {\"error\":\"swap creation is disabled\"}" }. Users on Receive > Bitcoin Address saw that raw JSON. PairsNotFound, which #655 assumed was the error hit during this outage, never fires. Route both to the same message and reuse it via a shared constant. Matching on the error text is fragile, but the SDK flattens the Boltz 400 body into an untyped Generic error, so there is nothing else to match on. The adjacent non-final / rpc error -26 check sets the precedent. Co-Authored-By: Claude Opus 5 --- lib/utils/exceptions/exception_handler.dart | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/utils/exceptions/exception_handler.dart b/lib/utils/exceptions/exception_handler.dart index 6be2ff0a..d7b235b1 100644 --- a/lib/utils/exceptions/exception_handler.dart +++ b/lib/utils/exceptions/exception_handler.dart @@ -10,6 +10,11 @@ class ExceptionHandler { /// Private constructor to prevent instantiation ExceptionHandler._(); + /// Shown whenever the swap service is unavailable. Liquid send & receive need no + /// swapper, so they keep working and are the way forward for the user. + static const String _swapsUnavailable = + 'Swaps are temporarily unavailable. You can still send and receive using a Liquid address.'; + /// Extracts a user-friendly message from an exception /// /// [exception] The exception to extract a message from @@ -74,6 +79,10 @@ class ExceptionHandler { if (error.err.toLowerCase().contains('non-final') || error.err.toLowerCase().contains('rpc error -26')) { message = 'The transaction cannot be broadcast at this time. Please try again later.'; + } else if (error.err.toLowerCase().contains('swap creation is disabled')) { + // Boltz keeps serving pairs while refusing to create swaps, so prepare_* succeeds + // and the refusal only surfaces here, as a 400 body flattened into a generic error. + message = _swapsUnavailable; } else { message = 'Payment error: ${error.err}'; } @@ -88,9 +97,8 @@ class ExceptionHandler { } else if (error is PaymentError_InvalidPreimage) { message = 'The generated preimage is not valid'; } else if (error is PaymentError_PairsNotFound) { - // The swapper answered but offers no BTC/L-BTC pair, which is what a suspended - // swap service looks like. Liquid send & receive need no swapper, so point there. - message = 'Swaps are temporarily unavailable. You can still send and receive using a Liquid address.'; + // The swapper answered but offers no BTC/L-BTC pair. + message = _swapsUnavailable; } else if (error is PaymentError_PaymentTimeout) { message = 'Payment start could not be verified within the configured timeout'; } else if (error is PaymentError_PersistError) { From ad09ebdbbce18fa26e5a4ff50229461ec3891f96 Mon Sep 17 00:00:00 2001 From: Erdem Yerebasmaz Date: Tue, 4 Aug 2026 02:02:52 +0300 Subject: [PATCH 2/2] bump version to 0.3.1 Co-Authored-By: Claude Opus 5 --- .github/workflows/build-ios.yml | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 705ee143..1ba5d3e7 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -108,7 +108,7 @@ jobs: BUILD_CONFIGURATION: Release TESTFLIGHT_USERNAME: ${{ secrets.TESTFLIGHT_USERNAME }} TESTFLIGHT_PASSWORD: ${{ secrets.TESTFLIGHT_PASSWORD }} - IOS_VERSION_STRING: 0.3.0 + IOS_VERSION_STRING: 0.3.1 P12_BASE64: ${{ secrets.P12_BASE64 }} P12_PASSWORD: ${{ secrets.P12_PASSWORD }} GOOGLE_SERVICES_IOS: ${{ secrets.GOOGLE_SERVICES_IOS }} diff --git a/pubspec.yaml b/pubspec.yaml index e33ee346..fc36fbf2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: misty_breez description: "Flutter app showcasing Breez SDK - Nodeless (Liquid Implementation)." publish_to: 'none' -version: 0.3.0 +version: 0.3.1 environment: sdk: '>=3.11.1 <4.0.0'