Skip to content

[bug] fileAssociations missing LSHandlerRank on macOS #13159

@tjramage

Description

@tjramage

Describe the bug

When using the bundle.fileAssociations setting in the Tauri configuration, a CFBundleDocumentTypes key is created in the bundled Info.plist. However, this is missing the LSHandlerRank and Apple warns after uploading to App Store Connect:

ITMS-90788: Incomplete Document Type Configuration

The CFBundleDocumentTypes dictionary array in the '<com.example.myapp>' Info.plist should contain an LSHandlerRank value for the CFBundleTypeName '' entry. Refer to https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-SW1 for more information on the LSHandlerRank key.

Reproduction

Set bundle.fileAssociations in your Tauri config, e.g:

"fileAssociations": [{
  "name": "Email Message",
  "ext": ["eml"],
  "mimeType": "message/rfc822",
  "role": "Viewer"
}]

The related section in Info.plist is created as the following:

<key>CFBundleDocumentTypes</key>
<array>
	<dict>
		<key>CFBundleTypeExtensions</key>
		<array>
			<string>eml</string>
		</array>
		<key>CFBundleTypeName</key>
		<string>Email Message</string>
		<key>CFBundleTypeRole</key>
		<string>Viewer</string>
	</dict>
</array>

Expected behavior

The required Launch Service Handler Rank key should also be included:

<key>LSHandlerRank</key>
<string>Alternate</string>

The option to set Owner | Default | Alternate | None should be configurable in the FileAssociation type, as per Apple's docs: https://developer.apple.com/documentation/bundleresources/information-property-list/cfbundledocumenttypes/lshandlerrank

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.4.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.85.1 (4eb161250 2025-03-15)
    ✔ cargo: 1.85.1 (d73d2caf9 2024-12-31)
    ✔ rustup: 1.28.1 (f9edccde0 2025-03-05)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.8.0
    - yarn: 1.22.19
    - npm: 10.1.0
    - bun: 1.2.2

[-] Packages
    - tauri 🦀: 2.4.0, (outdated, latest: 2.4.1)
    - tauri-build 🦀: 2.1.0, (outdated, latest: 2.1.1)
    - wry 🦀: 0.50.5
    - tao 🦀: 0.32.8
    - @tauri-apps/api : 2.4.1
    - @tauri-apps/cli : 2.4.1

[-] Plugins
    - tauri-plugin-window-state 🦀: 2.2.1, (outdated, latest: 2.2.2)
    - @tauri-apps/plugin-window-state : 2.2.2
    - tauri-plugin-shell 🦀: 2.2.0, (outdated, latest: 2.2.1)
    - @tauri-apps/plugin-shell : 2.2.1
    - tauri-plugin-http 🦀: 2.4.2, (outdated, latest: 2.4.3)
    - @tauri-apps/plugin-http : 2.4.3
    - tauri-plugin-opener 🦀: 2.2.6
    - @tauri-apps/plugin-opener : 2.2.6
    - tauri-plugin-clipboard-manager 🦀: 2.2.2
    - @tauri-apps/plugin-clipboard-manager : 2.2.2
    - tauri-plugin-fs 🦀: 2.2.0, (outdated, latest: 2.2.1)
    - @tauri-apps/plugin-fs : 2.2.1
    - tauri-plugin-dialog 🦀: 2.2.0, (outdated, latest: 2.2.1)
    - @tauri-apps/plugin-dialog : 2.2.1
    - tauri-plugin-store 🦀: 2.2.0
    - @tauri-apps/plugin-store : 2.2.0

[-] App
    - build-type: bundle
    - CSP: style-src 'unsafe-inline' 'self'; connect-src ipc: http://ipc.localhost; font-src https://fonts.gstatic.com; img-src * blob: data: asset: http://asset.localhost; default-src 'self' ipc: http://ipc.localhost asset:
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace


Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions