fix(crowdnode): unwrap the published error before reading localizedDescription - #913
Merged
romchornyi merged 1 commit intoAug 3, 2026
Merged
Conversation
…scription #910 replaced `error as! CrowdNode.Error` with `error as? CrowdNode.Error ?? .messageStatus(error: error.localizedDescription)` at both CrowdNode error sinks. The force-cast implicitly unwrapped the optional; `as?` does not, so the fallback's `error.localizedDescription` is read off `Optional<any Error>` — the `@Published var error: Error?` element type — and does not compile: value of optional type 'Published<(any Error)?>.Publisher.Output' must be unwrapped to refer to member 'localizedDescription' Bind the optional in the existing `if` instead. Behaviour is unchanged: the `error is CrowdNode.Error` test already excluded nil, so the new binding only makes that explicit to the type checker. This broke the `dashpay` build on swift-sdk-integration. It was not caught before merge because the SwiftDashSDK package in ../platform was not compiling locally at the time, so the app target was never reached — as recorded in #910's test section. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5 tasks
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.
Issue being fixed or feature implemented
swift-sdk-integrationdoes not build. #910 replacederror as! CrowdNode.Errorwitherror as? CrowdNode.Error ?? .messageStatus(error: error.localizedDescription)at both CrowdNodeerror sinks. The force-cast implicitly unwrapped the optional;
as?does not, so the fallback'serror.localizedDescriptionis read offOptional<any Error>— the element type of@Published var error: Error?:It was not caught before merging #910 because the SwiftDashSDK package in
../platformwas notcompiling locally at the time, so the app target was never reached — as that PR's test section
recorded. It surfaced as soon as the local sandbox was repaired with
pod install(thepost-unlink
Podfile.lockhad gone out of sync withPods/).What was done?
Bind the optional in the existing
ifat both sites:DashWallet/Sources/UI/CrowdNode/Online/OnlineAccountEmailController.swift:103DashWallet/Sources/UI/CrowdNode/Portal/CrowdNodePortalViewController.swift:188Behaviour is unchanged — the
error is CrowdNode.Errortest already excluded nil, so the bindingonly makes that explicit to the type checker.
How Has This Been Tested?
xcodebuild -workspace DashWallet.xcworkspace -scheme dashpay -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' ARCHS=arm64 build→ BUILD SUCCEEDED.No behavioural testing: this restores compilation of code whose runtime behaviour #910 already
left unchanged.
Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code