Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix(calls): stop the native call drawer crashing on a participant tap (#9054)
Peter Chinman42f9b90b78f1
diff --git a/.agents/rules/native/ios-plugins.md b/.agents/rules/native/ios-plugins.mdnew file mode 100644index 0000000000..6253319ec5--- /dev/null+++ b/.agents/rules/native/ios-plugins.md@@ -0,0 +1,26 @@+---+description: "iOS Tauri plugins create UIKit views and gesture recognizers in load(webview:), never in an initializer."+paths:+ - "apps/web/tauri/*/ios/**/*.swift"+globs: "apps/web/tauri/*/ios/**/*.swift"+alwaysApply: false+---++# Create UIKit objects in `load(webview:)`, not in a plugin initializer++Tauri constructs iOS plugins in `Builder::build`, before `run()` enters+`UIApplicationMain`. UIKit registers a gesture recognizer with the running+application when it is added to a view, so a recognizer created earlier (including+the built-in ones of a `UIScrollView`) keeps a nil delayed-touch dispatcher, and+UIKit aborts with `-[__NSArrayM insertObject:atIndex:]: object cannot be nil` in+`-[UIGestureRecognizer _delayTouchesForEvent:inPhase:]` the first time it delays a+touch. This crashed the native call drawer on every touch of its participant row.++- Build views, view controllers, and anything that owns them in `load(webview:)`+ or later, as `CallKitPlugin` does with `CallVideoOverlayController`.+- Don't initialize such objects in stored-property defaults or `init` of a+ `Plugin` subclass. Test harnesses that build UIKit objects after launch cannot+ catch this.++Check: no stored property or initializer of a `Plugin` subclass constructs a+`UIView`, `UIViewController`, `UIGestureRecognizer`, or a type that creates them.diff --git a/apps/web/min-native-build.json b/apps/web/min-native-build.jsonindex b78cbed95b..9922767e44 100644--- a/apps/web/min-native-build.json+++ b/apps/web/min-native-build.json@@ -1,4 +1,4 @@{"android": 1,- "ios": 191+ "ios": 192}diff --git a/apps/web/tauri/callkit_plugin/ios/Sources/CallKitPlugin.swift b/apps/web/tauri/callkit_plugin/ios/Sources/CallKitPlugin.swiftindex e2508d33a5..35f9b351e0 100644--- a/apps/web/tauri/callkit_plugin/ios/Sources/CallKitPlugin.swift+++ b/apps/web/tauri/callkit_plugin/ios/Sources/CallKitPlugin.swift@@ -39,7 +39,13 @@ struct SetCallDrawerChannelTitleArgs: Decodable {class CallKitPlugin: Plugin, @unchecked Sendable {private var mediaSession: NativeLiveKitCallSession?private var callCoordinator: IncomingCallCoordinator!- private let videoOverlay = CallVideoOverlayController()+ /// Created in `load(webview:)`, never in an initializer: Tauri constructs+ /// plugins before `UIApplicationMain`. UIKit registers a gesture recognizer+ /// with the running application when it's added to a view, so recognizers+ /// created earlier keep a nil delayed-touch dispatcher, and UIKit aborts+ /// (`insertObject:atIndex:` nil in `_delayTouchesForEvent:inPhase:`) the+ /// first time one of them delays a touch, e.g. on touching the participant row.+ private var videoOverlay: CallVideoOverlayController!private var pendingParticipantDisplayNamesByIdentity: [String: String] = [:]// Singleton channels avoid leaking listeners across webview reloads/HMR.@@ -58,6 +64,9 @@ class CallKitPlugin: Plugin, @unchecked Sendable {override public func load(webview: WKWebView) {callKitLog("Tauri CallKitPlugin loading")+ if videoOverlay == nil {+ videoOverlay = CallVideoOverlayController()+ }callCoordinator = IncomingCallCoordinator(mediaSession: { [weak self] inguard let self else {diff --git a/apps/web/tauri/src-tauri/gen/apple/NotificationServiceExtension/Info.plist b/apps/web/tauri/src-tauri/gen/apple/NotificationServiceExtension/Info.plistindex 8449ff3874..b3f14a547d 100644--- a/apps/web/tauri/src-tauri/gen/apple/NotificationServiceExtension/Info.plist+++ b/apps/web/tauri/src-tauri/gen/apple/NotificationServiceExtension/Info.plist@@ -17,9 +17,9 @@<key>CFBundlePackageType</key><string>XPC!</string><key>CFBundleShortVersionString</key>- <string>2.0.12</string>+ <string>2.0.13</string><key>CFBundleVersion</key>- <string>191</string>+ <string>192</string><key>NSExtension</key><dict><key>NSExtensionPointIdentifier</key>diff --git a/apps/web/tauri/src-tauri/gen/apple/ShareExtension/Info.plist b/apps/web/tauri/src-tauri/gen/apple/ShareExtension/Info.plistindex e281417f39..db4a60b771 100644--- a/apps/web/tauri/src-tauri/gen/apple/ShareExtension/Info.plist+++ b/apps/web/tauri/src-tauri/gen/apple/ShareExtension/Info.plist@@ -17,9 +17,9 @@<key>CFBundlePackageType</key><string>XPC!</string><key>CFBundleShortVersionString</key>- <string>2.0.12</string>+ <string>2.0.13</string><key>CFBundleVersion</key>- <string>191</string>+ <string>192</string><key>LSApplicationQueriesSchemes</key><array><string>macro</string>diff --git a/apps/web/tauri/src-tauri/gen/apple/app_iOS/Info.plist b/apps/web/tauri/src-tauri/gen/apple/app_iOS/Info.plistindex a1a72d864a..7366b6c966 100644--- a/apps/web/tauri/src-tauri/gen/apple/app_iOS/Info.plist+++ b/apps/web/tauri/src-tauri/gen/apple/app_iOS/Info.plist@@ -15,7 +15,7 @@<key>CFBundlePackageType</key><string>APPL</string><key>CFBundleShortVersionString</key>- <string>2.0.12</string>+ <string>2.0.13</string><key>CFBundleURLTypes</key><array><dict>@@ -28,7 +28,7 @@</dict></array><key>CFBundleVersion</key>- <string>191</string>+ <string>192</string><key>ITSAppUsesNonExemptEncryption</key><false/><key>LSApplicationQueriesSchemes</key>diff --git a/apps/web/tauri/src-tauri/gen/apple/project.yml b/apps/web/tauri/src-tauri/gen/apple/project.ymlindex 75846255ee..318d3190b2 100644--- a/apps/web/tauri/src-tauri/gen/apple/project.yml+++ b/apps/web/tauri/src-tauri/gen/apple/project.yml@@ -58,8 +58,8 @@ targets:- UIInterfaceOrientationPortraitUpsideDown- UIInterfaceOrientationLandscapeLeft- UIInterfaceOrientationLandscapeRight- CFBundleShortVersionString: 2.0.12- CFBundleVersion: "191"+ CFBundleShortVersionString: 2.0.13+ CFBundleVersion: "192"# Exempt encryption only (HTTPS / OS crypto): answers App Store# Connect's export-compliance questionnaire for every build. Keep in# sync with src-tauri/Info.ios.plist.@@ -145,8 +145,8 @@ targets:path: ShareExtension/Info.plistproperties:CFBundleDisplayName: Share to Macro- CFBundleShortVersionString: 2.0.12- CFBundleVersion: "191"+ CFBundleShortVersionString: 2.0.13+ CFBundleVersion: "192"LSApplicationQueriesSchemes:- macroNSExtension:@@ -180,8 +180,8 @@ targets:path: NotificationServiceExtension/Info.plistproperties:CFBundleDisplayName: NotificationServiceExtension- CFBundleShortVersionString: 2.0.12- CFBundleVersion: "191"+ CFBundleShortVersionString: 2.0.13+ CFBundleVersion: "192"NSExtension:NSExtensionPointIdentifier: com.apple.usernotifications.serviceNSExtensionPrincipalClass: $(PRODUCT_MODULE_NAME).NotificationServicediff --git a/apps/web/tauri/src-tauri/tauri.ios.conf.json b/apps/web/tauri/src-tauri/tauri.ios.conf.jsonindex f69d7db81d..7f6dac831d 100644--- a/apps/web/tauri/src-tauri/tauri.ios.conf.json+++ b/apps/web/tauri/src-tauri/tauri.ios.conf.json@@ -1,9 +1,9 @@{"productName": "macro",- "version": "2.0.12",+ "version": "2.0.13","bundle": {"iOS": {- "bundleVersion": "191"+ "bundleVersion": "192"}}}