Commit abde130
fix(swift-sdk): only claim "newer build" where the evidence has a direction
A hash disagreement is symmetric — it says the store's shape of an entity is
not the live model's, not which came first. V1/V2/V3 are unfrozen, so adding
one attribute to any live model makes every EXISTING store disagree on that
entity: an older store, reported as a newer one, with "reset the wallet" as
the offered remedy. An unregistered version identifier is ambiguous the same
way (pre-V1, or a version since dropped from the plan). Both become
`.unplaceable`, which rethrows SwiftData's own error. The one asymmetric
fact left — the store carries an entity this schema does not have — keeps
`newerThanRegistered`, and with it the only honest "update the app".
Last round's cancellation fix overshot: latching above the handle guard also
latched on the guard's deliberately uncached no-op return, so a manager built
and shut down before `configure()` could never produce a support export
again. The latch is now as conditional as the state it accompanies — a live
handle, or a pass actually in flight, counted for both halves.
The flag was also polled at only three points, so `shutdown()`'s drain could
wait for the whole-wallet fingerprint, the per-account snapshots and
`logTxoAnomalies` — the stages that dominate the queue hold. Each is gated
now, and the audit's check no longer hides inside `if let allTransactions`,
where it was skipped exactly when the audit had already been declined.
The #4438 audit knew only BIP44 addresses, so a mixed send's own CoinJoin
change was booked as "unattributed" — documented as peers' outputs — and a
CoinJoin-side output missing from PersistentTxo was invisible: a third route
to the false all-clear. The pool now covers CoinJoin accounts, the account
check compares against the account the pool named, and the missing counts
are reported per side.
Also: every early return out of the memory half now emits its
`diff_incomplete=true` summary, since an absent summary reads as a truncated
log; and the export entry point documents that its only caller is the host
app, by design.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent d86a763 commit abde130
4 files changed
Lines changed: 243 additions & 69 deletions
File tree
- packages/swift-sdk
- Sources/SwiftDashSDK
- Persistence
- PlatformWallet
- SwiftTests/SwiftDashSDKTests
Lines changed: 31 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
173 | 181 | | |
174 | | - | |
175 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
176 | 186 | | |
177 | 187 | | |
178 | | - | |
| 188 | + | |
179 | 189 | | |
180 | 190 | | |
181 | 191 | | |
| |||
193 | 203 | | |
194 | 204 | | |
195 | 205 | | |
196 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
197 | 209 | | |
198 | 210 | | |
199 | 211 | | |
| |||
229 | 241 | | |
230 | 242 | | |
231 | 243 | | |
232 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
233 | 254 | | |
234 | 255 | | |
235 | 256 | | |
| |||
Lines changed: 38 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
476 | | - | |
477 | | - | |
| 476 | + | |
| 477 | + | |
478 | 478 | | |
479 | | - | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
480 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
481 | 504 | | |
482 | 505 | | |
483 | 506 | | |
| |||
678 | 701 | | |
679 | 702 | | |
680 | 703 | | |
681 | | - | |
682 | | - | |
683 | | - | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
684 | 716 | | |
685 | 717 | | |
686 | 718 | | |
| |||
0 commit comments