also looking at this
iOS Phase 8: the presented pickers — ratchet 58 → 53, last mechanism landed
#90
11 files
+5752
-12
| @@ -45,11 +45,15 @@ const char craft_slice_page[] = | ||
| 45 | 45 | " bridge.postMessage({t:'mobile', a:'getDeviceInfo', i:3});\n" |
| 46 | 46 | "}\n" |
| 47 | 47 | "\n" |
| 48 | "var sentErrorAck = false;\n" | |
| 48 | "var sentErrorAck = false, sentCode = false;\n" | |
| 49 | 49 | "window.__craftBridgeError = function (ctx) {\n" |
| 50 | 50 | " // The message crossed Zig's escaping with a backslash, quote, and\n" |
| 51 | 51 | " // newline intact; anything mangled and this equality fails, i=7 never\n" |
| 52 | 52 | " // fires, and the harness reports the error route broken.\n" |
| 53 | " if (!sentCode && ctx && ctx.code === 'PERMISSION_DENIED' && ctx.id === 70) {\n" | |
| 54 | " sentCode = true;\n" | |
| 55 | " bridge.postMessage({t:'mobile', a:'getDeviceInfo', i:18});\n" | |
| 56 | " }\n" | |
| 53 | 57 | " var messageIntact = ctx && ctx.message === 'declined \\\\ \"on purpose\"\\nsecond line';\n" |
| 54 | 58 | " if (!sentErrorAck && ctx && ctx.error === true && ctx.code === 'HOST_DECLINED'\n" |
| 55 | 59 | " && ctx.id === 6 && messageIntact) {\n" |
| @@ -123,7 +127,9 @@ const char craft_slice_page[] = | ||
| 123 | 127 | " bridge.postMessage({t:'mobile', a:'getPendingNotifications', i:50});\n" " // Motion is unavailable on a simulator, so this must REJECT — an\n" |
| 124 | 128 | " // honest refusal, not a fabricated stream of zeros. i=16 stays unsent,\n" |
| 125 | 129 | " // which is the assertion.\n" |
| 126 | " bridge.postMessage({t:'mobile', a:'startMotionUpdates', i:60});\n" | |
| 130 | " bridge.postMessage({t:'mobile', a:'startMotionUpdates', i:60});\n" " // No camera on a simulator. The refusal must name its own cause —\n" | |
| 131 | " // a specific code, not the generic native-failure catch-all.\n" | |
| 132 | " bridge.postMessage({t:'mobile', a:'openCamera', i:70});\n" | |
| 127 | 133 | " // A Tier-0 action migrated in this phase, served by Zig directly.\n" |
| 128 | 134 | " bridge.postMessage({t:'mobile', a:'getAppState', i:88});\n" |
| 129 | 135 | " // And one the shim answers by rejecting, to prove the error route.\n" |