Commit d86a763
fix(swift-sdk): never claim drift from a comparison that did not happen
`storeSchemaVerdict` returned `driftedRegisteredVersion` — the one verdict
that authorizes inferred lightweight migration — for a store whose metadata
carried no entity hashes at all: nothing disagreed because nothing was
compared, and the store would have been opened by inference and trimmed to
the current schema. Drift now requires at least one entity actually
compared and at least one actually disagreeing.
Stores that cannot be placed no longer borrow the newer-build error either.
`no_version_identifier` is an old or truncated store as much as a new one,
and `storeFromNewerBuild` tells the user to update the app or reset the
wallet — destructive advice on a store that is fine. A new `.unplaceable`
verdict rethrows SwiftData's own error instead, with the verdict in the log.
`shutdown()` raised the diagnostics cancellation after the handle guard, so
a pass running for a never-configured manager — the branch that deliberately
runs its database half without a handle — could not be told to stop, and
held the persistence queue across teardown. Cancel before the guard.
The #4438 audit reported a clean, complete result when the persisted BIP44
address pool was empty: every output fell through as unattributed and
nothing reached the missing-TXO check, on exactly the wallet whose address
rows went missing. An empty pool is now an incompleteness like an
undecodable transaction. Deliberately not `unattributed_output_count > 0`:
a CoinJoin transaction pays its peers, so every healthy audit has some.
Also: an autorelease pool per account in the memory half, matching the
database half — the whole loop is one GCD work item, so the peak was the sum
of every account rather than the largest; and the restore snapshot no longer
classifies every row on the errored path, where it faulted a relationship
per row, at launch, under the queue, to describe a load being discarded.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 668a707 commit d86a763
5 files changed
Lines changed: 176 additions & 68 deletions
File tree
- packages/swift-sdk
- Sources/SwiftDashSDK
- Persistence
- PlatformWallet
- SwiftTests/SwiftDashSDKTests
Lines changed: 37 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
82 | 90 | | |
83 | 91 | | |
84 | 92 | | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
88 | 96 | | |
| 97 | + | |
89 | 98 | | |
90 | 99 | | |
91 | 100 | | |
| |||
168 | 177 | | |
169 | 178 | | |
170 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
171 | 183 | | |
172 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
173 | 193 | | |
174 | 194 | | |
175 | 195 | | |
| |||
195 | 215 | | |
196 | 216 | | |
197 | 217 | | |
198 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
199 | 225 | | |
200 | 226 | | |
201 | 227 | | |
202 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
203 | 232 | | |
204 | 233 | | |
205 | 234 | | |
| |||
475 | 504 | | |
476 | 505 | | |
477 | 506 | | |
478 | | - | |
479 | | - | |
480 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
481 | 513 | | |
482 | 514 | | |
483 | 515 | | |
| |||
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
243 | 249 | | |
244 | 250 | | |
245 | 251 | | |
246 | | - | |
| 252 | + | |
| 253 | + | |
247 | 254 | | |
248 | 255 | | |
249 | 256 | | |
| |||
318 | 325 | | |
319 | 326 | | |
320 | 327 | | |
321 | | - | |
| 328 | + | |
322 | 329 | | |
323 | 330 | | |
324 | 331 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
676 | 684 | | |
677 | 685 | | |
678 | 686 | | |
| |||
Lines changed: 107 additions & 60 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
720 | 720 | | |
721 | 721 | | |
722 | 722 | | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | 723 | | |
729 | 724 | | |
730 | 725 | | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
736 | 758 | | |
737 | 759 | | |
738 | 760 | | |
| |||
1057 | 1079 | | |
1058 | 1080 | | |
1059 | 1081 | | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
1060 | 1098 | | |
1061 | 1099 | | |
1062 | 1100 | | |
1063 | | - | |
1064 | | - | |
| 1101 | + | |
1065 | 1102 | | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
| 1103 | + | |
| 1104 | + | |
1069 | 1105 | | |
1070 | 1106 | | |
1071 | 1107 | | |
| |||
1456 | 1492 | | |
1457 | 1493 | | |
1458 | 1494 | | |
1459 | | - | |
1460 | 1495 | | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
1464 | | - | |
1465 | | - | |
1466 | | - | |
1467 | | - | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
1468 | 1537 | | |
1469 | 1538 | | |
1470 | 1539 | | |
1471 | | - | |
1472 | 1540 | | |
| 1541 | + | |
1473 | 1542 | | |
1474 | | - | |
| 1543 | + | |
1475 | 1544 | | |
1476 | | - | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
1477 | 1556 | | |
1478 | 1557 | | |
1479 | 1558 | | |
1480 | | - | |
| 1559 | + | |
1481 | 1560 | | |
1482 | | - | |
1483 | | - | |
1484 | | - | |
1485 | | - | |
1486 | | - | |
1487 | | - | |
1488 | | - | |
1489 | | - | |
1490 | | - | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
1494 | | - | |
1495 | | - | |
1496 | | - | |
1497 | | - | |
1498 | | - | |
1499 | | - | |
1500 | | - | |
1501 | | - | |
1502 | | - | |
1503 | | - | |
1504 | | - | |
1505 | | - | |
1506 | | - | |
1507 | | - | |
1508 | | - | |
1509 | | - | |
1510 | | - | |
1511 | | - | |
1512 | | - | |
1513 | | - | |
1514 | | - | |
| 1561 | + | |
1515 | 1562 | | |
1516 | 1563 | | |
1517 | 1564 | | |
| |||
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
360 | 363 | | |
361 | 364 | | |
362 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
363 | 377 | | |
364 | 378 | | |
365 | 379 | | |
| |||
0 commit comments