ReviewOS

also looking at this

craft-native/craft

feat(ios): location recording moves to the manager it always shared — ratchet 23 -> 18

#125
Merged glennmichael123 wants to merge feat/ios-location-recording into main
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.

packages/zig/src/bridge_mobile_location.zigmodifiedformatting only+0-1
Changes to packages/zig/src/bridge_mobile_location.zig
@@ -792,7 +792,6 @@ pub const LocationBridge = struct {
792792 }
793793};
794794
795
796795// =============================================================================
797796// The recorder's shared machinery: the manager hand-off, the state commit, and
798797// the two values Swift takes from Foundation.
packages/zig/src/bridge_mobile_locrecording.zigmodified+3-6
Changes to packages/zig/src/bridge_mobile_locrecording.zig
@@ -1684,8 +1684,7 @@ test "a stopped recording's leftovers read back as no recording at all" {
16841684 // Swift's `guard state["active"] as? Bool == true else { return }` means a
16851685 // relaunch after a stop restores nothing. A reader that handed back the id
16861686 // 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,
16891688 \\{"active":false,"paused":false,"id":"ABC-123","startedAt":1756900000000}
16901689 );
16911690 defer state.deinit(testing.allocator);
@@ -1697,8 +1696,7 @@ test "a stopped recording's leftovers read back as no recording at all" {
16971696}
16981697
16991698test "an active recording restores all four fields" {
1700 var state = try decodeState(
1701 testing.allocator,
1699 var state = try decodeState(testing.allocator,
17021700 \\{"active":true,"paused":true,"id":"ABC-123","startedAt":1756900000000}
17031701 );
17041702 defer state.deinit(testing.allocator);
@@ -1740,8 +1738,7 @@ test "the active guard is a Bool cast, not a truthiness test" {
17401738test "past the guard a wrong type is a default, not a refusal" {
17411739 // Swift's remaining reads are `as? Bool ?? false`, `as? String` and
17421740 // `as? TimeInterval`, all of which degrade rather than throw.
1743 var state = try decodeState(
1744 testing.allocator,
1741 var state = try decodeState(testing.allocator,
17451742 \\{"active":true,"paused":"yes","id":42,"startedAt":"soon"}
17461743 );
17471744 defer state.deinit(testing.allocator);