Repository navigation
fix: decouple wallet restore from profile refresh - #1121
ben-kaufman wants to merge 157 commits into
Conversation
|
Triage: 3.1.0, with its Android twin synonymdev/bitkit-android#1686. |
talosmachina
left a comment
There was a problem hiding this comment.
1 finding (1 P1). Moves profile initialization off the wallet-restore critical path and blocks an identity-free WALLET backup while saved credentials exist. Reviewed ec20b26, full tier. Reasoned from the code and CI only: this review did not build the branch or run the iOS suite.
What I checked, and 4 candidates I ruled out
Read in full: the diff; PubkyProfileManager initialization, recovery and resolveSessionInitialization; BackupService wallet payload, runBackup, runScheduledBackup, isTemporaryBackupFailure; PaykitSdkService.currentPublicKey, importSessionLocked, signInLocked
Call sites traced: scheduleInitializationAfterRestore (AppScene restore path), backupSnapshot (WALLET payload), hasStoredIdentityForBackup
CI: SwiftFormat green, Run Tests still pending at review time
Ruled out
- A fresh backup missed after activation:
importSessionLockedandsignInLockedboth callmarkWalletBackupDataChanged(), and the BackupService listener re-marks WALLET as required, so a delayed activation gets its fresh upload. - A stale restore task reviving an old identity: both the scheduled task and
beginInitializationre-checksessionRevisionbefore and after awaiting, andinitializeSessionStatedrops a result from an older revision. - A second restore scheduled for the same revision: the
restoreInitialization?.revisionguard makes it a no-op, andbeginInitializationhands back the in-flight task. - Malformed UTF-8 credentials let through:
hasStoredIdentityForBackupreads rawKeychain.loadbytes, unlikehasStoredIdentity'sloadString, so a non-UTF-8 entry still counts.
Merge confidence: 3/5, one P1.
Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the runner does not report a reasoning setting)
| ) async throws -> (state: String?, sdkVersion: UInt64) { | ||
| let initialSdkVersion = await sdkService.backupStateVersion | ||
| guard try await sdkService.currentPublicKey() != nil else { | ||
| guard try !hasStoredIdentity() else { throw PubkyServiceError.sessionNotActive } |
There was a problem hiding this comment.
P1: a session that cannot be restored blocks every WALLET backup
The guard is right for the short window before activation, but it fires the same way once resolveSessionInitialization returns .restorationFailed. That happens with a saved session and no reachable secret key (PubkyProfileManager.swift:2056-2061), or when re-sign-in fails with an error that is not temporary (:2074). initializeSessionState handles that case with clearAuthenticatedState(clearCachedProfile: false) and leaves the keychain alone (:394-399). The credentials stay, the SDK has no identity, and from then on every WALLET payload throws sessionNotActive here.
sessionNotActive is not in BackupService.isTemporaryBackupFailure. runScheduledBackup therefore ends with .failed and does not reschedule. Each later data change marks the backup required again and fails again. Until the user signs in again or removes the profile, the remote WALLET record stays at its last upload, including the parts unrelated to Paykit: transfers, watch-only accounts, reservation indices and payment-proof state. Before this change, the same state produced a backup with paykitSdkBackupState: nil.
The tests cover an identity that later activates (testUnresolvedStoredIdentityCannotReplaceCompleteWalletBackup), not one that never will. One fix: fail closed only while restoration is pending or deferred. Once it has definitely failed, carry the previous paykitSdkBackupState forward. Either way, add a test with .restorationFailed and retained credentials that checks a later wallet change still uploads.
There was a problem hiding this comment.
Confirmed: after terminal restoration failure this guard leaves complete WALLET backups pending, including later ordinary wallet changes. The Android twin has the same availability limitation. I am keeping this thread open while addressing it.
I cannot safely carry an arbitrary cached paykitSdkBackupState forward yet. The current WALLET payload includes consumed/private receive state, reservation ceilings, payment requests/proofs and active payment attempts; a stale SDK snapshot has no established consistency contract with those newer records. Returning nil is also unsafe: the restore path treats absent SDK state as clearing Paykit state. The guard prevents a complete backup from being replaced by such a payload.
The ongoing cross-platform follow-up is an independently recoverable ordinary-wallet record, with explicit restore selection, identity/version binding, migration and concurrent-writer rules while preserving complete WALLET. Older apps currently ignore additional records and do not enforce the envelope version, so the old-reader compatibility policy must be settled before publishing this split. The existing independent USDT recovery record is unaffected. I will not mark this finding resolved or claim full-wallet backup independence until the replacement path has controlled outage/restart/restore tests.
There was a problem hiding this comment.
At ec20b26 the terminal-restoration limitation still holds: saved credentials remain, and an absent SDK identity still makes the WALLET snapshot throw sessionNotActive. The controlled app test confirmed that a temporary unavailable identity preserves the remote WALLET bytes and pending work, then permits a complete backup after credentials recover. That recovery result does not resolve this terminal-failure availability issue.
There was a problem hiding this comment.
At 754a899 I drove a terminal/no-secret case through the real resolver, then reserved a new ordinary watch-only account index. WALLET upload failed, leaving the prior remote bytes/version unchanged and newer work pending; restoring the original credentials allowed upload. On this composition that probe failed with the SDK Identity error before the sessionNotActive guard. J1 separately confirmed sessionNotActive protection and recovery from a temporary unavailable identity. The terminal availability limitation remains open.
There was a problem hiding this comment.
Retested at 2d4fc71: the real no-secret resolver branch leaves a later ordinary account reservation pending while remote WALLET bytes/version remain unchanged. Capture raises the SDK Identity error before the sessionNotActive guard. Restoring the original credentials uploads and clears pending work; the terminal availability finding remains open.
There was a problem hiding this comment.
Retested at d83a217: the real no-secret resolver branch left a later ordinary account reservation pending while complete WALLET bytes/version stayed unchanged. Capture raised the SDK Identity error before sessionNotActive. Restoring the original credentials allowed upload and cleared pending work. The terminal availability finding remains open.
There was a problem hiding this comment.
Retested at a6f233d: the real no-secret resolver branch left a later ordinary account reservation pending while remote WALLET bytes/version stayed unchanged. Capture raised the SDK Identity error before sessionNotActive. Restoring the original credentials allowed upload and cleared pending work. The terminal availability finding remains open.
There was a problem hiding this comment.
Retested at 485a9dc: invalid saved-session credentials with no local secret reached the real no-secret resolver branch. A later ordinary account reservation left remote WALLET bytes/version unchanged and work pending; capture raised the SDK Identity error. Restoring the captured credentials allowed upload and cleared pending. The availability finding remains open. The UI failure flag sampled false, so that flag is not the resolver-outcome assertion.
There was a problem hiding this comment.
Retested at 111ddd8 with a non-nil WALLET record that decoded with SDK state. Invalid saved-session input without a local secret reached the real no-secret resolver branch. A later ordinary account reservation left that remote record byte-identical and WALLET pending; capture raised the SDK Identity error. Restoring the captured credentials allowed upload, and a fresh remote read contained both SDK state and the new reservation with pending work cleared. This confirms the existing availability failure with stronger remote-record assertions; it remains open.
There was a problem hiding this comment.
Retested at 1c3cde6 with an existing remote WALLET decoded with SDK state. Invalid saved-session input without a local secret reached the real terminal resolver; a later ordinary reservation left that complete record byte-identical and pending. Credential repair uploaded SDK state plus the reservation. I also used normal Profile → Disconnect in the terminal state: private endpoint cleanup raised the SDK Identity error before local sign-out, leaving the unusable credentials and pending backups. The proposed disconnect recovery route therefore failed for this input. The existing finding remains open.
jvsena42
left a comment
There was a problem hiding this comment.
Code scan: no findings.
Checked and clean:
- No cross-identity leak on wipe and restore: the static
clearLocalStatebumps the revision, and the state tree is recreated. - Identity isn't lost for good: the retry paths cover a failed background activation. The only lasting block is the WALLET backup already raised in the open P1 thread.
- No payment path starts before the identity exists: Paykit starts only when
authState == .authenticated, so the header stays signed-out or loading until the background activation lands. - Twin synonymdev/bitkit-android#1686 shows the restored identity at once and fills profile and contacts in afterwards.
Performance-relevant (the purpose is a faster restore). wallet/restore-during-identity-outage.xml needs fault controls that aren't provisioned, so the gate uses a proxy. It restores a regtest wallet whose backup carries a pubky session, then:
- times Restore →
restoreWalletBackupAndStartreturn, head vs master, with the homeserver reachable and with it blocked; - checks that profile and contacts arrive afterwards;
- counts
Paykit session restored forper restore (expected 1); - runs Settings → Backup once the identity is active.
Device gate (partial): ec20b26 — not run yet; pending that proxy run. Device results will follow in a separate review.
There was a problem hiding this comment.
Verdict: 💬 Comment — the acknowledged backup availability issue remains open.
Findings: No new findings. I confirmed that the existing HIGH finding still applies: complete WALLET backups remain blocked after terminal identity restoration failure while credentials remain stored. The successful temporary-fault recovery below does not resolve that case.
QA for ec20b26: iPhone 17 Pro, iOS 26.5 Simulator, staging regtest. I built the unmodified head, ran its focused native suites, then drove J1 with local Debug fault controls over the real SDK and VSS paths.
Test 1: J1 — restore, backup protection, restart and stale profile ✅ All six actions passed with the fault controls described below.
- Required recovery reached a running wallet while final identity initialization remained held and authentication stayed idle. I left restore and copied a regtest receive address, confirmed from the simulator clipboard. Releasing initialization restored the identity and allowed fresh complete backups.
- With SDK session access removed and malformed local session bytes, the backup failed with
sessionNotActive. The remote WALLET bytes and version stayed unchanged, and backup work remained pending. Restoring the original credentials allowed a complete backup with SDK state and cleared pending status. These assertions were checked in the app logs. - Killing the app during held initialization preserved saved credentials. After restart and release, the saved contact remained a single entry; the complete logs contained one contact-add event.
- Disconnecting while a real profile response was held invalidated that response. On release, its normal guard reported
can apply: false, and the identity-choice screen remained visible. - A malformed retained WALLET payload kept required recovery pending, the node stopped and wallet actions unavailable. Repairing that original payload and retrying reached the wallet while optional initialization was still held. Node and authentication states were checked in the app logs.
| Required recovery and optional initialization | Backup protection |
|---|---|
J1-required-focus-2x.2x.mp4 |
J1-backup-2x.2x.mp4 |
| Required failure, retry and wallet access while identity work is held; focused excerpt, 2×. | The real backup rejects unavailable identity data, then succeeds after credential recovery; assertions checked in logs; 2×. |
| Restart with a saved contact | Late profile response |
|---|---|
J1-contact-restart-focus-2x.2x.mp4 |
J1-stale-profile-2x.2x.mp4 |
| One contact before and after process restart and identity recovery; focused excerpt, 2×. | Disconnect while the profile read is held, then release it and retain the signed-out UI; 2×. |
The test wallet had no funds. No funded-payment replay, USDT-specific restore failure, live homeserver blackout or head-versus-base timing comparison was driven. The native suites cover coalescing and queued identity replacement separately.
Check 1: focused native regressions ✅ The selected suites passed with no failures or skips.
I ran xcodebuild test with -only-testing:BitkitTests/PubkyProfileManagerTests and -only-testing:BitkitTests/PrivatePaykitServiceTests on the unmodified head and inspected the finalized XCResult. These cover held initialization, coalescing, stale completion, replacement credentials, malformed stored bytes and backup retry. The simulator build and git diff --check also passed.
Local test hooks and deciding log lines
Not pushed. Holds wait for explicit file removal. The backup control temporarily replaces only this disposable wallet's local credential input and restores its original bytes afterward; it uses the actual SDK, backup writer and VSS record. The required-recovery control corrupts a local retained payload, then restores its original captured bytes before retry. SDK results and recovery decisions are not mocked.
required recovery complete; scheduling final identity
final identity initialization held
wallet start returned: running, authenticated: idle
backup fault staged; SDK identity absent: true
Backup failed for: 'WALLET': sessionNotActive
blocked backup: bytes unchanged: true, version unchanged: true, pending: true
recovered backup: SDK state present: true, pending: false
required restore failed; pending: true, node: stopped
original retained WALLET repaired before retry
profile response released; can apply: false
diff --git a/Bitkit/AppScene.swift b/Bitkit/AppScene.swift
index c39b57cf..8956b76f 100644
--- a/Bitkit/AppScene.swift
+++ b/Bitkit/AppScene.swift
@@ -1169,8 +1169,14 @@ struct AppScene: View {
widgets.loadSavedWidgets()
widgets.objectWillChange.send()
+ #if DEBUG // test hook
+ Logger.info("QA1121 required recovery complete; scheduling final identity", context: "TestHook") // test hook
+ #endif // test hook
pubkyProfile.scheduleInitializationAfterRestore()
await startWallet(completingBackupRestore: true)
+ #if DEBUG // test hook
+ Logger.info("QA1121 wallet start returned: \(wallet.nodeLifecycleState), authenticated: \(pubkyProfile.authState)", context: "TestHook") // test hook
+ #endif // test hook
}
private func retryWalletStart() async {
@@ -1244,9 +1250,21 @@ struct AppScene: View {
private func restoreVssBackup() async -> Bool {
do {
+ #if DEBUG // test hook
+ let repair = Env.appStorageUrl.appendingPathComponent("qa1121-repair-required") // test hook
+ if FileManager.default.fileExists(atPath: repair.path) { // test hook
+ let data = try Data(contentsOf: Env.appStorageUrl.appendingPathComponent("qa1121-valid-wallet")) // test hook
+ try Keychain.upsert(key: .paykitPendingBackupRestore, data: data) // test hook
+ try FileManager.default.removeItem(at: repair) // test hook
+ Logger.info("QA1121 original retained WALLET repaired before retry", context: "TestHook") // test hook
+ } // test hook
+ #endif // test hook
try await BackupService.shared.performFullRestoreFromLatestBackup()
return true
} catch {
+ #if DEBUG // test hook
+ Logger.info("QA1121 required restore failed; pending: \(BackupService.shared.hasPendingWalletRestore()), node: \(wallet.nodeLifecycleState)", context: "TestHook") // test hook
+ #endif // test hook
app.toast(error)
return false
}
diff --git a/Bitkit/Managers/PubkyProfileManager.swift b/Bitkit/Managers/PubkyProfileManager.swift
index d29dd6b1..08a427bd 100644
--- a/Bitkit/Managers/PubkyProfileManager.swift
+++ b/Bitkit/Managers/PubkyProfileManager.swift
@@ -1208,6 +1208,16 @@ class PubkyProfileManager: ObservableObject {
let loadedProfile = try await Task.detached {
try await resolve(pk)
}.value
+ #if DEBUG // test hook
+ let gate = Env.appStorageUrl.appendingPathComponent("qa1121-hold-profile") // test hook
+ if FileManager.default.fileExists(atPath: gate.path) { // test hook
+ Logger.info("QA1121 profile response held", context: "TestHook") // test hook
+ while FileManager.default.fileExists(atPath: gate.path) { // test hook
+ try await Task.sleep(for: .milliseconds(200)) // test hook
+ } // test hook
+ Logger.info("QA1121 profile response released; can apply: \(publicKey == pk && profileWriteGeneration == read.generation)", context: "TestHook") // test hook
+ } // test hook
+ #endif // test hook
if publicKey == pk, profileWriteGeneration == read.generation {
profile = loadedProfile
readOnlyProfile = nil
@@ -1926,7 +1936,17 @@ class PubkyProfileManager: ObservableObject {
}
private nonisolated static func initializePersistedSession() async throws -> SessionInitializationResult {
- try await PaykitSdkService.shared.restorePersistedSession()
+ #if DEBUG // test hook
+ let gate = Env.appStorageUrl.appendingPathComponent("qa1121-hold-identity") // test hook
+ if FileManager.default.fileExists(atPath: gate.path) { // test hook
+ Logger.info("QA1121 final identity initialization held", context: "TestHook") // test hook
+ while FileManager.default.fileExists(atPath: gate.path) { // test hook
+ try await Task.sleep(for: .milliseconds(200)) // test hook
+ } // test hook
+ Logger.info("QA1121 final identity initialization released", context: "TestHook") // test hook
+ } // test hook
+ #endif // test hook
+ return try await PaykitSdkService.shared.restorePersistedSession()
}
private nonisolated static func notifyAppStateBackupChanged() {
diff --git a/Bitkit/Views/Settings/Security/DataBackupsScreen.swift b/Bitkit/Views/Settings/Security/DataBackupsScreen.swift
index 31b84c1a..34d6a147 100644
--- a/Bitkit/Views/Settings/Security/DataBackupsScreen.swift
+++ b/Bitkit/Views/Settings/Security/DataBackupsScreen.swift
@@ -50,6 +50,14 @@ struct DataBackupsScreen: View {
var body: some View {
VStack(alignment: .leading, spacing: 0) {
NavigationBar(title: t("settings__data_backups_nav_title"))
+ #if DEBUG // test hook
+ if FileManager.default.fileExists(atPath: Env.appStorageUrl.appendingPathComponent("qa1121-controls").path) { // test hook
+ Button("QA1121: unavailable identity backup") { Task { await qaUnavailableIdentityBackup() } } // test hook
+ .accessibilityIdentifier("QA1121BackupFault") // test hook
+ Button("QA1121: stage required restore error") { Task { await qaRequiredRestoreError() } } // test hook
+ .accessibilityIdentifier("QA1121RequiredFault") // test hook
+ } // test hook
+ #endif // test hook
GeometryReader { geometry in
ScrollView(showsIndicators: false) {
@@ -98,4 +106,48 @@ struct DataBackupsScreen: View {
.navigationBarHidden(true)
.padding(.horizontal, 16)
}
+
+ #if DEBUG // test hook
+ @MainActor private func qaUnavailableIdentityBackup() async { // test hook
+ do { // test hook
+ let before = try await VssBackupClient.shared.getObject(key: "WALLET") // test hook
+ let keys: [KeychainEntryType] = [.paykitSession, .pubkySecretKey] // test hook
+ let values = try keys.map { try Keychain.load(key: $0) } // test hook
+ do { // test hook
+ defer { // test hook
+ for (key, value) in zip(keys, values) { // test hook
+ if let value { try? Keychain.upsert(key: key, data: value) } else { try? Keychain.delete(key: key) } // test hook
+ } // test hook
+ } // test hook
+ try await PaykitSdkService.shared.forgetSessionAccess() // test hook
+ try Keychain.upsert(key: .paykitSession, data: Data([0xFF])) // test hook
+ let active = try await PaykitSdkService.shared.currentPublicKey() // test hook
+ Logger.info("QA1121 backup fault staged; SDK identity absent: \(active == nil)", context: "TestHook") // test hook
+ await BackupService.shared.triggerBackup(category: .wallet) // test hook
+ let after = try await VssBackupClient.shared.getObject(key: "WALLET") // test hook
+ let pending = BackupService.shared.getBackupStatus(category: .wallet).isRequired // test hook
+ Logger.info("QA1121 blocked backup: bytes unchanged: \(before?.value == after?.value), version unchanged: \(before?.version == after?.version), pending: \(pending)", context: "TestHook") // test hook
+ } // test hook
+ _ = try await PaykitSdkService.shared.restorePersistedSession() // test hook
+ await BackupService.shared.triggerBackup(category: .wallet) // test hook
+ let fresh = try await VssBackupClient.shared.getObject(key: "WALLET") // test hook
+ let data = try JSONSerialization.jsonObject(with: fresh!.value) as! [String: Any] // test hook
+ let pending = BackupService.shared.getBackupStatus(category: .wallet).isRequired // test hook
+ Logger.info("QA1121 recovered backup: SDK state present: \(data["paykitSdkBackupState"] is String), pending: \(pending)", context: "TestHook") // test hook
+ } catch { // test hook
+ Logger.error("QA1121 backup control error: \(error)", context: "TestHook") // test hook
+ } // test hook
+ } // test hook
+
+ @MainActor private func qaRequiredRestoreError() async { // test hook
+ do { // test hook
+ guard let item = try await VssBackupClient.shared.getObject(key: "WALLET") else { return } // test hook
+ try item.value.write(to: Env.appStorageUrl.appendingPathComponent("qa1121-valid-wallet")) // test hook
+ try Keychain.upsert(key: .paykitPendingBackupRestore, data: Data("invalid-json".utf8)) // test hook
+ Logger.info("QA1121 invalid retained WALLET staged; original recovery payload saved", context: "TestHook") // test hook
+ } catch { // test hook
+ Logger.error("QA1121 required-restore control error: \(error)", context: "TestHook") // test hook
+ } // test hook
+ } // test hook
+ #endif // test hook
}Coverage: full 34047db..ec20b26, all seven changed files and the reached restore, SDK activation, backup, identity replacement and reset paths. All six J1 actions were driven with the stated controls; genuine payment authorization was not exercised.
Twin: bitkit-android#1686 fix: decouple wallet restore from profile refresh matches the scheduling and backup protections. Android retains an already-active identity during optional enrichment; iOS waits for final initialization before authenticating its profile manager.
Reviewer model: gpt-6.1-sol
Reasoning effort: high
Reviewed by gpt-6.1-sol-high via gh-pr-review-loop skill
Commands: @ovi-reviewer review · test · retest
…y-background Master's deliverChannelFreeRailEvent called the event callback directly, which this branch made main-actor isolated, so the merged tree failed to build. It now hops to the main actor through deliverOnMainActor, as emitChannelFreeRailEvent does. Verified: BitkitTests unit suite and swiftformat --lint on the merged tree
|
Merged master in c569d35 to fix the CI build failure at 8c400aa. Master's |
There was a problem hiding this comment.
Verdict: ⛔️ Request changes — both existing findings reproduce at c569d35. No new finding in the merge delta.
Findings:
- HIGH — newer ordinary wallet state remains unavailable remotely while retained identity credentials are unusable.
Bitkit/Services/PrivatePaykitService+Backup.swift:12. Both rejected-session and nil-identity inputs left a new reservation pending while the previous complete WALLET bytes and version stayed unchanged. Repairing the original credentials uploaded the reservation. The no-clobber guard is correct; recovery while those credentials remain unusable is still missing. Existing finding. - MEDIUM — native authentication can hold reset without Retry.
Bitkit/Services/VssBackupClient.swift:73. With one admitted dedicated-LDK request held, reset remained at step 4 with the seed present more than 96 seconds after admission closed. Releasing the response after 110 seconds completed reset and removed the seed. Existing finding.
VSS remains pinned to cf5b5cdf; the native authentication deadline fix is still open and unmerged. Keep admission closure and draining intact.
QA for c569d35:
Xcode 27.0; pristine native checks on iOS 27.0 and app cases on iOS 26.5 simulators. App fault probes used disclosed, uncommitted Debug controls against real SDK/VSS paths. The wire case used local E2E configuration and the same compiled Debug library. Disposable regtest wallets only. Recordings are 2× speed.
Backup, restore and Lightning callback regressions ✅ The unmodified head built and the selected regressions passed, checked in finalized XCTest results.
Covered backup/foreground recovery, Spark exit, connection correction persistence, wipe/VSS coordination, Lightning lifecycle and channel-free callbacks. The committed overdue-exit alert test and the changed uncertain-Spark-send expiry callback passed. The clip shows the profile-recovery UI fixture; service assertions came from XCTest results.
native2x.2x.mp4
Keep an active Spark exit pending, then back it up ✅ Pending work survived the deferral and uploaded after the injected exit ended, checked in logs and a fresh VSS read.
An app-hosted production BackupService with isolated defaults skipped upload during the active exit, then uploaded once and cleared pending work. This was an injected exit state, not a funded exit. The overdue-alert condition is covered separately by the pristine native regression above; the live Spark connection refreshed this app fixture's timestamp.
deferral2x.2x.mp4
Keep required recovery gated and resume while optional identity waits ✅ Required failures kept ordinary actions gated; successful retry permitted Receive during held optional activation, including after cold restart.
WALLET and empty-list USDT import faults each retained their required markers. Successful retry cleared both. Releasing optional activation restored the saved session and Profile Edit, then a fresh complete backup succeeded. Checked UI, persisted markers and actual session/backup logs. The Debug probe reentered the production restore flow on the disposable wallet; it was not a populated-USDT clean install.
restore2x.2x.mp4
Keep one saved contact through recovery and restart ✅ The contact remained exactly once after restore and cold restart, checked in UI snapshots and SDK record-load logs.
Saved through the normal UI, backed up, restored, then restarted with final identity activation held and released. The count was checked after identity recovery completed.
contacts2x.2x.mp4
Back up ordinary changes while saved identity remains unusable ❌ Both unusable-identity inputs left the new reservation pending and the complete remote WALLET unchanged, checked by decoded VSS readbacks.
Restoring the original credentials uploaded complete Paykit state plus the reservation and cleared pending work. That confirms repair, but does not solve availability while credentials remain unusable. The clip shows the app during the Debug probe; the byte/version and reservation assertions came from logs and decoded remote records.
terminal2x.2x.mp4
Reset while native VSS authentication is stalled ❌ Reset stayed at step 4 without Retry while the genuine authentication response was held.
Logs recorded admission closing with one active call and the seed still present 96.4 seconds later. Releasing the response after 110.3 seconds retired the read and completed reset; the seed and durable intent were then absent.
auth2x.2x.mp4
Create a wallet while connectivity is unavailable ✅ Initialization waited without the Spending error or Connection Settings, then resumed to Home and Receive.
Used the app connectivity signal, not physical transport loss. Logs confirmed the offline startup branch, then a running node with both required-import markers absent. The second clip dismisses the ordinary USDT introduction and opens Receive.
creation2x.2x.mp4
creation-finish2x.2x.mp4
Cancel profile deletion after a lost server acknowledgement ✅ A committed DELETE with a lost response produced honest failure; Cancel and cold restart caused no repeated deletion, checked in the HTTP journal and app logs.
The homeserver committed each profile resource DELETE once. The proxy withheld the final Paykit acknowledgement for 40 seconds and dropped the socket; native timeout showed Retry, Disconnect and Cancel. After Cancel and more than 96 seconds of cold startup, both per-resource DELETE counts and the single contact-cleanup count were unchanged. A read-only check still returned 404. This empty-contact case does not establish populated partial cleanup or manual Retry/Disconnect behavior.
wire-delete2x.2x.mp4
Prior passing evidence retained for unchanged paths:
- 4c9d57d report: listener dirty-state recording after stop, automatic editor dismissal, Retry feedback, and bounded backup quiesce with seed/gate retention and successful Retry.
- 6975667 report: saved corrections across failed required restore/restart, missing-profile recovery, stale identity-result rejection and cancellation handling. Its funded receive/event-replay evidence remains tied to that earlier head.
- synonymdev/bitkit-ios#1139: unchanged RGS probe, Back, foreground-cycle, older SETTINGS overlay and local-marker failure paths.
- synonymdev/bitkit-ios#1124: unchanged subscription-refusal and partial/unknown-contact retention guards. This is attributed earlier evidence, not a fresh run of every native cleanup operation.
Not driven here: funded Spark exits, populated USDT recovery or funded outgoing/payment-replay flows. The app probes above do not establish those outcomes. Mainnet-only pending swaps and physical-hardware journeys were excluded because the required wallets/hardware were unavailable.
Coverage: contiguous 8c400aa..c569d35 plus the earlier open findings. The merge's expiry-event dispatch was exercised by native regressions; unrelated incoming master behavior was not fully driven through funded app journeys.
Twin: synonymdev/bitkit-android#1686 at 3c2682a retains the same outer complete-WALLET guard for stored identity. This source parity check does not establish an Android runtime pass.
Reviewed by gpt-6.1-sol-high
jvsena42
left a comment
There was a problem hiding this comment.
Approving at c569d35. 8c400aa fixes my MEDIUM (the backup failure alert during an active Spark exit). My LOW on the #### Journeys list is still open in the body of my earlier review: please list J2–J4 there, or say it goes to a follow-up.
Device gate: c569d35 — journeys: restore-during-identity-outage.xml (J1.0–J1.4 and J1.6 passed; J1.5 not run), connection-recovery.xml (passed, including J2.2b and J2.4b), delete-profile-uncertain-response.xml (passed), profile-cleanup-failure.xml (actions 4–6, 10, 11 passed); perf: cold start to Node started median 10.5 s (master 11.1 s, n=4 each); owner() about 5–6 ms of main-thread time per keystroke in the recovery editor, 0 hangs; wipe with an upload held gives up after 30.0 s and retries by itself; wipe without a hold 33.7 s (master 32.4 s), nearly all of it stopNode; l10n: no UI text changed
- Debug builds of head and master on an iPhone 17 simulator, using a CONNECT proxy to refuse, hold or drop replies for the homeserver and the staging VSS/lnurl-auth, and switchable Electrum forwarders.
- Identity outage:
- With the homeserver held from
Full restore success, Home came up 9.6 s later with the balance, Receive and the placeholder profile. - A send during the outage left WALLET pending:
Backup failed … restore Pubky grant session. - After release,
Paykit session restoredcame in 10.1 s, and the retained WALLET backup succeeded with no user action. - A profile load failure while held does not block on-chain sync.
- A relaunch during the outage keeps the saved session and restores it 18.6 s after release, with 0 backup failures.
- With the homeserver held from
- Connection recovery:
- With Electrum unreachable at restore, the error screen shows
ConnectionRecoveryButton. The correction is saved (RecoverySaved), and a failing Retry keeps the editor withRecoveryError. - When the server comes back, an automatic start dismisses the editor, then
Node startedandDeleted connection_recovery. - The correction wins over the restored SETTINGS, and the other preferences match their values before the restore.
- With VSS also refused, restarts and background/foreground cycles keep the error screen and the correction.
- With Electrum unreachable at restore, the error screen shows
- Profile deletion with the reply dropped: the remote profile is gone, the app offers Retry / Disconnect / Cancel, and it never sends a second DELETE or cleanup, after Cancel or after a restart.
- Cleanup failure (homeserver refused): failure options, no contact deletion, the remote profile stays, and nothing is retried after Cancel or a relaunch.
- Driving notes, no change needed:
- The identity-outage header returned 27 s after release, behind queued Paykit operations.
- The WALLET backup succeeded twice after release, not once.
- Saving only the Electrum endpoint did not trigger a SETTINGS backup.
⚠️ Not verified:- J1.5, which would delete the profile the later journeys need.
- Profile-deletion cases that need an active subscription, saved contacts or a TLS stand-in for the homeserver.
- A new wallet created offline: the simulator has no airplane mode.
- The Spark-exit alert fix on device; it is covered by the new unit test.
CI at c569d35: green except one check still pending.
Reviewer model: Opus 5.5 (claude-opus-5-5) coordinating and verifying; Fable 5.2 (claude-fable-5-2) delta review and runbook; Sonnet 5.5 (claude-sonnet-5-5) device driver
Reasoning effort: Not exposed
|
@ben-kaufman please resolve conflicts. |
…y-background Conflicts: the Localizable.strings files keep both sides' new keys. ContactsManager keeps this branch's removal of the missing-data fallback and deleteAllContactsBestEffort, which master had only edited in place. Verified: BitkitTests unit suite and swiftformat --lint on the merged tree
@piotr-iohk Resolved in e624002 by merging master. The |
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: full PR at e6240026, re-reviewed after the comparison base changed from e3d62e2 to 1d9ae7c. No earlier coverage was inherited.
6 actionable findings — resolve or provide an evidence-backed rebuttal.
Try Again on the connection recovery screen reports that the local Lightning node failed whenever that screen stays open, including when the wallet backup restore failed before wallet.start(). The Android twin at 3c2682ac keeps an incomplete restore off the node-error path. Subscription refusal, contact cleanup, backup scheduling, and VSS suspension on that revision did not show a separate defect. Device testing was not performed, and the unit suite was not executed in this review.
Suggested additional test cases
iOS, disposable regtest wallet with a pending VSS restore. Open Connection settings and tap RecoveryRetry while the backup read fails. RecoveryError should describe that restore failure and should not say the local Lightning node could not start. A retry that reaches a running node with no pending restore should leave the recovery screen without that message.
Earlier findings reconciled at this revision: 5 still present.
Findings
- [LOW] Report the real recovery retry failure — inline at
Bitkit/Views/Onboarding/WalletConnectionRecoveryView.swift:80. - [MEDIUM] Unbounded VSS client drain can hang wallet wipe before seed deletion — inline at
Bitkit/Services/VssBackupClient.swift:73. Still present from the earlier review. - [HIGH] Unrecoverable saved Pubky identity permanently blocks wallet and metadata VSS backups — inline at
Bitkit/Services/PrivatePaykitService+Backup.swift:12. Still present from the earlier review. - [LOW] Cover WALLET-success METADATA recovery after the failed job has retired — inline at
BitkitTests/BackupServiceTests.swift:1244. Still present from the earlier review. - [LOW] Preserve InitializingWalletView progress and stop rocket animation when connectionRecovery.isBusy clears — inline at
Bitkit/AppScene.swift:1094. Still present from the earlier review. - [MEDIUM] Raise the backup failure alert after the Spark exit ends — inline at
Bitkit/Services/BackupService.swift:1348. Still present from an earlier unpublished review.
Reviewer model: grok-4.7
Reasoning effort: xhigh
| generation = UUID() | ||
| setups.values.forEach { $0.task.cancel() } | ||
| if activeCalls > 0 { | ||
| await withCheckedContinuation { idleWaiters.append($0) } |
There was a problem hiding this comment.
[MEDIUM] Unbounded VSS client drain can hang wallet wipe before seed deletion
Trigger: A wallet wipe (user-initiated reset or PIN-lockout wipe) starts while an admitted VSS setup or request (vssNewClientWithLnurlAuth, vssNewLdkClientWithLnurlAuth, vssStore, vssGet, vssListKeys, vssLdkGet, vssLdkListKeys, or vssLdkDelete) is stalled on an unresponsive LNURL-auth or VSS server.
Mechanism: WipeCoordinator (Bitkit/Utilities/WipeCoordinator.swift:361-363) enters AppReset.withLocalStateWipeScope (Bitkit/Utilities/AppReset.swift:77-79) starting at .resetLocalServices—before .wipeKeychain deletes seeds—which calls VssBackupClient.shared.withSuspendedClients(steps) without AppReset.bounded. Inside VssClientCoordinator.closeAdmission() (Bitkit/Services/VssBackupClient.swift:68-75), admitted non-setup operations are not cancelled, and closeAdmission() awaits withCheckedContinuation { idleWaiters.append($0) } with no timeout. Even for setup tasks that are cancelled, VssBackupClient.withSetupTimeout (Bitkit/Services/VssBackupClient.swift:359-374) uses withThrowingTaskGroup, which waits for all child tasks to exit before returning/throwing when native UniFFI calls ignore Swift task cancellation, keeping activeCalls > 0 until the underlying Rust/OS network timeout expires.
Consequence: This path would hang wallet wipe at .resetLocalServices (step 4 of 12, before .wipeKeychain removes seeds/credentials) for the duration of the stalled native network request instead of failing cleanly at the 30-second AppReset.waitTimeout so the wipe gate can offer Retry, contradicting the bounded-drain contract enforced on every other wipe dependency in AppReset.swift (connectionRecovery.beginWipe, server settings, PaykitSdkService.withWalletWipe, migration sync, and hardware wallets).
Expected behavior: Bound VssClientCoordinator drain admission during wallet wipe with AppReset.waitTimeout (or a cancellable/timed waiter that restores admission state and throws WipeWaitTimeoutError), matching ConnectionRecoveryService.beginWipe(timeout:) and PaykitSdkService.withWalletWipe(acquireTimeout:), and ensure setup timeouts do not block on uncooperative native child tasks inside withThrowingTaskGroup.
Evidence basis: Source analysis at 697566708c6c06404be854fb2f42c6f02b038444.
Still present at e624002 (first reported at 485a9dc): The unbounded wipe drain is still present at e624002. closeAdmission waits for every admitted call with no deadline, and WipeCoordinator enters that wait from withLocalStateWipeScope at resetLocalServices, before wipeKeychain. Setup uses a 30-second withThrowingTaskGroup, while put, get, and dedicated LDK calls are admitted outside it. The pinned LNURL provider still has no request timeout and is awaited before the VSS client's 10-second deadline, and the Swift async bridge does not forward cancellation. The four review threads on line 73 remain unresolved. synonymdev/vss-rust-client-ffi#36 is still open and unmerged, so this pin does not include it. Severity stays MEDIUM: local wipe is delayed without Retry until the held response finishes or the process restarts. Evidence basis: source analysis at e624002, including the pinned dependency files read from those revisions. No local execution.
There was a problem hiding this comment.
Same finding as the open threads on this line. The bound belongs in synonymdev/vss-rust-client-ffi#36, and this PR is on hold until that release is integrated.
There was a problem hiding this comment.
Confirmed at e624002 with a genuine dedicated-LDK authentication response held during Settings reset: 100.7 seconds after admission closed, reset remained at step 4 with the seed present and no Retry. Releasing authentication completed reset. The cf5b5cdf pin still excludes the open synonymdev/vss-rust-client-ffi#36 fix. This duplicates the existing open finding; no new inline is needed.
| ) async throws -> (state: String?, sdkVersion: UInt64) { | ||
| let initialSdkVersion = await sdkService.backupStateVersion | ||
| guard try await sdkService.currentPublicKey() != nil else { | ||
| guard try !hasStoredIdentity() else { throw PubkyServiceError.sessionNotActive } |
There was a problem hiding this comment.
[HIGH] Unrecoverable saved Pubky identity permanently blocks wallet and metadata VSS backups
Trigger: A wallet has a stored Pubky identity (Keychain .paykitSession, .pubkySecretKey, or AdoptedPubkyReference.current) whose session cannot be restored—for example, a Ring/adopted session revoked on the homeserver with no local secret key, a permanently unreachable homeserver, Paykit state saved by a newer Bitkit version, or a PaykitSdkService.initialize() failure—so PaykitSdkService.shared.currentPublicKey() remains nil.
Mechanism: PrivatePaykitService.backupSnapshot() (Bitkit/Services/PrivatePaykitService+Backup.swift:11-14) now throws PubkyServiceError.sessionNotActive whenever currentPublicKey() is nil and PubkyProfileManager.hasStoredIdentityForBackup() (Bitkit/Managers/PubkyProfileManager.swift:1973-1981) returns true. Every .wallet VSS upload calls PrivatePaykitService.shared.backupSnapshot() (Bitkit/Services/BackupService.swift:1535), so .wallet backups fail with PubkyServiceError.sessionNotActive. BackupService.isTemporaryBackupFailure(_:) (Bitkit/Services/BackupService.swift:657-674) returns false for PubkyServiceError.sessionNotActive, and prepareMetadataBackup (Bitkit/Services/BackupService.swift:631-655) refuses .metadata uploads whenever .wallet is required or fails (MetadataBackupError.walletBackupFailed). Moreover, if PaykitSdkService.initialize() failed, MainNavView.swift:632-633 renders pubkyInitializationErrorView (MainNavView.swift:498-517) which offers only Retry and no Sign Out/Disconnect, and when PaykitFeatureFlags.isUIEnabled == false (MainNavView.swift:630-631) Profile renders ComingSoonScreen() while BackupService still calls backupSnapshot() unconditionally.
Consequence: This path would permanently block VSS backups for ordinary Bitcoin/Lightning wallet and metadata state (WALLET and METADATA—including watch-only accounts, USDT/address reservations, activity tags/metadata, hardware wallet names, and Spark exit/move hashes) for as long as the saved Pubky session cannot be restored, risking loss of newly created wallet state on device loss or restore, with no UI recovery path short of wiping the wallet when SDK initialization fails or Paykit UI is disabled.
Expected behavior: Preserving remote Paykit state during a transient identity outage should not permanently prevent ordinary Bitcoin/Lightning WALLET and METADATA backups (for example, by retaining/reusing the last known Paykit backup payload or separating Paykit snapshot retention from wallet/metadata backup uploads), and any unrecoverable Pubky state should expose a safe disconnect/reset path even when SDK init fails or Paykit UI is disabled.
Evidence basis: Source analysis at 697566708c6c06404be854fb2f42c6f02b038444.
Still present at e624002 (first reported at 111ddd8): Still present at e624002. A saved session that cannot be restored throws from currentPublicKey before the guard. With no saved session, an adopted reference or nonempty credential bytes make hasStoredIdentityForBackup true, currentPublicKey returns nil, and line 12 throws sessionNotActive. Neither error is temporary, so the scheduled WALLET job stops and prepareMetadataBackup keeps METADATA behind it. Sign-out still runs endpoint cleanup before clearLocalAppState, and the initialization error view offers Retry only. Refusing an identity-free replacement remains the intended guard. Severity stays HIGH: a later restore would receive the last uploaded ordinary WALLET and METADATA state while those credentials remain. Seed and LDK channel state do not go through this backup. Evidence basis: source analysis at e624002. No local execution.
There was a problem hiding this comment.
Same finding as the open threads on this line. The guard stays, because without it an identity-free WALLET would replace the last complete Paykit backup, and this PR is on hold until ordinary WALLET and METADATA changes can upload while the identity is unusable.
There was a problem hiding this comment.
Confirmed at e624002 with rejected-session and nil-identity inputs: ordinary reservations remained pending while complete remote WALLET bytes/version stayed unchanged; repairing the original credentials uploaded the reservations. The no-clobber guard must stay, and availability while the identity remains unusable is still unresolved. This duplicates the existing open finding.
There was a problem hiding this comment.
Verdict: ⛔️ Request changes — three unresolved findings remain at e624002: the two existing failures and the newly covered after-exit Spark alert failure.
Findings:
-
HIGH — current ordinary wallet state remains unavailable remotely while retained identity credentials are unusable.
Bitkit/Services/PrivatePaykitService+Backup.swift:12. Both credential-failure inputs kept a new reservation pending and the previous complete WALLET unchanged. Repairing the original credentials uploaded it; availability while they remain unusable is still missing. Keep the no-clobber guard. Existing finding. -
MEDIUM — native authentication can hold reset without Retry.
Bitkit/Services/VssBackupClient.swift:73. With a dedicated native authentication response held, reset stayed at step 4 with the seed present 100.7 seconds after admission closed. Release completed reset. The unchanged VSS cf5b5cdf pin excludes the authentication deadline fix. Keep admission closure and draining intact. Existing finding. -
MEDIUM — an ended Spark exit can keep an overdue backup alert suppressed.
Bitkit/Services/BackupService.swift:1348. With an overdue required SPARK_EXIT, the active-exit guard sets a cached suppression flag. Ending the exit without a new notification or attempt left it required with no alert across the real periodic check. A subsequent failed manual attempt refreshed the flag and immediately emitted the alert. Failed Spark reconnect can produce that notification gap. Keep suppression during an active exit, and refresh it once the exit ends. Existing finding.
QA for e624002:
iPhone 17 Pro 2×, iOS 27.0 Simulator, Xcode 27.0. Built the unmodified head and ran its selected committed regressions. Additional app probes used uncommitted Debug controls over the actual SDK/VSS paths and disposable regtest wallets; USDT used test tokens on an isolated fork. Recordings are 2×. Internal assertions below were checked in saved logs and remote records.
Restore, contacts and backup regressions ✅ Committed regressions passed; checked in finalized XCTest results.
The selected backup, restore, contacts, profile, VSS/wipe, Spark-exit and incoming-payment regressions passed in finalized XCTest results. The recording shows the profile-recovery UI fixture; service assertions came from XCTest. Four SwiftUI State runtime warnings remain in the payment-request tests.
native2x.2x.mp4
Back up ordinary changes while saved identity remains unusable ❌ Both unusable-identity inputs kept newer ordinary state pending until credential repair.
Rejected saved-session/no-secret and nil-identity/retained-unreadable-key inputs each left a new ordinary reservation pending while the complete remote WALLET bytes and version stayed unchanged. Restoring the original credentials uploaded complete Paykit state plus the reservation and cleared pending work. These assertions came from actual SDK/keychain/VSS traces and decoded remote records.
terminal2x.2x.mp4
Reset while native VSS authentication is stalled ❌ Reset waited at step 4 without Retry until authentication was released.
A genuine dedicated-LDK authentication response was held during normal Settings reset. Admission closed with one active call; 100.7 seconds later reset remained at step 4 without Retry and the seed was still present. Releasing the response retired the read and completed reset, clearing the seed and durable intent. Checked UI, coordinator/keychain markers and response-gate logs.
auth2x.2x.mp4
Recover a saved contact while profile sign-in waits ✅ The saved contact remained exactly once through recovery and restart.
One genuinely saved contact remained in SDK storage while final identity activation was held and appeared exactly once after hot restore and cold restart. During the hold, the node ran, required-import markers were absent and profile sign-in remained pending. Automatic recovery completed after transient SharedStateBusy errors. Counts and session state were checked in fresh SDK/UI reads and logs.
contacts2x.2x.mp4
Keep contacts when profile cleanup is incomplete ✅ Incomplete cleanup preserved unacknowledged contacts and stopped profile deletion.
A genuine private-withdrawal failure showed failure options and kept both contacts without reaching profile deletion. A fresh fixture then held background link setup before saving two real SDK contacts; withdrawal checks remained intact. A controlled missing-data error kept both contacts, and a genuine one-contact removal acknowledgement kept the unacknowledged contact. Cancel and cold restart caused no further contact/profile deletion. Checked SDK/UI state and persistent invocation logs.
cleanup-withdrawal2x.2x.mp4
cleanup-contacts2x.2x.mp4
Restore a wallet containing a signed USDT transfer ✅ The signed transfer survived database recovery and restart without another submission.
A genuine signed test transfer produced a VSS recovery record. After clearing only its local USDT database, an injected required-import failure kept wallet actions gated. Retry restored exactly one confirmed transfer while optional identity activation waited; cold restart retained it. Core/VSS readbacks and fixture counters confirmed the result, with one submission before and after recovery. This was recovery on the same wallet, not a fresh mnemonic-only installation.
usdt2x.2x.mp4
Report overdue Spark backup after the exit ends ❌ The overdue backup remained unreported after the exit ended; checked in publisher/status traces.
An isolated overdue SPARK_EXIT fixture ran the actual BackupService while exit activity was controlled through its existing dependency seam. During the active exit, no upload or failure alert occurred. After exit activity became false with no new event or retry, the requirement retained its overdue age and no alert appeared across a real 65-second wait. A manual attempt with an injected upload error then emitted the alert, confirming that the notification path worked. Checked publisher counts and status readbacks in saved logs; the recording shows the app during the probe. This did not drive a funded Spark exit.
spark-alert2x.2x.mp4
Unchanged passing evidence retained:
- c569d35 report: wire-level lost deletion acknowledgement and cancellation/restart, empty-wallet creation during controlled offline startup, and controlled Spark-exit backup deferral.
- 4c9d57d report: listener dirty-state recording after stop, automatic connection-editor dismissal, Retry feedback, and bounded backup quiesce with seed/gate retention and successful Retry.
- 6975667 report: saved corrections across failed required recovery/restart, missing-profile recovery, stale-result rejection and the funded receive/event-acknowledgement case. The implementations supporting these results are unchanged in this delta.
Not driven: funded Spark exits, private outgoing payment/proof replay, or a populated mnemonic-only clean installation. Incoming master send, Spark-exit and profile-link behavior received source and selected native-test coverage, without complete funded app journeys. Mainnet-only pending swaps and physical-hardware journeys were excluded because the required wallets/hardware were unavailable.
Coverage: contiguous c569d35..e624002 plus the earlier open findings, including the contacts and translation conflict resolutions. The merge delta yielded no additional demonstrated defect. The after-exit alert concern raised during this run predates that delta and is now covered above.
Accepted follow-ups remain closed: retry-error wording in #1548, METADATA unit coverage in #1231 and initialization animation in #1158.
Twin: synonymdev/bitkit-android#1686 at 3c2682a retains the matching complete-WALLET guard for stored identity. This is source parity, with no new Android runtime claim.
Reviewed by gpt-6.1-sol-high
The failure check skipped SPARK_EXIT on a flag that only a backup run reaching the exit check updated, so after an exit ended with no further run the flag stayed set and an overdue backup never raised the alert. The alert now asks whether an exit is active when it fires. Verified: BitkitTests unit suite (new latch test fails on the previous BackupService, passes here) and swiftformat --lint
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: changes since e62400266, including the Spark exit backup-failure alert path, at 75da1b242. Baseline: previous review. Unchanged coverage from that baseline is inherited.
No new actionable code findings.
The alert now reads whether a Spark exit is active when it is raised. An overdue SPARK_EXIT backup can raise Data Backup Failure after the exit ends, including when the next attempt fails before the exit check and schedules no retry. While an exit is active, SPARK_EXIT stays out of the failure check. Other categories still raise the alert on their own.
Compared with bitkit-android#1686 at 3c2682ac, only this failure-alert contract. Android counts an overdue SPARK_EXIT backup during an active exit. iOS leaves that category out while an exit is active, matching the deferral rule in BackupService. That comparison is not a full review of the Android pull request.
Device testing: not performed in this review. testAnOverdueSparkExitBackupRaisesTheFailureAlertOnceTheExitEnds and the existing active-exit suppression test were read at this revision and not executed here; this environment has no iOS toolchain.
Earlier findings reconciled at this revision: 5 still present, 1 verified fixed.
Existing concerns
- [MEDIUM] Unbounded VSS client drain can hang wallet wipe before seed deletion — The unbounded wipe drain is still present at 75da1b2. closeAdmission waits for every admitted call with no deadline, and WipeCoordinator enters that wait from withLocalStateWipeScope at resetLocalServices, before wipeKeychain. Setup uses a 30-second withThrowingTaskGroup, while put, get, and dedicated LDK calls are admitted outside it. The e624002..75da1b2 diff does not touch this path. Package.resolved still pins vss-rust-client-ffi cf5b5cdf, and synonymdev/vss-rust-client-ffi#36 is open and unmerged at 1a5b788c. Threads #1121 (comment), #1121 (comment), #1121 (comment), #1121 (comment), and #1121 (comment) are unresolved and not outdated. The author says this pull request stays on hold until that release is integrated. A focused issue search returned 0 issues. Severity stays MEDIUM. Evidence basis: source analysis at 75da1b2. I did not run the reset. ovi-reviewer attributes a 100.7-second hold at e624002, which is not this head.
- [HIGH] Unrecoverable saved Pubky identity permanently blocks wallet and metadata VSS backups — Still present at 75da1b2. A saved session that cannot be restored throws from currentPublicKey before the guard. With no saved session, an adopted reference or nonempty credential bytes make hasStoredIdentityForBackup true, currentPublicKey returns nil, and line 12 throws sessionNotActive. Neither error is temporary, so the scheduled WALLET job stops and prepareMetadataBackup keeps METADATA behind it. Sign-out still runs endpoint cleanup before clearLocalAppState, and the initialization error view offers Retry only. Refusing an identity-free replacement remains the intended guard. The follow-up does not change this refusal. Threads #1121 (comment), #1121 (comment), #1121 (comment), #1121 (comment), and #1121 (comment) are unresolved and not outdated. The author says the guard stays and the pull request is on hold. Issue search returned only #868, which is contact-payment latency. Severity stays HIGH. Evidence basis: source analysis at 75da1b2. I did not run a backup.
- [LOW] Cover WALLET-success METADATA recovery after the failed job has retired — The coverage gap remains at 75da1b2. testWalletRecoveryResumesMetadataAfterFailedJobRetires holds the failed METADATA job, triggers WALLET recovery, and only then releases retirement. Removing the WALLET-success resume would still leave the retirement re-check able to schedule METADATA, so this test does not fail for that removal. #1231 is open in milestone 3.3.0. Its only comment moves the milestone and does not add the test. Threads #1121 (comment) and #1121 (comment) are resolved and not outdated because that issue tracks them. The threads are not unresolved. Severity stays LOW: BackupService contains the WALLET-success wake, and this is unit coverage rather than a separate product failure. Evidence basis: source analysis at 75da1b2.
- [LOW] Preserve InitializingWalletView progress and stop rocket animation when connectionRecovery.isBusy clears — Still present at 75da1b2. AppScene.swift:1094 attaches .id(connectionRecovery.isBusy) to InitializingWalletView. When perform finishes and sets isBusy false, SwiftUI recreates the view and its percentage state starts again at 0. onDisappear invalidates the timer and does not set shouldStopAnimation. #1158 is open in milestone 3.3.0. Thread #1121 (comment) is resolved and not outdated because that issue tracks it. The thread is not unresolved. Severity stays LOW: progress resets and the rocket animation can continue, with no lost wallet state. Evidence basis: source analysis at 75da1b2.
- [LOW] Report the real recovery retry failure — Still present at 75da1b2. Tapping Try Again awaits onRetry and then assigns other__lnurl_ln_error_msg whenever the editor is still current. retryWalletStart clears connectionEditor only when the node is running, restore is not pending, and didWalletBackupRestoreFail is false, so a failed restore keeps the recovery screen and shows the Lightning-node wording. Thread #1121 (comment) is resolved and not outdated: the author deferred it as out of scope, and ovi-reviewer accepted that follow-up. The thread is not unresolved. #1548 is open in milestone 3.3.0 and tracks the same wording. The e624002..75da1b2 diff does not change this screen. This pull request adds the screen and the assignment, so the concern is not outside the pull request. Severity stays LOW. Evidence basis: source analysis at 75da1b2. I did not run the retry.
Reviewer model: grok-4.7
Reasoning effort: xhigh
|
Moved to 3.3.0: the HIGH terminal identity finding needs a restore contract change, and the VSS auth wait needs synonymdev/vss-rust-client-ffi#36, then a vss-client release and pin bumps in both apps. Neither can land before the 3.2.0 release, and 3.2.0 RC1 is already cut without this PR. |
|
@ben-kaufman please resolve conflicts. |
…y-background Master removed move to Spark, so BackupService drops this PR's MoveToSparkPayments metadata observer along with it. Verified: BitkitTests (5 local-regtest integration tests need a local electrs and did not run)
|
Merged master into this PR in 3af88ff to clear the new conflict. The only conflict was in |
There was a problem hiding this comment.
Verdict: ⛔️ Request changes — the two acknowledged backup/reset failures still reproduce at 3af88ff. No additional merge-specific defect was demonstrated.
Findings:
- HIGH — unusable retained identity still blocks current ordinary backups.
Bitkit/Services/PrivatePaykitService+Backup.swift:12. Rejected-session/no-secret and nil-identity/unreadable-key inputs each kept a new reservation pending while the previous complete remote WALLET bytes and version stayed unchanged. Repairing the original credentials uploaded it. Keep the complete-backup guard; ordinary state still needs to remain recoverable while the identity stays unusable. Existing finding. - MEDIUM — stalled native authentication still holds reset without Retry.
Bitkit/Services/VssBackupClient.swift:73. Reset waited at step 4 with the seed retained while the admitted dedicated-LDK authentication response remained held. Releasing it completed reset. VSS rc3 adds key-domain selection but excludes the authentication deadline fix. Keep admission closure and draining intact. Existing finding.
QA for 3af88ff:
iPhone 17 Pro 2×, iOS 27.0 Simulator, Xcode 27.0. Built the unmodified head and ran committed regressions. Additional app cases used uncommitted Debug controls over actual SDK/VSS paths and disposable regtest wallets; USDT used test tokens on an isolated fork. Recordings are 2×. Internal assertions were checked in saved execution traces, remote records and fixture counters.
Restore and backup regressions at the merged head ✅ Committed backup, restore and node regressions plus profile-recovery UI passed; checked in finalized XCTest.
Unmodified 3af88ff built and selected restore, backup, profile, contacts, VSS/wipe, Spark-exit and node lifecycle regressions plus the ProfileRecovery UI case passed in finalized XCTest results. No test failures, skips or reported runtime warnings in the result summary. The recording shows the UI fixture; internal assertions were checked in XCTest.
native2x.2x.mp4
Back up ordinary changes while saved identity remains unusable ❌ Both unusable-identity inputs kept newer ordinary state pending until original credentials were repaired.
Both rejected saved-session/no-secret and nil-identity/retained-unreadable-key inputs kept a new ordinary reservation pending while the previous complete remote WALLET bytes and version stayed unchanged. Repairing the original credentials uploaded complete Paykit state plus the reservation and cleared pending work. Verified actual SDK/keychain/VSS traces and decoded remote records; availability while credentials remain unusable is still missing.
terminal2x.2x.mp4
Reset while native VSS authentication is stalled ❌ Reset stayed at step 4 without Retry until the native authentication response was released.
A genuine dedicated-LDK authentication response held Settings reset at step 4 without Retry. At 100.5 seconds after VSS admission closed with one active call, the seed and durable wipe intent were still present. Releasing authentication retired the read as CancellationError and completed reset, clearing the seed and intent. Checked normal UI, coordinator/keychain markers and native response-gate logs.
auth2x.2x.mp4
Report overdue Spark backup after the exit ends ✅ The periodic check raised the overdue alert after the exit ended, without another attempt; checked in publisher/status traces.
An isolated overdue SPARK_EXIT fixture ran the actual BackupService with its existing exit-state dependency seam. Active exit deferred without upload or alert. After exit activity became false without notification or retry, the periodic check emitted the failure alert while pending age stayed unchanged and no upload ran. Checked publisher/status traces; no funded exit was driven.
spark-alert2x.2x.mp4
Recover a wallet containing a signed USDT transfer ✅ Required recovery restored the signed transfer once and cold restart submitted nothing again; checked in native records and fixture counters.
A genuine signed test-token transfer produced one VSS recovery record. Clearing its local USDT database left zero transfers. Injected required-import failure kept WALLET/USDT markers and recovery UI; Retry restored one confirmed transfer while optional identity activation remained held. Cold restart retained exactly one transfer with the node running. Fixture submission count stayed one. Checked native/VSS readbacks, UI and fixture counters.
usdt2x.2x.mp4
Recover saved connection settings after required restore fails ✅ The correction survived failed required restore and restart, then automatic recovery closed the editor; checked in UI and persisted markers.
The acknowledged old SETTINGS backup contained a failing Electrum address. Saving a reachable correction retained its revision through failed required-WALLET retry and cold restart, with the WALLET gate still set. Restoring connectivity then completed required imports, started the node, automatically closed the editor, cleared the correction and retained unrelated restored hide-balance settings. Checked recovery UI and persisted markers/logs.
connection2x.2x.mp4
Restore the populated backup on a clean installation ✅ A clean installation recovered the populated backup before optional sign-in completed; checked in UI, native readbacks and fixture counters.
A clean installation restored the recovery phrase and actual remote WALLET, identity, contact and signed-USDT data with the source app stopped. Node and ordinary wallet access recovered while final identity activation remained held; required markers were absent and the matching outgoing transfer appeared once. Releasing identity recovered one contact. Cold restart retained the node, contact and transfer; a transient SDK read lock required a later readback. Fresh sync also found the fixture funding deposit; submission count remained one.
mnemonic2x.2x.mp4
mnemonic-cold2x.2x.mp4
Unchanged passing evidence retained after source comparison:
- e624002 report: populated contact recovery and incomplete profile/contact cleanup, including partial native acknowledgement and restart.
- c569d35 report: wire-level lost deletion acknowledgement and cancellation/restart.
- 6975667 report: backup admission cancellation, cleanup with newer pending edits, automatic Tags recovery, missing-profile recovery and stale-result rejection.
- Merged backup-shutdown report: final-acknowledgement ownership, USDT recovery while observation is stopped and repeated stop/start marker retention. Later admission changes are covered by the 6975667 report above.
Not driven: funded Spark exits, complete funded outgoing payment/proof journeys, mainnet-only pending swaps or physical-hardware journeys. Those broader master/hardware cases were outside this restore/backup delta. Mainnet fixed-domain authentication was source-checked; device runs used the regtest domain path. Incoming master send/proof/Spark behavior received source review; the selected native run also covered changed node-start and Spark-exit boundaries.
Coverage: contiguous 75da1b2..3af88ff plus the earlier open findings, including the master-merge conflict that removes the deleted Move to Spark metadata observer. The live Spark alert fix is verified above. Accepted follow-ups remain closed: retry-error wording in #1548, METADATA unit branch coverage in #1231 and initialization animation in #1158.
Twin: synonymdev/bitkit-android#1686 at ae662862b retains the matching complete-WALLET guard and ordinary-backup availability limitation. This is source parity only.
Reviewed by gpt-6.1-sol-high
piotr-iohk
left a comment
There was a problem hiding this comment.
QA review
Scope: full PR at 3af88fff, re-reviewed after the comparison base changed (1d9ae7cd → 4ca0ffd8) and target-branch changes touched reviewed files including Bitkit/AppScene.swift and localization files.
No new actionable code findings.
Two actionable code findings remain in source analysis at 3af88fff: a HIGH backup durability gap where any unrecoverable stored Pubky identity permanently blocks both WALLET and METADATA backups while the user continues using Home, and a MEDIUM wallet-reset hang where VssClientCoordinator.closeAdmission() waits without a timeout for stalled native VSS/LNURL-auth calls (confirmed against pinned vss-rust-client-ffi 0.5.26-rc3 at 3baf76dd, which runs rt.block_on with no reqwest client timeout).
Other changed surfaces—background profile initialization/reconnect recovery (PubkyProfileManager), connection recovery UI and persistence (ConnectionRecoveryService, WalletConnectionRecoveryView, AppScene), serialized backup observation and Spark exit backup deferral/alert gating (BackupService), cached Blocktank read protection, Paykit SDK wipe lock admission (PaykitSdkOperationLock), active-subscription and incomplete-cleanup profile removal guards (EditProfileView, ContactsManager, PubkyService), and MainActor LDK event delivery (LightningService, WalletViewModel)—checked out cleanly in source analysis.
Twin comparison: Checked shared restore, connection recovery, VSS client coordination, and profile cleanup contracts against twin synonymdev/bitkit-android#1686 at ae662862. Shared WalletConnectionRecovery accessibility identifiers and active-subscription/cleanup refusal rules align; Android additionally carries separate durable profile-removal recovery (ProfileRemovalCoordinator / ProfileRemovalStore) outside this iOS PR's scope. Source inspection does not establish visual or runtime equivalence.
Validation & limitations: Local node scripts/validate-translations.js (0 errors) and git diff --check passed at 3af88fff. On GitHub CI for 3af88fff, SwiftFormat and validate succeeded, while Run Tests, Run Integration Tests, and build-local were still in progress at review completion. Native Xcode compilation and XCTest execution were not run locally (Linux review environment).
Recommended before device testing:
- Resolve or explicitly address the two findings above (ordinary
WALLET/METADATAbackup availability under terminal Pubky identity failure, and bounded VSS drain during wallet reset atresetLocalServices). - Wait for Run Tests and Run Integration Tests on 3af88fff to complete and verify green results.
Device testing: not performed in this review.
Suggested additional test cases:
- iOS — Wallet reset with stalled VSS/LDK-VSS auth response: On a disposable regtest wallet pointing LNURL-auth at a proxy that holds the HTTP response, start a VSS or LDK-VSS debug read and immediately trigger Reset Wallet. Expected: wallet reset reaches
resetLocalServices, times out after the bounded wait (30 s) without wiping credentials, and presents Retry; releasing the stalled response allows Retry to finish cleanly. - iOS — Overdue
SPARK_EXITbackup alert after an active exit ends: On a disposable regtest wallet with an active Spark exit exceeding the 30-minute backup failure window, confirm noData Backup Failurealert fires whileSparkExitManager.shared.isExitingis true, then finish or cancel the exit while keeping VSS upload blocked and confirm the overdueSPARK_EXITbackup raises the failure alert once the exit is no longer active.
Earlier findings reconciled at this revision: 4 still present, 2 duplicate.
Findings
- [HIGH] Unrecoverable stored Pubky identity permanently blocks WALLET and METADATA backups — now at
Bitkit/Services/PrivatePaykitService+Backup.swift:12. Same issue as the earlier review. - [MEDIUM] Wallet reset waits indefinitely at resetLocalServices when an admitted VSS call stalls — now at
Bitkit/Services/VssBackupClient.swift:73. Same issue as the earlier review.
Existing concerns
- [LOW] Cover WALLET-success METADATA recovery after the failed job has retired — The unit coverage gap remains at 3af88ff. testWalletRecoveryResumesMetadataAfterFailedJobRetires (BitkitTests/BackupServiceTests.swift:1244-1307) still holds the failed METADATA job in waitForScheduledBackupCompletion (:1263-1267), triggers WALLET recovery (:1282), and only then releases retirement (:1289, :1292). Removing the WALLET-success resume at BackupService.swift:623-625 would still leave the retiring-job re-check at :1306-1308 able to schedule METADATA, so the test does not fail if the WALLET-success wake regresses. Tracking issue #1231 remains open in milestone 3.3.0, and review threads #1121 (comment) and #1121 (comment) are marked resolved (not unresolved) because that issue tracks the deferred follow-up under Out of Scope. Severity stays LOW because BackupService.swift implements the WALLET-success wake and this is a unit-test coverage gap. Evidence basis: source analysis at 3af88ff.
- [LOW] Preserve InitializingWalletView progress and stop rocket animation when connectionRecovery.isBusy clears — Still present at 3af88ff. Bitkit/AppScene.swift:1094 still attaches .id(connectionRecovery.isBusy) to InitializingWalletView. When ConnectionRecoveryService.perform finishes and clears isBusy (:111, :127), SwiftUI recreates InitializingWalletView with percentage reset to 0 (InitializingWalletView.swift:6,19), and .onDisappear (:144-146) invalidates timer without setting shouldStopAnimation = true (assigned only at :30 in handleCompletion). Tracking issue #1158 remains open in milestone 3.3.0, and review thread #1121 (comment) is marked resolved (not unresolved) because that issue tracks the deferred follow-up. Severity stays LOW: visual progress reset and continued rocket animation loop with no wallet data impact. Evidence basis: source analysis at 3af88ff.
- [LOW] Report the real recovery retry failure — Still present at 3af88ff. Tapping Try Again in WalletConnectionRecoveryView (:72-82) awaits onRetry() and unconditionally assigns error = t("other__lnurl_ln_error_msg") at line 80 whenever recovery.isCurrent(editor) remains true. In AppScene.retryWalletStart (:1462-1467), connectionEditor is cleared only when the node is running, restore is not pending, and didWalletBackupRestoreFail is false, so a failed restore keeps the recovery screen visible with Lightning-node failure wording. Tracking issue #1548 remains open in milestone 3.3.0, and review thread #1121 (comment) is marked resolved (not unresolved) because the follow-up is deferred under Out of Scope. Severity stays LOW. Evidence basis: source analysis at 3af88ff; no local execution.
- [LOW] List merged journeys J2-J4 under #### Journeys in the PR body — Still present at 3af88ff. In review #1121 (review) (and repeated as still open in #1121 (review)), jvsena42 noted that this PR ships three additional journeys from the merged stacked PRs (connection-recovery.xml, delete-profile-uncertain-response.xml, and profile-cleanup-failure.xml) while #### Journeys in the PR body lists only J1 — restore-during-identity-outage.xml. AGENTS.md at 3af88ff specifies that a PR with user-visible changes lists the journeys it adds or updates under #### Journeys in the PR body as the QA contract. Neither the PR body #### Journeys section nor #### Out of Scope lists J2-J4 or a follow-up issue, and a focused GitHub issue search found no tracking issue. Severity is LOW: QA contract documentation omission in the PR body with no runtime defect. Evidence basis: live PR body inspection and git diff 4ca0ffd..3af88ff.
Reviewer model: gemini-4-neon
Reasoning effort: high
jvsena42
left a comment
There was a problem hiding this comment.
Re-review of 75da1b2 and the master merges since my approval at c569d35. Nothing above LOW; approving at 3af88ff.
- 75da1b2 (backup failure alert after a Spark exit):
- A SPARK_EXIT failure deferred during the exit keeps
requiredand its age (BackupService.swift:552, catch at:589-596). - Once the exit ends, the live
isSparkExitActive()read at:1345stops excluding it, so the alert is delayed, not lost. - No latch is left to go stale:
isSparkExitDeferredByExitand its lock have no references. shouldNotifystill enforces the 10-minute interval, so there is no double alert.- A backup that succeeds after a suppressed failure clears
required. - After a relaunch mid-exit the alert is suppressed from the start, because the exit record loads in
SparkManager.startbefore observing begins. - Wipe or wallet change:
shouldSkipBackup()before the await, thenisObservingplus the scheduling generation after it.
- A SPARK_EXIT failure deferred during the exit keeps
- e624002:
- Conflicts only in
ContactsManager.swiftand 15Localizable.strings. - The strings keep both sides' keys.
- ContactsManager keeps the PR's removals and master's
pruneUnsavedContactStateseam (:480,deleteAllContacts).
- Conflicts only in
- 3af88ff:
- The one
BackupService.swiftconflict drops the PR'sMoveToSparkPayments.savedPublisherlistener, matching master's removal of move-to-Spark in #1567. - No
MoveToSparkPaymentsreferences remain.
- The one
- No persisted-state change since v3.1.1.
perf: not relevant for this delta. It adds one main-actor read per failure check (at most once a minute) and removes a lock.
Device gate: c569d35 results stand. The delta touches only the backup alert during and after a Spark exit, and the merges carry master's own changes.
testAnOverdueSparkExitBackupRaisesTheFailureAlertOnceTheExitEnds.
My earlier LOW on the #### Journeys list (J2–J4) is still open in my earlier review body.
CI at 3af88ff: green.
Reviewer model: Opus 5.5 (claude-opus-5-5) coordinating and verifying; Fable 5.2 (claude-fable-5-2) delta review
Reasoning effort: Not exposed
Fixed-amount USDT Back test on
0ad55417The earlier hosted test reached the $1.23 confirmation screen and failed to return to recipient entry after tapping Back. The loading view was already visible while the quote was still being prepared. The updated test waits for either quote details or an enabled “Try Again” button after an error. It checks that the Back button belongs to the foreground Confirm header and is enabled, then verifies that the recipient can change and the editable amount reaches $1.234567.
The local focused case and full suite exercised the quote-error path on iOS 26.2. The full suite passed 3,172 distinct tests with five skips. The first focused attempt exposed that SwiftUI can give “Try Again” the parent’s accessibility identifier. The final test recognizes both representations.
GitHub tested merge
c7dad62eagainst master90949e4aon iPhone 17 / iOS 26.5. The changed case and all three backup restart controls passed. The hosted unit suite recorded 3,210 distinct passes, five skips and zero retries. Ten runtime warnings and two AppIntents build warnings remain documented. The cause of the earlier hosted Back failure remains unconfirmed. Hosted unit runAll 30 integration tests passed. The external E2E suite passed 13 cases on its first attempt and skipped one hardware-wallet transfer. SwiftFormat reported zero findings across 852 checked files. Translations reported 17 existing warnings, and the branch condition skipped nine migration jobs. The earlier camera failures, terminal-identity backup limitation and pending VSS authentication fix remain recorded below. Integration run · External E2E run
Backup observation restart at
eff0dadfAn ordinary stop and restart can leave a tag backup pending after the wallet backup has recovered. The scheduler now checks which observation owns the work before admitting or retiring it. When cancellation interrupts a scheduled delay, the next observation can pick up the pending backup. An older operation finishing late leaves the successor’s task and timestamps intact.
Three new simulator tests cover a retiring METADATA task after a WALLET dependency failure, cancellation during the scheduled delay, and restart while a cancelled METADATA read drains. All three passed. The local iPhone 16 / iOS 26.2 run recorded 3,201 passing executions across 3,172 distinct cases, five skips and zero failed cases. The camera case dismissed its permission prompt. XCTest retried one earlier keypad tap inside that case. SwiftFormat reported zero findings across 851 files. The audit retained 19 runtime warnings, including two that had not appeared for those tests in the earlier comparison run.
The authenticated terminal-identity and VSS timeout findings remain open. The three new tests use controlled backup operations. The earlier reviewer’s device evidence and the separate manual recovery gap are documented below.
GitHub tested tree
4d4d1636with master90949e4aon an iPhone 17 simulator running iOS 26.5. All three stop/restart controls passed on the first attempt. The unit workflow recorded 3,209 distinct passes, one failure and five skips. In the USDT test, camera permission succeeded and manual entry reached the $1.23 confirmation. After Back, Confirm still showed a connection error and the recipient field did not return (line 309). The synthesized tap landed at the foreground Back button. Its enabled state and callback delivery at tap time are unknown. This is a different failure from the two earlier camera-prompt failures. The test and the three routing/view files match the live base. Unit runAll 30 integration cases passed. E2E passed 13 cases and skipped the source-disabled hardware transfer. SwiftFormat reported zero findings in 852 files, translations reported zero errors and 17 hidden warnings, and the nine release-only migration jobs skipped. The complete first-run diagnostics retain ten unit runtime warnings, four integration QoS warnings, the integration setup probe error, E2E log-capture restarts and tap-helper retries. Integration · E2E
Tags recovery and open findings at
1c3cde65After a WALLET backup succeeds, Bitkit schedules any METADATA backup that was waiting for it. In the external iPhone simulator test, restoring the original credentials triggered the WALLET upload. Tags followed 5.2 seconds later while the app stayed in the foreground. A fresh remote read contained the new tag, and both pending flags cleared. The reviewer used Debug controls on this head to stage the failure and inspect the remote records. Review and execution traces
Two findings remain open. With an invalid saved session and no local secret, an ordinary reservation stayed pending and the previous complete remote WALLET stayed byte-identical. Profile → Disconnect encountered an identity error during private endpoint cleanup, before local sign-out. Separately, holding the dedicated LDK client’s authentication response kept reset at step 4 of 12 for 113.6 seconds after admission closed. Releasing the response let reset finish. This app still pins VSS
eba41ef6. Terminal identity finding · Reset finding · VSS timeout fixLocal validation passed 3,169 distinct tests with five skips. Hosted native CI recorded 3,221 passing executions, five skips and one failure. The camera permission dialog remained open after Allow. Integration recorded 30 passes with one sync-helper retry. End-to-end CI recorded 13 eventual passes, including the RBF case on its configured retry, and one unrun case. Hosted native job
João reran the failed native job on the same checkout. Attempt 2 again recorded 3,221 passing executions, five skips and one failure. The USDT test tapped Allow, but the camera prompt stayed open and the manual-entry checks were never reached. The cause is still open. Second native attempt
Expired cleanup admission composition — November 5
Signed
485a9dc12f71c4c2763c72384782b2d06c1c017fintegrates #1120 at1b88e0bd25dfc8c13e225e93d1b161915d9a98ee. Cleanup rechecks cancellation and the original wipe owner after suspended revision/capability reads and before each private recovery or withdrawal. This child retains its VSS admission closure, reset drain and original signer/store binding through local erase. The complete child delta is preserved; an affected integration review is clean, reusing the two independent reviews of identical parent source.The actual combined tree
0b0e402434b7351d30623207a6eeb60fbf8e2e59passed 3,133 unique tests, zero failures and five explicit skips on Xcode 27.2 with preserved iOS 26.2 (23C54). All four incoming regression cases pass, all 1,721 frozen inputs match, and full SwiftFormat reports 0/851. Translation validation has zero errors and 17 findings verified against the actual parent. Complete native logs, nested results and attachments are audited inwork/validation/ios1121-revision-admission-20261105/final-audit/. The audit retains 24 runtime warnings (23 QoS, one SwiftUI State), one internal N3 tap retry and explicit fixture/export limitations; no cause or harmlessness is inferred. No whole-test retry occurred. Skips and four workflow-excluded integration suites are not passes.All 18 live-base commits verify locally and on GitHub. Current-head native CI and SwiftFormat passed on attempt 1;
draft=false. Native results are 3,122 unit and 40 physical UI passes (3,133 unique passes), five skips, zero failures and no method or tap retries. Hosted formatting is 0/851 with 113 configured exclusions; nine migration jobs skipped. Synthetic checkoute66ffeb0312943623a7299aaf7ad6bfdc767177fexactly matches the published tree and live parent. Complete logs, 17 annotations, nested results and all attachments are inspected; all 9,849 sealed evidence members verify. The 286 distinct linker warnings match the actual parent. Runtime advisories and disabled detectors remain qualified; no new compiler/format violation was found. Hosted report:work/validation/hosted-ios1121-485a-20261105/report.json. Existing named reviewer representation is preserved. This fixes the separate stale-cleanup entry gap; an already-started native operation may still finish. It does not establish running-LDK quiescence, authenticated full J1, literal wallet wipe or terminal complete-WALLET availability. The terminal-identity finding remains open, and earlier evidence below keeps its original revision and scope.The external review 5779261679 was independently checked against its exact three-file DEBUG overlay and two supplied clips. It visually corroborates reset reaching a replacement wallet’s Receive screen, with selected trace evidence of a held revision read resuming into canceled admission. Its terminal-identity clip and resolver trace support the existing finding, but optional before/after equality also permits two missing WALLET records, and no post-repair remote read is supplied. Original executable/full process and remote-version bindings are unavailable. These are bounded external observations, not a new author runtime pass or complete-WALLET acceptance. The finding remains open; no repeated reviewer request was generated.
Hosted validation of the concurrent-reset fix — November 4
At signed
bf4061f50acffd64fde206a4da1afe380895934b, native CI and SwiftFormat passed on attempt 1. The synthetic tree exactly matches the locally validated tree and live #1120 parent36999f7d21a72791cb72d634db7e9cf65d09e161. Canonical results: 3,118 unit plus 40 physical UI passes, five fixture skips, zero failures or method retries. All nine VSS coordinator and 23 wipe coordinator cases passed. SwiftFormat 0/851; nine migration jobs skipped. Complete logs, all nested result references, 6,489 artifact entries and 9,810 sealed evidence members are inspected and verified.The audit retains 572 linker warnings, simulator/runtime diagnostics and disabled runtime detectors. Direct annotation export was unavailable; complete job logs and canonical diagnostics were inspected. The passed real-node test covers failed startup, not running-LDK quiescence. The terminal-identity complete-WALLET finding remains open. This publication fixes the separate concurrent-reset finding and composes the validated parent; it does not claim that broader recovery work is finished.
Durable wipe composition and concurrent reset — November 4
Commit
bf4061f50integrates parent #1120 at36999f7d2with the durable wipe coordinator. VSS admission closes after node-stop/remote-endpoint cleanup and remains closed through local credential removal and commit. Admitted setup/operations drain before slot retirement. A concurrent reset now finishes before this scope enters, instead of rejecting the wipe; the step remains attributable and retryable. This addresses João’s comment 4466350265.The final composed tree
fdb02abcdpassed 3,118 units plus 40 physical UI executions on Xcode 27.2 with preserved iOS 26.2 (23C54): 3,129 unique passes, five explicit skips, no test failures or whole-test retries. All 1,721 frozen inputs matched. SwiftFormat 0.64.0: 0/851; translations: zero errors and 17 warnings verified against the actual base. Both negative controls fail at the intended boundary, and the corrected focused gate passes 62 cases. Two independent affected source reviews are clean.Complete logs, nested XCResults and attachments are audited and 27,103 evidence files sealed. Thirty runtime warnings (29 QoS, one SwiftUI State), one internal tap retry and simulator/diagnostic limitations remain recorded without a harmlessness or causation claim. Five explicit skips and four excluded integration suites are not passes. Local evidence:
work/validation/ios1121-wipe-parent-final-audit-20261104/report.md. All 17 current-base commits verify locally and on GitHub.draft=false; newly triggered hosted CI is pending inspection. Earlier evidence below retains its original revision and scope; prior approvals are stale for this new head.This does not establish literal wallet wipe, authenticated full J1, terminal complete-WALLET availability or actual running LDK quiescence. Those gaps remain distinct and open.
VSS client retirement — November 4
Commit
25f25eaedcloses app/debug VSS admission during reset, drains admitted setup and native operations before clearing both slots, and rejects results or failures from the retired generation. The wipe caller keeps admission closed throughout its existing credential-removal procedure. Setup derives the store ID from the same captured mnemonic/passphrase as the signer, avoiding the independently cached wallet-index lookup. Ordinary calls remain concurrent; compound list/delete operations retain one admission.The original setup race was reproduced: reset returned while setup was pending, then its late completion suppressed replacement setup. The final candidate passed 2,964 selected unit tests and one ProfileRecovery UI test, including all eight ownership controls, with one explicit opt-in USDT fixture skip, zero failures/retries. SwiftFormat 0.64.0 reports 0/830 files requiring changes. Complete 21,942-line logs and all nested XCResult diagnostics were inspected: two inherited AppIntents notices and five DHT QoS observations remain, without a timing-cause claim or introduced Swift compiler finding. Earlier test-harness failures and the corrected checks remain preserved. Evidence:
work/validation/ios-vss-owner-diagnostics-20261104/report.md.Two independent source reviews are clean. All 16 live-base commits verify locally and on GitHub; base
689ec4e39,draft=false. Hosted native CI passed 2,964 unit tests plus 39 UI executions, with five explicit skips, zero failures and no whole-test or workflow reruns. One XCTest internal tap retry remains recorded. SwiftFormat passed 0/830. Nine skipped integration jobs are not passes.Complete logs, all nested results, diagnostics and 67 attachments were inspected; the artifact SHA-256/ZIP CRC checks and all 18,613 sealed evidence files were verified. Hosted synthetic merge
4b16f323contains the live parent's diagnostic attachments around four existing test waits inPaykitPaymentRequestServiceTests.swift; its production sources, dependency pins, project and workflows match the published head. The 286 structured native linker warnings match unchanged dependency inputs. Simulator/system observations and fault-test error messages remain recorded without a blanket harmlessness claim. Missing USDT fixtures and disabled hardware cases remain skips. Evidence:work/validation/hosted-ios1121-25f2-20261104/REPORT.md.João approved this exact head in review 5766857669; Ovi remains pending. The automated review 5766769506 reports separate positive/negative controls and simulator recovery attempts. Those claims remain attributed external evidence: the author has not inspected their raw execution artifacts, and they do not close the terminal complete-WALLET finding.
This finite fix does not prove literal wallet wipe, authenticated full J1, complete-WALLET migration or running LDK quiescence. It changes no capability header, SDK version or server activation. The terminal complete-WALLET finding below remains open; earlier runtime evidence remains bound to its recorded revision.
Earlier-head hosted validation — November 3
At
b9f3bbda22cf8010e79c2c6bd24b69002f543be7, native run 41667625486 passed 2,956 unit tests and 39 UI executions, with five explicit fixture/hardware skips and no failures or retries. The 30 launch executions are 15 locale × two appearance configurations. Formatting is 0/829. Full logs, archive integrity, every nested result and diagnostic signature were inspected; 9,313 evidence payloads were verified. The exact synthetic tree additionally contains the live parent's unrelated failure-stage test wrapper; it is not asserted identical to the local tested tree.The 286 distinct linker messages match sealed prior provenance and actual-base dependency/project inputs. Simulator, keyboard/gesture, SwiftUI and other runtime observations remain documented; no warning-free or runtime-detector-clean claim is made. Skipped migration/fixture cases and the terminal complete-WALLET finding remain uncovered. This validates the finite cache-read refusal/recovery fix without closing that separate finding. Evidence:
work/validation/hosted-ios1121-b9f3-20261103/REPORT.md.Cached Blocktank backup protection — November 3
Signed
b9f3bbda22cf8010e79c2c6bd24b69002f543be7prevents an unreadable cached Blocktank info record from being encoded as legitimate absence. All cached reads must succeed before upload; genuinely absent optional info remains valid. Orders and CJIT explicitly request cached reads. The released Core already read their nil-ID calls locally, so this is not a claim that a network-refresh failure was repaired. Existing payload format, cancellation, restore admission and complete-WALLET gates are preserved.Actual app capture wiring with the released native SQLite bridge is covered by
BlocktankBackupTests: a cached order plus absent info backs up successfully; separate unavailable orders, CJIT and info tables refuse replacement, retain the acknowledged revision and pending work, and permit explicit retry after restoring the same table. The corrected before-control passed the absent-info case and failed only the swallowed-info assertions; the fixed candidate passes both tests. The first fixture failure is retained separately. Upload completion is simulated in these native tests; they are not authenticated VSS, UI, restart or full-wallet acceptance.Required final native validation passed 2,956 unit tests and one Profile Recovery UI test, with zero failures and one fixture-dependent unit test skipped. All 1,688 frozen inputs match. SwiftFormat 0.64.0 passed 0/829, with 105 configured exclusions;
git diff --checkpassed. Complete diagnostics retain six Thread Performance Checker observations in unrelated test paths, plus platform audio/haptic notices; these are not described as warning-free or as a reproduced parent runtime baseline. The exact skipped case and diagnostic evidence remain in the sealed report.Two independent affected source reviews and complete native/structured diagnostics are recorded in
work/validation/ios1121-cached-blocktank-*20261103. All commits against the live parent are locally/GitHub verified. The live parent additionally contains an unrelated failure-diagnostic wrapper inPaykitPaymentRequestServiceTests; local and hosted synthetic-tree evidence retain their exact input scope. New-head hosted checks are pending inspection. The terminal complete-WALLET finding and J1 artifact gaps below remain open.Earlier-head native CI inspected — November 1, 23:22 UTC
At
a6f233df2dcefbd75b0f7b3c838db23d1a984493, native CI passed 2,954 unit tests and 39 physical UI executions, with five explicit skips, zero failures and no retries. The synthetic checkout tree exactly matches this published head; its actual CI parent is recorded in the audit. Earlier exact-head formatter evidence is reused, and skipped migration jobs remain skipped.Complete logs, all nested physical test summaries and 67 attachments were inspected and checksum/CRC verified. The complete linker-warning multiset matches the actual parent: 571 occurrences /286 symbols, with no introduced source compiler finding. Runtime evidence retains 48 CoreGraphics invalid-number messages, haptic/service errors and fixture limitations; passing assertions do not establish their cause or harmlessness. This is not an authenticated recovery or complete-WALLET acceptance pass; the terminal availability finding remains open. Evidence:
work/validation/hosted-ios1121-a6f-20261101-followup-a/NATIVE-REPORT.mdandwork/validation/hosted-ios1121-1123-native-root-integrity-20261101.json.Current parent composition — November 1, 21:42 UTC
Signed additive merge
a6f233df2dcefbd75b0f7b3c838db23d1a984493incorporates live #1120 at66a0320c98b66e7de99fc296c50dc536e42240fe; final treee0fe4f3004d38b91f98f097df886a3b4e154294f. The owned identity/restore patch is unchanged. The incoming last-channel-close publication repair and current-month test fixtures have one clean affected composition review, retaining the prior independent safety reviews.Required native validation passed 2,954 unit tests and one ProfileRecovery UI test, with one explicit USDT fixture skip and zero failures/retries. SwiftFormat 0.64.0 reports 0/828 files requiring changes (105 configured skips). All 1,687 frozen inputs match. Complete logs and nested XCResult issues were inspected: six unsymbolized QoS observations, three AppIntents notices and two UI launch-metric notices remain recorded; their timing cause is not established. All 14 live-base range commits are locally signed and GitHub
true/valid.Current-head native CI is now fully inspected above. This composition adds no authenticated restore journey pass and does not resolve the terminal complete-WALLET availability finding, which stays open. Previous runtime results and failures remain revision-specific. Evidence:
work/validation/ios1121-parent66a-review-20261101/andwork/validation/ios1121-parent66a-final-a/.Description
Ordinary wallet restore finishes after required wallet and USDT recovery, while optional Pubky activation and profile enrichment continue afterward. Same-revision initialization coalesces, and obsolete identity results cannot restore an earlier sign-in.
The reconnect follow-up in
0b77f099retries a missing own profile through existing foreground/reconnection maintenance. It retains the original authenticated session, returns without waiting for the public profile read, and uses the existing overlapping-read and profile-write guards. It does not re-import credentials, add a polling loop, or delay Home.Complete WALLET and METADATA capture still rejects unavailable or unreadable identity data. Terminal identity restoration can therefore leave newer ordinary WALLET state pending; the existing availability finding remains open. No stale SDK snapshot or partial backup is used.
Twin: synonymdev/bitkit-android#1686. This PR includes the earlier #1120 parent and now targets
master.Out of Scope
Current validation — November 1
Signed additive head
d83a21721b67045fdc4e6cb2816fb1988d5e924bincorporates published #1120/6140650c72cb7a3b4026d041a81960994b45a961; exact tree981bc42f0e4db778bb3799fd618b1aba168af354. The seven-file child delta is preserved. Incoming queued allowance offers now recheck their original identity/activation inside the SDK operation before native acceptance, including disable/re-enable while queued. The child's restore, backup and identity guards remain intact.Final build and selected native suite passed 2,953 unit tests plus one affected ProfileRecovery UI execution, zero failures/retries, with one explicit encrypted-USDT fixture skip. All 1,687 frozen inputs match. SwiftFormat 0.64.0 reports 0/828 needing changes, 105 configured exclusions; diff check is clean. Unchanged localization inputs retain their prior validation, not a new execution. Complete 23,253-line build/test output, all 2,955 canonical nested summaries, balanced sessions and 30 attachment payloads were inspected; the owner verified 11,979 sealed evidence files. The wrapper omits two passing cancellation tests and five canonical QoS warnings; those are reconciled in the report. Five unsymbolized QoS observations, two AppIntents notices and explicit negative-path/runtime log groups remain disclosed without a causal pre-existing or warning-free claim.
An affected independent composition review is clean, retaining the two shared concurrency reviews. All 13 complete live-base commits verify locally and on GitHub (
verified=true,reason=valid). Current-head hosted native and SwiftFormat are completely audited: 2,953 unit + 39 UI passing executions, five explicit skips, zero failures/native retries; 0/828 files need formatting. Syntheticd5a3690uses actual base6140650and exactly matches the published head tree. Complete logs, nested XCResults, attachments and artifact digests were inspected; all 18,580 sealed files verify. Native results retain 571 duplicate-symbol warning events (286 symbols), two AppIntents notices and a keyboard timeout/No-stack observation in a passing route test, without a timing-repair or warning-free claim. Actual native configuration is Xcode 16.4/iPhone 16/iOS 26.2. Migration's nine jobs were skipped; no new integration/E2E run is credited from the parent. Evidence:work/validation/hosted-ios1121-d83a-20261101/REPORT.md. The terminal complete-WALLET HIGH and unrun authenticated cases remain open. Other UI results below belong to their earlier revision; four workflow-excluded integration classes and the fixture skip are not passes. No new authenticated J1, process-kill restore or payment replay acceptance is claimed. Evidence:work/validation/ios1121-parent6140-final-a/REPORT.mdandios1121-parent6140-20261101/publication/. Ready status remainsdraft=false; existing reviewer requests are preserved.Retained findings and prior-head evidence
The terminal complete-WALLET availability finding remains open; no stale/nil SDK fallback or partial-backup substitution was added. The latest external terminal-identity report corroborates the existing issue with its stated Debug-control limits, not new author-verified full-app acceptance. The setup-pending correction in
e5143b13remains: intentionally missing profiles are not republished while setup is pending, both before scheduling and in the queued task; healthy recovery and stale-result rejection remain covered.At predecessor
624d7a38, hosted native and formatter were fully audited on the exact head tree: 2,962 logical / 2,991 physical passes, five explicit skips, zero failures/retries, format0/828. Complete diagnostics retain286 unique linker warnings/571 emissions, two AppIntents notices,72 NaN messages, six deliberate/conditional waiter timeouts and one internal hit-point activity failure in passing tests. Runtime detection was disabled. Nine migration jobs were skipped. Historical PATH-only formatter failure, package Git-alternate limits and older runtime observations remain in their sealed receipts; they are not silently waived or claimed reproduced by this composition.Design / Preview
No layout change. Home remains usable while optional identity recovery continues. A temporarily missing own profile can recover during ordinary maintenance without navigating to Profile or re-authenticating.
QA Notes
Setup
Use the committed Debug dependencies: Core 0.8.0-rc11, Paykit 0.1.1-rc2 and VSS 0.5.26-rc1. J1 needs a disposable test-network wallet, a complete VSS backup and saved identity. Delay only final optional activation/enrichment after metadata credential replacement and required recovery imports succeed. Preserve existing wallets and use no live funds.
Journeys
restore-during-identity-outage.xml: optional identity outage after required restore, complete-backup protection, screen exit, missing-profile reconnect, stale enrichment after identity replacement, restart, and required recovery failures retaining spending/address gates.The reconnect action holds a real profile read while maintenance continues, then expects Home to recover after release without manual Profile navigation. Native tests use controlled service resources and are not a complete authenticated app journey. The author's isolated complete-app J1 fault controls remain unprovisioned.
External simulator review 5658584985 reports six J1 actions at historical head
ec20b264using real SDK/VSS paths and uncommitted Debug fault controls. Its raw artifacts were not independently verified by the author. It does not establish this follow-up's new case, terminal unrecoverable identity, USDT-specific restore failure or a live homeserver blackout. Piotr's subsequent review retained the terminal-backup finding.Remaining findings and historical evidence
The terminal identity/full-WALLET finding remains unresolved on both platforms. Updated-reader compatibility was approved, but the released conditional VSS API alone cannot exclude legacy unconditional writers or version-reset ABA. This PR does not activate a split backup writer, infer historical incident causation, or claim that full-wallet redesign/contact CAS is acceptance evidence for J1. Pubky #741 merged externally; deployed server revision/configuration remains unverified.
The earlier backup-observer Set race repair and its failed run 40482860269 remain revision-scoped evidence; the exact competing schedule was not reproduced. Prior combined head
c0b1e86fpassed native CI 40719305858: 2,818 unit and 39 UI executions, one unit/four UI skips, zero failures. Its complete logs/nested results were inspected, and its 286 distinct linker warnings matched actual-parent evidence. Earlier failures, skips and runtime observations are retained, not erased or carried forward as new-head passes.Models used
Planning/implementation: gpt-6-astra (xhigh). Independent source/integration/diagnostic reviews: gpt-6-astra (xhigh) and gpt-6.1-sol (high), with actual execution metadata retained.