also looking at this
feat(ios): location recording moves to the manager it always shared — ratchet 23 -> 18
#125
6 files
+1653
-170
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -792,7 +792,6 @@ pub const LocationBridge = struct { | ||
| 792 | 792 | } |
| 793 | 793 | }; |
| 794 | 794 | |
| 795 | ||
| 796 | 795 | // ============================================================================= |
| 797 | 796 | // The recorder's shared machinery: the manager hand-off, the state commit, and |
| 798 | 797 | // the two values Swift takes from Foundation. |
| @@ -1684,8 +1684,7 @@ test "a stopped recording's leftovers read back as no recording at all" { | ||
| 1684 | 1684 | // Swift's `guard state["active"] as? Bool == true else { return }` means a |
| 1685 | 1685 | // relaunch after a stop restores nothing. A reader that handed back the id |
| 1686 | 1686 | // would answer `{"id":"ABC-123"}` where Swift answers `{"id":null}`. |
| 1687 | var state = try decodeState( | |
| 1688 | testing.allocator, | |
| 1687 | var state = try decodeState(testing.allocator, | |
| 1689 | 1688 | \\{"active":false,"paused":false,"id":"ABC-123","startedAt":1756900000000} |
| 1690 | 1689 | ); |
| 1691 | 1690 | defer state.deinit(testing.allocator); |
| @@ -1697,8 +1696,7 @@ test "a stopped recording's leftovers read back as no recording at all" { | ||
| 1697 | 1696 | } |
| 1698 | 1697 | |
| 1699 | 1698 | test "an active recording restores all four fields" { |
| 1700 | var state = try decodeState( | |
| 1701 | testing.allocator, | |
| 1699 | var state = try decodeState(testing.allocator, | |
| 1702 | 1700 | \\{"active":true,"paused":true,"id":"ABC-123","startedAt":1756900000000} |
| 1703 | 1701 | ); |
| 1704 | 1702 | defer state.deinit(testing.allocator); |
| @@ -1740,8 +1738,7 @@ test "the active guard is a Bool cast, not a truthiness test" { | ||
| 1740 | 1738 | test "past the guard a wrong type is a default, not a refusal" { |
| 1741 | 1739 | // Swift's remaining reads are `as? Bool ?? false`, `as? String` and |
| 1742 | 1740 | // `as? TimeInterval`, all of which degrade rather than throw. |
| 1743 | var state = try decodeState( | |
| 1744 | testing.allocator, | |
| 1741 | var state = try decodeState(testing.allocator, | |
| 1745 | 1742 | \\{"active":true,"paused":"yes","id":42,"startedAt":"soon"} |
| 1746 | 1743 | ); |
| 1747 | 1744 | defer state.deinit(testing.allocator); |