ReviewOS

craft-native/craft

fix(ios): dispatcher hides WebViewHandleNotSet from system actions

#271
Closed glennmichael123 opened this 9 days ago ·
9 days ago

Found while auditing the error-narrowing choke point for #242 / #270. This is separate from BUSY.

bridge_mobile_system.zig returns BridgeError.WebViewHandleNotSet from topmostViewController() and keyWindowScene() when the iOS dispatcher has no webview. ios_dispatch.asBridgeError currently recognizes the established handler-error subset plus Busy; an unlisted explicit bridge error falls through to NativeCallFailed. The page therefore receives NATIVE_CALL_FAILED instead of the more specific WEBVIEW_HANDLE_NOT_SET.

Relevant production returns:

  • packages/zig/src/bridge_mobile_system.zig:696
  • packages/zig/src/bridge_mobile_system.zig:732
  • narrowing at packages/zig/src/ios_dispatch.zig (asBridgeError)

The #270 fix deliberately preserves the pre-existing narrowing vocabulary except for adding Busy, so it does not silently broaden that corrective PR. A focused follow-up should decide whether all BridgeError members must survive narrowing, add a table-driven assertion for every protocol variant that handlers can return, and pin an affected system action end to end.

Sign in to comment on this issue.