also looking at this
feat(ios): haptic, whose reason expired when ios_config landed
#130
3 files
+236
-78
| @@ -382,8 +382,10 @@ comptime { | ||
| 382 | 382 | /// |
| 383 | 383 | /// `.status = .unavailable` in a module's manifest means the handler is |
| 384 | 384 | /// reachable and refuses, deliberately, because Zig cannot do the thing |
| 385 | /// correctly — `haptic` cannot see `config.enableHaptics`, and the rest say | |
| 386 | /// why in their own `reason`. | |
| 385 | /// correctly; each one says why in its own `reason`. `haptic` was the example | |
| 386 | /// this comment used to give, and is now the example of a reason expiring: | |
| 387 | /// `ios_config.zig` made `config.enableHaptics` readable and the refusal | |
| 388 | /// outlived it. | |
| 387 | 389 | /// |
| 388 | 390 | /// In the Zig-hosted app that refusal is the honest end of the line: `route` |
| 389 | 391 | /// tries `handOffToHost` next, and the shim is what actually serves it. The |
| @@ -391,8 +393,9 @@ comptime { | ||
| 391 | 393 | /// deliberately does not consult `handOffToHost`, because there the host *is* |
| 392 | 394 | /// the caller. So claiming one of these would not be a refusal instead of an |
| 393 | 395 | /// answer, it would be a refusal instead of the *host's working answer*: an app |
| 394 | /// that has haptics today would stop buzzing the moment the runtime was linked, | |
| 395 | /// and the page would get a rejection where it used to get silence-and-a-buzz. | |
| 396 | /// that had haptics would have stopped buzzing the moment the runtime was | |
| 397 | /// linked, and the page would have got a rejection where it used to get | |
| 398 | /// silence-and-a-buzz. | |
| 396 | 399 | /// |
| 397 | 400 | /// `test/ios_conformance_test.zig` already treats falling through as better |
| 398 | 401 | /// than `.unavailable`. This is that rule, applied to the one path that had no |
| @@ -904,7 +907,6 @@ test "an action declared unavailable is left to the host, not claimed" { | ||
| 904 | 907 | // the difference, linking the runtime replaced the working answer with a |
| 905 | 908 | // rejection. `false` here is what sends the call back to Swift's switch. |
| 906 | 909 | const declared_unavailable = [_][]const u8{ |
| 907 | "haptic", | |
| 908 | 910 | "getNetworkStatus", |
| 909 | 911 | "lockOrientation", |
| 910 | 912 | "unlockOrientation", |
| @@ -929,7 +931,7 @@ test "the fall-through is read from the manifests, not from a list kept beside t | ||
| 929 | 931 | } |
| 930 | 932 | } |
| 931 | 933 | } |
| 932 | try testing.expectEqual(@as(usize, 4), declared); | |
| 934 | try testing.expectEqual(@as(usize, 3), declared); | |
| 933 | 935 | } |
| 934 | 936 | |
| 935 | 937 | test "a live action is still claimed, unavailable is not a blanket hand-back" { |
| @@ -937,6 +939,10 @@ test "a live action is still claimed, unavailable is not a blanket hand-back" { | ||
| 937 | 939 | // `.live`, so the seam must keep claiming it. A fall-through that widened |
| 938 | 940 | // to whole modules would silently un-migrate everything beside a refusal. |
| 939 | 941 | try testing.expect(!hostServesItself("vibrate")); |
| 942 | // `haptic` was the fourth entry above until `ios_config.zig` made the gate | |
| 943 | // it could not read readable. It is served here now, so handing it back | |
| 944 | // would hand back a working action. | |
| 945 | try testing.expect(!hostServesItself("haptic")); | |
| 940 | 946 | try testing.expect(!hostServesItself("setKeepAwake")); |
| 941 | 947 | try testing.expect(!hostServesItself("getDeviceInfo")); |
| 942 | 948 | try testing.expect(!hostServesItself("noSuchAction")); |