Skip to content

fix: restore the ios build after the funding read merge - #1519

Merged
piotr-iohk merged 1 commit into
masterfrom
fix/spark-exit-funding-read-build
Nov 27, 2026
Merged

piotr-iohk merged 1 commit into
masterfrom
fix/spark-exit-funding-read-build

Conversation

@ovitrif

@ovitrif ovitrif commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

master stopped compiling after #1506 merged over the noteFundingSeen change from #1449:

  • refreshFundingSeen awaited the now synchronous noteFundingSeen.
  • noteFundingSeen returned the UTXOs from a Void function.

refreshFundingSeen now reads the UTXOs first, notes them, and returns them. Behaviour is unchanged.

Test

  • SparkExitReviewTests and OnchainSendAttemptServiceTests pass.
  • swiftformat --lint is clean.

Android is unaffected, so there is no twin.

Models used

  • Planning/scoping: Not used
  • Implementation: Claude Opus 5.5 (reasoning: medium)
  • Review: Gemini 4 Neon (reasoning: high)
  • Review rounds: 1

refreshFundingSeen awaited a sync noteFundingSeen and noteFundingSeen
returned a value from a Void function after merging #1506 over the
noteFundingSeen refactor. Read the UTXOs first, note them, return them.

Verified: xcodebuild test SparkExitReviewTests + OnchainSendAttemptServiceTests (pass), swiftformat --lint
@ovitrif ovitrif self-assigned this Nov 26, 2026
@ovitrif
ovitrif requested review from jvsena42 and pwltr November 26, 2026 22:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T22:39:22.789080Z b8a9920 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Fixes the funding-read compile errors in SparkExitManager.swift.

  • Spark exit funding refreshes now return the UTXOs they read.

Reviews (1) · Last reviewed commit: "fix: restore the ios build after the fun..." · Reviewed by Greptile

@ovitrif

ovitrif commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

QA for b8a9920:

Tested on iPhone 17 Pro (iOS 27 simulator), local regtest, with a plain build of this head. The only local change points the app at the local regtest ports.

🟢 Force transfer with savings that fall short
Force transfer with savings that fall short

With 5 000 sats in savings, the emergency fees (₿ 20 825) had to come from another wallet. The pay screen showed the amount to pay and the funding address. Another wallet paid it. The exit started, and Progress showed no amount left to pay, so the funding address read worked. One block later, Confirmation of emergency fees was ticked and the exit broadcast its next step. Every tick read the address without errors.

case1519-short-savings2x.mp4

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings. Restores the build after #1506 merged over #1449: refreshFundingSeen reads the UTXOs, notes them through the now synchronous noteFundingSeen, and returns them. Reviewed b8a9920, light tier, static (iOS does not build on this reviewer's Linux host).

What I checked, and 2 candidates I ruled out

Read: SparkExitManager.swift around refreshFundingSeen / noteFundingSeen, plus both callers of the returned value (the refused-payment retry guard at refreshFundingSeen(...) != nil, and the discardable tick calls).
Compared: the result against c9c612807, the #1506 side, which inlined the same read, note and return; the merged result matches it line for line.
CI: SwiftFormat, validate and Greptile green; Run Tests, Run Integration Tests and build-local still pending at review time.

Ruled out

  • Nil versus empty on an unreadable address: try? await still yields nil, so the retry guard still refuses to pay when the address cannot be read.
  • The other noteFundingSeen(_:) overload (pre-start, [EsploraUtxo] only): untouched, and the call sites resolve to the two-argument private one.

Merge confidence: 4/5, the change is mechanical but the unit and build jobs had not finished when this was posted.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the run metadata available to this reviewer does not carry an effort setting)

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA review

Scope: full PR diff against its merge base, at b8a9920.

No new actionable code findings.

No actionable code findings. The PR changes one function. refreshFundingSeen now reads the funding-address UTXOs, passes them to the synchronous noteFundingSeen, and returns them. The result matches the #1506 side of the merge (c9c6128) line for line, so behaviour is unchanged. An address that cannot be read still gives nil, so the refused-savings retry still throws instead of paying without a read. The two tick callers ignore the return value, and the pre-start noteFundingSeen(_:) overload is untouched.

Validation: I compiled a small stand-in for the two functions (not the real file) with Swift 6.4.2 on Linux. The base shape fails with "unexpected non-void return value in void function" and the head shape type-checks cleanly. This is not a full app build. The unit tests and the build-local / e2e run passed on this exact head. Android has no equivalent of this merge-induced compile break, so I did no parity comparison.

Device testing: not performed in this review. The author reports a simulator force-transfer pass at this head where another wallet paid the funding (QA comment).

Suggested additional test cases

  • iOS unit test: put a refused savings payment on an exit that still needs funding, and give it a chain stub whose utxos(address:) throws. Retry the payment. Expected: it throws the "funding address could not be read" error and makes no payment attempt. I found no existing test that asserts this guard.

Reviewer model: claude-opus-5-5
Reasoning effort: high

@ovitrif

ovitrif commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

iOS unit test: put a refused savings payment on an exit that still needs funding, and give it a chain stub whose utxos(address:) throws. Retry the payment. Expected: it throws the "funding address could not be read" error and makes no payment attempt.

@piotr-iohk Good call. The guard came in with #1506, so I'm adding that test in #1518, which changes retrySavingsPayment and still needs its device run. That keeps this PR's head, and the run already posted on it, as they are for the RC.

@piotr-iohk
piotr-iohk merged commit 003a8dc into master Nov 27, 2026
23 checks passed
@piotr-iohk
piotr-iohk deleted the fix/spark-exit-funding-read-build branch November 27, 2026 08:19
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.

3 participants