Repository navigation
Description
PastaClaw flagged this while reviewing #6124, where it was deferred to a follow-up instead of being fixed in that pull request. This issue tracks the follow-up.
Any SwiftData persist failure is reported as a fatal changeset error (suggestion)
Impact: Any SwiftData failure while persisting profiles or addresses returns 1 from the callback, which Rust maps to PersistenceErrorKind::Fatal, so a transient failure such as a locked store is treated as never-retryable.
Where: packages/swift-sdk/Sources/SwiftDashSDK/PlatformWallet/PlatformWalletPersistenceHandler.swift:10631-10636 at 2cca325ba3ef:
Lines 10631 to 10636 in 2cca325
| let success = handler.persistIdentities( | |
| walletId: walletId, | |
| upserts: upserts, | |
| removed: removed | |
| ) | |
| return success ? 0 : 1 |
Consequence: the wallet may stop retrying a round that would succeed later. Mechanism: persistIdentities returns Bool and the C shim returns success ? 0 : 1, while persist_rc_kind maps every code other than -2/-3 to Fatal, and the surrounding docs describe 1 as the generic non-zero. A save failure is at least sometimes transient or a constraint violation, not a poison changeset, and this PR adds new fallible work (address replace/remove) into that same Bool path. Fix: return PLATFORM_WALLET_PERSIST_RC_TRANSIENT (or CONSTRAINT where appropriate) from the failure path instead of 1, or map 1 to Transient on the Rust side for this callback; note the existing conservative-Fatal intent, so a transient mapping should bound retries rather than retry forever.
Origin
- Pull request: feat(platform-wallet)!: a DashPay profile carries its payment addresses through the wallet, FFI and Swift #6124
- Review thread: feat(platform-wallet)!: a DashPay profile carries its payment addresses through the wallet, FFI and Swift #6124 (comment)
- Filed by PastaClaw when it accepted the deferral, as nothing else tracked it.
Activity