From 236992a72fd9ff0331691565cfce56a90fefd481 Mon Sep 17 00:00:00 2001 From: AnganSamadder Date: Tue, 25 Aug 2026 06:03:32 -0400 Subject: [PATCH 1/2] test(ios): make settlement alert regression cloud-safe --- .../Features/Activity/ExpenseDetailView.swift | 16 ++++++++++------ .../BusinessLogic/SettlementLogicTests.swift | 16 +++++++++++----- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/apps/ios/PayBack/Sources/Features/Activity/ExpenseDetailView.swift b/apps/ios/PayBack/Sources/Features/Activity/ExpenseDetailView.swift index d450a41..e1f477c 100644 --- a/apps/ios/PayBack/Sources/Features/Activity/ExpenseDetailView.swift +++ b/apps/ios/PayBack/Sources/Features/Activity/ExpenseDetailView.swift @@ -1,6 +1,14 @@ import SwiftUI import UIKit +enum SettlementErrorPresentation { + static let fallbackMessage = "We couldn't update this settlement. Please try again." + + static func message(for error: Error?) -> String { + error?.userFacingMessage(fallback: fallbackMessage) ?? fallbackMessage + } +} + struct ExpenseDetailView: View { @Environment(\.dismiss) private var dismiss @EnvironmentObject var store: AppStore @@ -102,9 +110,7 @@ struct ExpenseDetailView: View { .alert("Unable to Update Settlement", isPresented: $showSettlementError) { Button("OK", role: .cancel) { } } message: { - Text(settlementError?.userFacingMessage( - fallback: "We couldn't update this settlement. Please try again." - ) ?? "We couldn't update this settlement. Please try again.") + Text(SettlementErrorPresentation.message(for: settlementError)) } } @@ -557,9 +563,7 @@ struct SettleExpenseSheet: View { .alert("Unable to Update Settlement", isPresented: $showSettlementError) { Button("OK", role: .cancel) { } } message: { - Text(settlementError?.userFacingMessage( - fallback: "We couldn't update this settlement. Please try again." - ) ?? "We couldn't update this settlement. Please try again.") + Text(SettlementErrorPresentation.message(for: settlementError)) } } } diff --git a/apps/ios/PayBack/Tests/BusinessLogic/SettlementLogicTests.swift b/apps/ios/PayBack/Tests/BusinessLogic/SettlementLogicTests.swift index 83dc72a..5c1142d 100644 --- a/apps/ios/PayBack/Tests/BusinessLogic/SettlementLogicTests.swift +++ b/apps/ios/PayBack/Tests/BusinessLogic/SettlementLogicTests.swift @@ -25,13 +25,19 @@ final class SettlementLogicTests: XCTestCase { XCTAssertFalse(settlementFunction.contains("Continue settling remaining expenses")) } - func testExpenseSettlementAlertsSanitizeUnderlyingServerErrors() throws { - let source = try SourceFixture.contents( - at: "Sources/Features/Activity/ExpenseDetailView.swift" + func testExpenseSettlementAlertsSanitizeUnderlyingServerErrors() { + let rawError = PayBackError.underlying( + message: "[Request ID: private-request-id] internal server stack" ) - XCTAssertEqual(source.components(separatedBy: ".userFacingMessage(").count - 1, 2) - XCTAssertFalse(source.contains("settlementError?.errorDescription")) + XCTAssertEqual( + SettlementErrorPresentation.message(for: rawError), + "We couldn't update this settlement. Please try again." + ) + XCTAssertEqual( + SettlementErrorPresentation.message(for: nil), + "We couldn't update this settlement. Please try again." + ) } func testTotalToSettleUsesCurrentUsersUnsettledShareInsteadOfExpenseTotal() { From 1db442346dbedd150407e0e5313cfc808098ff0c Mon Sep 17 00:00:00 2001 From: AnganSamadder Date: Tue, 25 Aug 2026 06:03:38 -0400 Subject: [PATCH 2/2] chore(release): prepare 0.1.13 --- PayBack.xcodeproj/project.pbxproj | 12 ++++++------ project.yml | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PayBack.xcodeproj/project.pbxproj b/PayBack.xcodeproj/project.pbxproj index e27c81a..1321390 100644 --- a/PayBack.xcodeproj/project.pbxproj +++ b/PayBack.xcodeproj/project.pbxproj @@ -2245,7 +2245,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 127; + CURRENT_PROJECT_VERSION = 128; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 39YTAJZTZ6; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -2267,7 +2267,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 18.0; - MARKETING_VERSION = 0.1.12; + MARKETING_VERSION = 0.1.13; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -2315,7 +2315,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 127; + CURRENT_PROJECT_VERSION = 128; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 39YTAJZTZ6; ENABLE_NS_ASSERTIONS = NO; @@ -2332,7 +2332,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 18.0; - MARKETING_VERSION = 0.1.12; + MARKETING_VERSION = 0.1.13; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2456,7 +2456,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 127; + CURRENT_PROJECT_VERSION = 128; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 39YTAJZTZ6; ENABLE_NS_ASSERTIONS = NO; @@ -2473,7 +2473,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 18.0; - MARKETING_VERSION = 0.1.12; + MARKETING_VERSION = 0.1.13; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/project.yml b/project.yml index 65c1fdc..f7e5651 100755 --- a/project.yml +++ b/project.yml @@ -106,8 +106,8 @@ settings: base: SWIFT_VERSION: "5.10" IPHONEOS_DEPLOYMENT_TARGET: "18.0" - MARKETING_VERSION: 0.1.12 - CURRENT_PROJECT_VERSION: 127 + MARKETING_VERSION: 0.1.13 + CURRENT_PROJECT_VERSION: 128 DEVELOPMENT_TEAM: "39YTAJZTZ6" ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS: YES ENABLE_USER_SCRIPT_SANDBOXING: NO